tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

compat code function pointers



Hi,

Paul and I have been working towards separating the compat code from the
main kernel and eliminating all the COMPAT_XX ifdefs. This will allow
the compat modules to work properly even if the kernel is not compiled
with the compat options.

The general approach to this is to move all the compat code out of the
main kernel leaving behind function pointers that typically point to
noops (enosys) that the compat code can then repoint to the compat code
functions when it loads (and re-point them to noops when it unloads).

The question came up where to store the function pointers for device
drivers that are not always present in the kernel. We could use weak
references in the compat code so that the code links, but the kernel
linker does not currently support weak pointers. Another alternative
is to create a file in the kernel that contains those function pointers.

Paul suggested:

	src/sys/kern/kern_junk.c
	src/sys/sys/kern_junk.h

I suggested:

	src/sys/kern/kern_compat.c
	src/sys/sys/compat.h

Opinions?

christos


Home | Main Index | Thread Index | Old Index