svn commit: r209928 - head/sys/mips/include
Bruce Evans
brde at optusnet.com.au
Mon Jul 12 09:42:05 UTC 2010
On Mon, 12 Jul 2010, Jayachandran C. wrote:
> Log:
> Move KSEG address definitions from cpu.h to cpuregs.h with the other
> definitions, add some XKPHYS related definitions for n64.
This is a good start to cleaning up mips cpu.h. but far from complete.
cpu.h is for MD implementations of a few (about 10) MI interfaces. Most
cpu.h's are about 2K long but the mips one is about 17K.
The arm one is the smallest, partly because it is missing a copyright, but
it still consists about half of things that shouldn't be in it.
The amd64 one is the most correct. The only bugs in it are:
- lots of namespace pollution via nested includes. Unfortunately a couple
of things in the nested includes are needed to implement the macros in
this file.
- COPY_SIGCODE is defined, but seems to have never been used in FreeBSD.
4.4BSD had it in all cpu.h's and may even have used it in its <Body
deleted> execve(), but FreeBSD only has it in a few cpu.h's and has no
references to it in any other source file at any time.
- cpu_halt() and cpu_reset() have a MI interface and don't need to be
implemented as a macro, so they should be declared in an MI place.
Perhaps similarly for some other cpu_*() functions. cpu_excec() and
cpu_swapin() are now empty macros for amd64, but they could be empty
functions.
- fork_trampoline() is are declared, but is not used by MI code (but is
referred to in comments in MI code).
- swi_vm(): like cpu*_() but more MI. Only missing busdma support
for some archines makes it MD. It is a callback function and cannot
be a macro since its address is taken so that it can be called back to.
amd64 cpu.h ends up with definitions or declarations for:
- 3 things that need to be there
- 7 things that don't need to be there, but can reasonably be there
- 2 things that shouldn't be there
- 2 things that really shouldn't be there
- 1 thing that shouldn't be anywhere
- uncounted namespace pollution from the nested includes.
Bruce
More information about the svn-src-head
mailing list