From 8a6d48c0542876eb3acfc0970c0ab7872db08d5f Mon Sep 17 00:00:00 2001 From: Zheng Da Date: Sun, 6 Dec 2009 05:26:23 +0100 Subject: check in the original version of dde linux26. --- libdde_linux26/include/linux/init.h | 374 ++++++++++++++++++++++++++++++++++++ 1 file changed, 374 insertions(+) create mode 100644 libdde_linux26/include/linux/init.h (limited to 'libdde_linux26/include/linux/init.h') diff --git a/libdde_linux26/include/linux/init.h b/libdde_linux26/include/linux/init.h new file mode 100644 index 00000000..13b3d9c9 --- /dev/null +++ b/libdde_linux26/include/linux/init.h @@ -0,0 +1,374 @@ +#ifndef _LINUX_INIT_H +#define _LINUX_INIT_H + +#ifdef DDE_LINUX +#include +#endif +#include + +/* These macros are used to mark some functions or + * initialized data (doesn't apply to uninitialized data) + * as `initialization' functions. The kernel can take this + * as hint that the function is used only during the initialization + * phase and free up used memory resources after + * + * Usage: + * For functions: + * + * You should add __init immediately before the function name, like: + * + * static void __init initme(int x, int y) + * { + * extern int z; z = x * y; + * } + * + * If the function has a prototype somewhere, you can also add + * __init between closing brace of the prototype and semicolon: + * + * extern int initialize_foobar_device(int, int, int) __init; + * + * For initialized data: + * You should insert __initdata between the variable name and equal + * sign followed by value, e.g.: + * + * static int init_variable __initdata = 0; + * static char linux_logo[] __initdata = { 0x32, 0x36, ... }; + * + * Don't forget to initialize data not at file scope, i.e. within a function, + * as gcc otherwise puts the data into the bss section and not into the init + * section. + * + * Also note, that this data cannot be "const". + */ + +/* These are for everybody (although not all archs will actually + discard it in modules) */ +#ifndef DDE_LINUX +#define __init __section(.init.text) __cold notrace +#else +#define __init __used +#endif +#define __initdata __section(.init.data) +#define __initconst __section(.init.rodata) +#define __exitdata __section(.exit.data) +#define __exit_call __used __section(.exitcall.exit) + +/* modpost check for section mismatches during the kernel build. + * A section mismatch happens when there are references from a + * code or data section to an init section (both code or data). + * The init sections are (for most archs) discarded by the kernel + * when early init has completed so all such references are potential bugs. + * For exit sections the same issue exists. + * The following markers are used for the cases where the reference to + * the *init / *exit section (code or data) is valid and will teach + * modpost not to issue a warning. + * The markers follow same syntax rules as __init / __initdata. */ +#define __ref __section(.ref.text) noinline +#define __refdata __section(.ref.data) +#define __refconst __section(.ref.rodata) + +/* backward compatibility note + * A few places hardcode the old section names: + * .text.init.refok + * .data.init.refok + * .exit.text.refok + * They should be converted to use the defines from this file + */ + +/* compatibility defines */ +#define __init_refok __ref +#define __initdata_refok __refdata +#define __exit_refok __ref + + +#ifdef MODULE +#define __exitused +#else +#define __exitused __used +#endif + +#define __exit __section(.exit.text) __exitused __cold + +/* Used for HOTPLUG */ +#define __devinit __section(.devinit.text) __cold +#define __devinitdata __section(.devinit.data) +#define __devinitconst __section(.devinit.rodata) +#define __devexit __section(.devexit.text) __exitused __cold +#define __devexitdata __section(.devexit.data) +#define __devexitconst __section(.devexit.rodata) + +/* Used for HOTPLUG_CPU */ +#define __cpuinit __section(.cpuinit.text) __cold +#define __cpuinitdata __section(.cpuinit.data) +#define __cpuinitconst __section(.cpuinit.rodata) +#define __cpuexit __section(.cpuexit.text) __exitused __cold +#define __cpuexitdata __section(.cpuexit.data) +#define __cpuexitconst __section(.cpuexit.rodata) + +/* Used for MEMORY_HOTPLUG */ +#define __meminit __section(.meminit.text) __cold +#define __meminitdata __section(.meminit.data) +#define __meminitconst __section(.meminit.rodata) +#define __memexit __section(.memexit.text) __exitused __cold +#define __memexitdata __section(.memexit.data) +#define __memexitconst __section(.memexit.rodata) + +/* For assembly routines */ +#define __HEAD .section ".head.text","ax" +#define __INIT .section ".init.text","ax" +#define __FINIT .previous + +#define __INITDATA .section ".init.data","aw" +#define __INITRODATA .section ".init.rodata","a" +#define __FINITDATA .previous + +#define __DEVINIT .section ".devinit.text", "ax" +#define __DEVINITDATA .section ".devinit.data", "aw" +#define __DEVINITRODATA .section ".devinit.rodata", "a" + +#define __CPUINIT .section ".cpuinit.text", "ax" +#define __CPUINITDATA .section ".cpuinit.data", "aw" +#define __CPUINITRODATA .section ".cpuinit.rodata", "a" + +#define __MEMINIT .section ".meminit.text", "ax" +#define __MEMINITDATA .section ".meminit.data", "aw" +#define __MEMINITRODATA .section ".meminit.rodata", "a" + +/* silence warnings when references are OK */ +#define __REF .section ".ref.text", "ax" +#define __REFDATA .section ".ref.data", "aw" +#define __REFCONST .section ".ref.rodata", "a" + +#ifndef __ASSEMBLY__ +/* + * Used for initialization calls.. + */ +typedef int (*initcall_t)(void); +typedef void (*exitcall_t)(void); + +extern initcall_t __con_initcall_start[], __con_initcall_end[]; +extern initcall_t __security_initcall_start[], __security_initcall_end[]; + +/* Defined in init/main.c */ +extern int do_one_initcall(initcall_t fn); +extern char __initdata boot_command_line[]; +extern char *saved_command_line; +extern unsigned int reset_devices; + +/* used by init/main.c */ +void setup_arch(char **); +void prepare_namespace(void); + +extern void (*late_time_init)(void); + +#endif + +#ifndef MODULE + +#ifndef __ASSEMBLY__ + +/* initcalls are now grouped by functionality into separate + * subsections. Ordering inside the subsections is determined + * by link order. + * For backwards compatibility, initcall() puts the call in + * the device init subsection. + * + * The `id' arg to __define_initcall() is needed so that multiple initcalls + * can point at the same handler without causing duplicate-symbol build errors. + */ + +#ifndef DDE_LINUX +#define __define_initcall(level,fn,id) \ + static initcall_t __initcall_##fn##id __used \ + __attribute__((__section__(".initcall" level ".init"))) = fn +#else // DDE_LINUX +// XXX: DDE CTORs are executed in reverse order as was done by +// Linux' initcalls in earlier versions +#include +#define __define_initcall(level,fn,id) DDEKIT_CTOR(fn,level) +#endif + +/* + * Early initcalls run before initializing SMP. + * + * Only for built-in code, not modules. + */ +#define early_initcall(fn) __define_initcall("early",fn,early) + +/* + * A "pure" initcall has no dependencies on anything else, and purely + * initializes variables that couldn't be statically initialized. + * + * This only exists for built-in code, not for modules. + */ +#ifndef DDE_LINUX +#define pure_initcall(fn) __define_initcall("0",fn,0) + +#define core_initcall(fn) __define_initcall("1",fn,1) +#define core_initcall_sync(fn) __define_initcall("1s",fn,1s) +#define postcore_initcall(fn) __define_initcall("2",fn,2) +#define postcore_initcall_sync(fn) __define_initcall("2s",fn,2s) +#define arch_initcall(fn) __define_initcall("3",fn,3) +#define arch_initcall_sync(fn) __define_initcall("3s",fn,3s) +#define subsys_initcall(fn) __define_initcall("4",fn,4) +#define subsys_initcall_sync(fn) __define_initcall("4s",fn,4s) +#define fs_initcall(fn) __define_initcall("5",fn,5) +#define fs_initcall_sync(fn) __define_initcall("5s",fn,5s) +#define rootfs_initcall(fn) __define_initcall("rootfs",fn,rootfs) +#define device_initcall(fn) __define_initcall("6",fn,6) +#define device_initcall_sync(fn) __define_initcall("6s",fn,6s) +#define late_initcall(fn) __define_initcall("7",fn,7) +#define late_initcall_sync(fn) __define_initcall("7s",fn,7s) +#else /* DDE_LINUX */ +#define pure_initcall(fn) __define_initcall(1000,fn,1000) + +//#define dde_initcall(fn) __define_initcall(1009,fn,10) +//#define dde_process_initcall(fn) __define_initcall(1008,fn,10) +#define core_initcall(fn) __define_initcall(1000,fn,7) +#define core_initcall_sync(fn) __define_initcall(1007s,fn,7s) +#define postcore_initcall(fn) __define_initcall(1001,fn,6) +#define postcore_initcall_sync(fn) __define_initcall(1006s,fn,6s) +#define arch_initcall(fn) __define_initcall(1002,fn,5) +#define arch_initcall_sync(fn) __define_initcall(1005s,fn,5s) +#define subsys_initcall(fn) __define_initcall(1003,fn,4) +#define subsys_initcall_sync(fn) __define_initcall(1004s,fn,4s) +#define fs_initcall(fn) __define_initcall(1004,fn,3) +#define fs_initcall_sync(fn) __define_initcall(1003s,fn,3s) +//#define rootfs_initcall(fn) __define_initcall(ootfs,fn,rootfs) +#define device_initcall(fn) __define_initcall(1005,fn,2) +#define device_initcall_sync(fn) __define_initcall(1002s,fn,2s) +#define late_initcall(fn) __define_initcall(1006,fn,1) +#define late_initcall_sync(fn) __define_initcall(1001s,fn,1s) +#endif + +#define __initcall(fn) device_initcall(fn) + +#ifndef DDE_LINUX +#define __exitcall(fn) \ + static exitcall_t __exitcall_##fn __exit_call = fn +#else +#define __exitcall(fn) +#endif + +#define console_initcall(fn) \ + static initcall_t __initcall_##fn \ + __used __section(.con_initcall.init) = fn + +#define security_initcall(fn) \ + static initcall_t __initcall_##fn \ + __used __section(.security_initcall.init) = fn + +struct obs_kernel_param { + const char *str; + int (*setup_func)(char *); + int early; +}; + +/* + * Only for really core code. See moduleparam.h for the normal way. + * + * Force the alignment so the compiler doesn't space elements of the + * obs_kernel_param "array" too far apart in .init.setup. + */ +#define __setup_param(str, unique_id, fn, early) \ + static char __setup_str_##unique_id[] __initdata __aligned(1) = str; \ + static struct obs_kernel_param __setup_##unique_id \ + __used __section(.init.setup) \ + __attribute__((aligned((sizeof(long))))) \ + = { __setup_str_##unique_id, fn, early } + +#define __setup(str, fn) \ + __setup_param(str, fn, fn, 0) + +/* NOTE: fn is as per module_param, not __setup! Emits warning if fn + * returns non-zero. */ +#define early_param(str, fn) \ + __setup_param(str, fn, fn, 1) + +/* Relies on boot_command_line being set */ +void __init parse_early_param(void); +#endif /* __ASSEMBLY__ */ + +/** + * module_init() - driver initialization entry point + * @x: function to be run at kernel boot time or module insertion + * + * module_init() will either be called during do_initcalls() (if + * builtin) or at module insertion time (if a module). There can only + * be one per module. + */ +#define module_init(x) __initcall(x); + +/** + * module_exit() - driver exit entry point + * @x: function to be run when driver is removed + * + * module_exit() will wrap the driver clean-up code + * with cleanup_module() when used with rmmod when + * the driver is a module. If the driver is statically + * compiled into the kernel, module_exit() has no effect. + * There can only be one per module. + */ +#define module_exit(x) __exitcall(x); + +#else /* MODULE */ + +/* Don't use these in modules, but some people do... */ +#define core_initcall(fn) module_init(fn) +#define postcore_initcall(fn) module_init(fn) +#define arch_initcall(fn) module_init(fn) +#define subsys_initcall(fn) module_init(fn) +#define fs_initcall(fn) module_init(fn) +#define device_initcall(fn) module_init(fn) +#define late_initcall(fn) module_init(fn) + +#define security_initcall(fn) module_init(fn) + +/* Each module must use one module_init(). */ +#define module_init(initfn) \ + static inline initcall_t __inittest(void) \ + { return initfn; } \ + int init_module(void) __attribute__((alias(#initfn))); + +/* This is only required if you want to be unloadable. */ +#define module_exit(exitfn) \ + static inline exitcall_t __exittest(void) \ + { return exitfn; } \ + void cleanup_module(void) __attribute__((alias(#exitfn))); + +#define __setup_param(str, unique_id, fn) /* nothing */ +#define __setup(str, func) /* nothing */ +#endif + +/* Data marked not to be saved by software suspend */ +#define __nosavedata __section(.data.nosave) + +/* This means "can be init if no module support, otherwise module load + may call it." */ +#ifdef CONFIG_MODULES +#define __init_or_module +#define __initdata_or_module +#else +#define __init_or_module __init +#define __initdata_or_module __initdata +#endif /*CONFIG_MODULES*/ + +/* Functions marked as __devexit may be discarded at kernel link time, depending + on config options. Newer versions of binutils detect references from + retained sections to discarded sections and flag an error. Pointers to + __devexit functions must use __devexit_p(function_name), the wrapper will + insert either the function_name or NULL, depending on the config options. + */ +#if defined(MODULE) || defined(CONFIG_HOTPLUG) +#define __devexit_p(x) x +#else +#define __devexit_p(x) NULL +#endif + +#ifdef MODULE +#define __exit_p(x) x +#else +#define __exit_p(x) NULL +#endif + +#endif /* _LINUX_INIT_H */ -- cgit v1.2.3 From fee2b25912a1797079dbbfeba4f24a36877f366e Mon Sep 17 00:00:00 2001 From: Zheng Da Date: Wed, 13 Jan 2010 12:09:47 +0100 Subject: fix the problem of including path. --- libdde_linux26/include/ARCH-x86/asm-x86/bug.h | 2 +- libdde_linux26/include/linux/init.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'libdde_linux26/include/linux/init.h') diff --git a/libdde_linux26/include/ARCH-x86/asm-x86/bug.h b/libdde_linux26/include/ARCH-x86/asm-x86/bug.h index 39085592..108089b9 100644 --- a/libdde_linux26/include/ARCH-x86/asm-x86/bug.h +++ b/libdde_linux26/include/ARCH-x86/asm-x86/bug.h @@ -4,7 +4,7 @@ #ifdef CONFIG_BUG #define HAVE_ARCH_BUG #ifdef DDE_LINUX -#include +#include #define BUG() ddekit_panic("\033[31mBUG():\033[0m %s:%d", __FILE__, __LINE__); #define __WARN() ddekit_printf("\033[33mWARN():\033[0m%s:%d", __FILE__, __LINE__); diff --git a/libdde_linux26/include/linux/init.h b/libdde_linux26/include/linux/init.h index 13b3d9c9..c7138b66 100644 --- a/libdde_linux26/include/linux/init.h +++ b/libdde_linux26/include/linux/init.h @@ -2,7 +2,7 @@ #define _LINUX_INIT_H #ifdef DDE_LINUX -#include +//#include #endif #include @@ -184,7 +184,7 @@ extern void (*late_time_init)(void); #else // DDE_LINUX // XXX: DDE CTORs are executed in reverse order as was done by // Linux' initcalls in earlier versions -#include +//#include #define __define_initcall(level,fn,id) DDEKIT_CTOR(fn,level) #endif -- cgit v1.2.3 From 2680eecc499e43679be098e5834d4f3a62f59a0c Mon Sep 17 00:00:00 2001 From: Zheng Da Date: Sat, 16 Jan 2010 01:21:07 +0100 Subject: prepare to use initcall to do initialization. --- libdde_linux26/contrib/arch/x86/kernel/pci-dma.c | 4 +- libdde_linux26/contrib/block/blk-ioc.c | 4 +- libdde_linux26/contrib/block/blk-settings.c | 4 +- libdde_linux26/contrib/block/blk-softirq.c | 4 +- libdde_linux26/contrib/block/noop-iosched.c | 4 +- libdde_linux26/contrib/fs/bio.c | 4 +- libdde_linux26/contrib/mm/backing-dev.c | 4 +- libdde_linux26/contrib/net/core/neighbour.c | 4 +- libdde_linux26/include/linux/init.h | 4 +- libdde_linux26/lib/src/arch/l4/init.c | 49 +----------------------- libdde_linux26/lib/src/arch/l4/local.h | 2 +- libdde_linux26/lib/src/arch/l4/page_alloc.c | 4 +- libdde_linux26/lib/src/arch/l4/pci.c | 2 +- libdde_linux26/lib/src/arch/l4/timer.c | 2 +- libdde_linux26/lib/src/block/genhd.c | 4 +- libdde_linux26/lib/src/drivers/pci/pci-driver.c | 4 +- libdde_linux26/lib/src/drivers/pci/pci.c | 4 +- libdde_linux26/lib/src/drivers/pci/probe.c | 4 +- libdde_linux26/lib/src/fs/char_dev.c | 2 +- libdde_linux26/lib/src/kernel/workqueue.c | 2 +- libdde_linux26/lib/src/net/core/dev.c | 4 +- libdde_linux26/lib/src/net/core/net_namespace.c | 4 +- 22 files changed, 39 insertions(+), 84 deletions(-) (limited to 'libdde_linux26/include/linux/init.h') diff --git a/libdde_linux26/contrib/arch/x86/kernel/pci-dma.c b/libdde_linux26/contrib/arch/x86/kernel/pci-dma.c index 3a26519b..b2542853 100644 --- a/libdde_linux26/contrib/arch/x86/kernel/pci-dma.c +++ b/libdde_linux26/contrib/arch/x86/kernel/pci-dma.c @@ -263,7 +263,7 @@ int dma_supported(struct device *dev, u64 mask) } EXPORT_SYMBOL(dma_supported); -int __init pci_iommu_init(void) +static int __init pci_iommu_init(void) { calgary_iommu_init(); @@ -282,7 +282,7 @@ void pci_iommu_shutdown(void) gart_iommu_shutdown(); } /* Must execute after PCI subsystem */ -//fs_initcall(pci_iommu_init); +fs_initcall(pci_iommu_init); #ifdef CONFIG_PCI /* Many VIA bridges seem to corrupt data for DAC. Disable it here */ diff --git a/libdde_linux26/contrib/block/blk-ioc.c b/libdde_linux26/contrib/block/blk-ioc.c index b3292405..012f065a 100644 --- a/libdde_linux26/contrib/block/blk-ioc.c +++ b/libdde_linux26/contrib/block/blk-ioc.c @@ -171,10 +171,10 @@ void copy_io_context(struct io_context **pdst, struct io_context **psrc) } EXPORT_SYMBOL(copy_io_context); -int __init blk_ioc_init(void) +static int __init blk_ioc_init(void) { iocontext_cachep = kmem_cache_create("blkdev_ioc", sizeof(struct io_context), 0, SLAB_PANIC, NULL); return 0; } -//subsys_initcall(blk_ioc_init); +subsys_initcall(blk_ioc_init); diff --git a/libdde_linux26/contrib/block/blk-settings.c b/libdde_linux26/contrib/block/blk-settings.c index 2178202f..59fd05d9 100644 --- a/libdde_linux26/contrib/block/blk-settings.c +++ b/libdde_linux26/contrib/block/blk-settings.c @@ -463,10 +463,10 @@ void blk_queue_update_dma_alignment(struct request_queue *q, int mask) } EXPORT_SYMBOL(blk_queue_update_dma_alignment); -int __init blk_settings_init(void) +static int __init blk_settings_init(void) { blk_max_low_pfn = max_low_pfn - 1; blk_max_pfn = max_pfn - 1; return 0; } -//subsys_initcall(blk_settings_init); +subsys_initcall(blk_settings_init); diff --git a/libdde_linux26/contrib/block/blk-softirq.c b/libdde_linux26/contrib/block/blk-softirq.c index 34041d14..ce0efc6b 100644 --- a/libdde_linux26/contrib/block/blk-softirq.c +++ b/libdde_linux26/contrib/block/blk-softirq.c @@ -161,7 +161,7 @@ void blk_complete_request(struct request *req) } EXPORT_SYMBOL(blk_complete_request); -__init int blk_softirq_init(void) +static __init int blk_softirq_init(void) { int i; @@ -172,4 +172,4 @@ __init int blk_softirq_init(void) register_hotcpu_notifier(&blk_cpu_notifier); return 0; } -//subsys_initcall(blk_softirq_init); +subsys_initcall(blk_softirq_init); diff --git a/libdde_linux26/contrib/block/noop-iosched.c b/libdde_linux26/contrib/block/noop-iosched.c index a7618fdb..075cb108 100644 --- a/libdde_linux26/contrib/block/noop-iosched.c +++ b/libdde_linux26/contrib/block/noop-iosched.c @@ -101,7 +101,7 @@ static struct elevator_type elevator_noop = { .elevator_owner = THIS_MODULE, }; -int __init noop_init(void) +static int __init noop_init(void) { DEBUG_MSG("here!"); elv_register(&elevator_noop); @@ -114,7 +114,7 @@ static void __exit noop_exit(void) elv_unregister(&elevator_noop); } -//subsys_initcall(noop_init); +subsys_initcall(noop_init); module_exit(noop_exit); diff --git a/libdde_linux26/contrib/fs/bio.c b/libdde_linux26/contrib/fs/bio.c index 7e0238b8..d4f06327 100644 --- a/libdde_linux26/contrib/fs/bio.c +++ b/libdde_linux26/contrib/fs/bio.c @@ -1592,7 +1592,7 @@ static void __init biovec_init_slabs(void) } } -int __init init_bio(void) +static int __init init_bio(void) { bio_slab_max = 2; bio_slab_nr = 0; @@ -1615,7 +1615,7 @@ int __init init_bio(void) return 0; } -//subsys_initcall(init_bio); +subsys_initcall(init_bio); EXPORT_SYMBOL(bio_alloc); EXPORT_SYMBOL(bio_kmalloc); diff --git a/libdde_linux26/contrib/mm/backing-dev.c b/libdde_linux26/contrib/mm/backing-dev.c index 25ebba9a..8e858744 100644 --- a/libdde_linux26/contrib/mm/backing-dev.c +++ b/libdde_linux26/contrib/mm/backing-dev.c @@ -159,7 +159,7 @@ static struct device_attribute bdi_dev_attrs[] = { __ATTR_NULL, }; -__init int bdi_class_init(void) +static __init int bdi_class_init(void) { bdi_class = class_create(THIS_MODULE, "bdi"); bdi_class->dev_attrs = bdi_dev_attrs; @@ -167,7 +167,7 @@ __init int bdi_class_init(void) return 0; } -//postcore_initcall(bdi_class_init); +postcore_initcall(bdi_class_init); int bdi_register(struct backing_dev_info *bdi, struct device *parent, const char *fmt, ...) diff --git a/libdde_linux26/contrib/net/core/neighbour.c b/libdde_linux26/contrib/net/core/neighbour.c index 97ed0aee..e0a03c81 100644 --- a/libdde_linux26/contrib/net/core/neighbour.c +++ b/libdde_linux26/contrib/net/core/neighbour.c @@ -2810,7 +2810,7 @@ EXPORT_SYMBOL(neigh_sysctl_unregister); #endif /* CONFIG_SYSCTL */ -int __init neigh_init(void) +static int __init neigh_init(void) { rtnl_register(PF_UNSPEC, RTM_NEWNEIGH, neigh_add, NULL); rtnl_register(PF_UNSPEC, RTM_DELNEIGH, neigh_delete, NULL); @@ -2822,5 +2822,5 @@ int __init neigh_init(void) return 0; } -//subsys_initcall(neigh_init); +subsys_initcall(neigh_init); diff --git a/libdde_linux26/include/linux/init.h b/libdde_linux26/include/linux/init.h index c7138b66..770546a2 100644 --- a/libdde_linux26/include/linux/init.h +++ b/libdde_linux26/include/linux/init.h @@ -2,7 +2,7 @@ #define _LINUX_INIT_H #ifdef DDE_LINUX -//#include +#include #endif #include @@ -184,7 +184,7 @@ extern void (*late_time_init)(void); #else // DDE_LINUX // XXX: DDE CTORs are executed in reverse order as was done by // Linux' initcalls in earlier versions -//#include +#include #define __define_initcall(level,fn,id) DDEKIT_CTOR(fn,level) #endif diff --git a/libdde_linux26/lib/src/arch/l4/init.c b/libdde_linux26/lib/src/arch/l4/init.c index 195b1b23..79112f78 100644 --- a/libdde_linux26/lib/src/arch/l4/init.c +++ b/libdde_linux26/lib/src/arch/l4/init.c @@ -26,53 +26,8 @@ void __init __attribute__((used)) l4dde26_init(void) void l4dde26_do_initcalls(void) { - extern void dde_page_cache_init (void); - extern void pci_iommu_init (void); - extern void init_workqueues (void); - extern void pci_init (void); - extern void pci_driver_init (void); - extern void pcibus_class_init (void); - extern void net_dev_init (void); - extern void neigh_init (void); - extern void net_ns_init (void); - extern void blk_ioc_init (void); - extern void blk_settings_init (void); - extern void blk_softirq_init (void); - extern void genhd_device_init (void); - extern void noop_init (void); - extern void bdi_class_init (void); - extern void init_bio (void); - extern void chrdev_init (void); /* finally, let DDEKit perform all the initcalls */ -// ddekit_do_initcalls(); - /* 1000: pure_, core_ */ - l4dde26_init (); - l4dde26_process_init (); - l4dde26_init_timers (); - net_ns_init (); - dde_page_cache_init (); - init_workqueues (); - chrdev_init (); - /* 1001: postcore_ */ - pci_driver_init (); - pcibus_class_init (); - bdi_class_init (); - /* 1002: arch_ */ - l4dde26_init_pci (); - /* 1003: subsys_ */ - net_dev_init (); -// neigh_init (); - blk_ioc_init (); - blk_settings_init (); - blk_softirq_init (); -// genhd_device_init (); - noop_init (); - init_bio (); - /* 1004: fs_ */ - pci_iommu_init (); - /* 1005: device_ */ - pci_init (); - /* 1006: late_ */ + ddekit_do_initcalls(); } -//dde_initcall(l4dde26_init); +dde_initcall(l4dde26_init); diff --git a/libdde_linux26/lib/src/arch/l4/local.h b/libdde_linux26/lib/src/arch/l4/local.h index 275c745b..d834a9db 100644 --- a/libdde_linux26/lib/src/arch/l4/local.h +++ b/libdde_linux26/lib/src/arch/l4/local.h @@ -6,7 +6,7 @@ #include #include #include -//#include +#include #include #include #include diff --git a/libdde_linux26/lib/src/arch/l4/page_alloc.c b/libdde_linux26/lib/src/arch/l4/page_alloc.c index 7c4faa0e..e887bd51 100644 --- a/libdde_linux26/lib/src/arch/l4/page_alloc.c +++ b/libdde_linux26/lib/src/arch/l4/page_alloc.c @@ -264,7 +264,7 @@ void *__init alloc_large_system_hash(const char *tablename, } -void __init dde_page_cache_init(void) +static void __init dde_page_cache_init(void) { printk("Initializing DDE page cache\n"); int i=0; @@ -273,4 +273,4 @@ void __init dde_page_cache_init(void) INIT_HLIST_HEAD(&dde_page_cache[i]); } -//core_initcall(dde_page_cache_init); +core_initcall(dde_page_cache_init); diff --git a/libdde_linux26/lib/src/arch/l4/pci.c b/libdde_linux26/lib/src/arch/l4/pci.c index e86c42e8..2a0391f2 100644 --- a/libdde_linux26/lib/src/arch/l4/pci.c +++ b/libdde_linux26/lib/src/arch/l4/pci.c @@ -186,4 +186,4 @@ void __init l4dde26_init_pci(void) INITIALIZE_INITVAR(dde26_pci); } -//arch_initcall(l4dde26_init_pci); +arch_initcall(l4dde26_init_pci); diff --git a/libdde_linux26/lib/src/arch/l4/timer.c b/libdde_linux26/lib/src/arch/l4/timer.c index 8149fe7e..2b657ab4 100644 --- a/libdde_linux26/lib/src/arch/l4/timer.c +++ b/libdde_linux26/lib/src/arch/l4/timer.c @@ -154,7 +154,7 @@ void __init l4dde26_init_timers(void) INITIALIZE_INITVAR(dde26_timer); } -//core_initcall(l4dde26_init_timers); +core_initcall(l4dde26_init_timers); __attribute__((weak)) void do_gettimeofday (struct timeval *tv) { diff --git a/libdde_linux26/lib/src/block/genhd.c b/libdde_linux26/lib/src/block/genhd.c index f9a205f5..921cebff 100644 --- a/libdde_linux26/lib/src/block/genhd.c +++ b/libdde_linux26/lib/src/block/genhd.c @@ -792,7 +792,7 @@ static struct kobject *base_probe(dev_t devt, int *partno, void *data) return NULL; } -int __init genhd_device_init(void) +static int __init genhd_device_init(void) { int error; @@ -812,7 +812,7 @@ int __init genhd_device_init(void) return 0; } -//subsys_initcall(genhd_device_init); +subsys_initcall(genhd_device_init); static ssize_t disk_range_show(struct device *dev, struct device_attribute *attr, char *buf) diff --git a/libdde_linux26/lib/src/drivers/pci/pci-driver.c b/libdde_linux26/lib/src/drivers/pci/pci-driver.c index 591d9489..199ec8a7 100644 --- a/libdde_linux26/lib/src/drivers/pci/pci-driver.c +++ b/libdde_linux26/lib/src/drivers/pci/pci-driver.c @@ -992,12 +992,12 @@ struct bus_type pci_bus_type = { .pm = PCI_PM_OPS_PTR, }; -int __init pci_driver_init(void) +static int __init pci_driver_init(void) { return bus_register(&pci_bus_type); } -//postcore_initcall(pci_driver_init); +postcore_initcall(pci_driver_init); EXPORT_SYMBOL(pci_match_id); EXPORT_SYMBOL(__pci_register_driver); diff --git a/libdde_linux26/lib/src/drivers/pci/pci.c b/libdde_linux26/lib/src/drivers/pci/pci.c index 9bf601c3..f67bf734 100644 --- a/libdde_linux26/lib/src/drivers/pci/pci.c +++ b/libdde_linux26/lib/src/drivers/pci/pci.c @@ -2404,7 +2404,7 @@ int __devinit pci_init(void) return 0; } -int __init pci_setup(char *str) +static int __init pci_setup(char *str) { #ifndef DDE_LINUX while (str) { @@ -2434,7 +2434,7 @@ int __init pci_setup(char *str) } early_param("pci", pci_setup); -//device_initcall(pci_init); +device_initcall(pci_init); EXPORT_SYMBOL(pci_reenable_device); EXPORT_SYMBOL(pci_enable_device_io); diff --git a/libdde_linux26/lib/src/drivers/pci/probe.c b/libdde_linux26/lib/src/drivers/pci/probe.c index 9cbc3bfb..32da5108 100644 --- a/libdde_linux26/lib/src/drivers/pci/probe.c +++ b/libdde_linux26/lib/src/drivers/pci/probe.c @@ -100,11 +100,11 @@ static struct class pcibus_class = { .dev_release = &release_pcibus_dev, }; -int __init pcibus_class_init(void) +static int __init pcibus_class_init(void) { return class_register(&pcibus_class); } -//postcore_initcall(pcibus_class_init); +postcore_initcall(pcibus_class_init); /* * Translate the low bits of the PCI base diff --git a/libdde_linux26/lib/src/fs/char_dev.c b/libdde_linux26/lib/src/fs/char_dev.c index 9dd832b4..3b8e8b3d 100644 --- a/libdde_linux26/lib/src/fs/char_dev.c +++ b/libdde_linux26/lib/src/fs/char_dev.c @@ -556,7 +556,7 @@ void __init chrdev_init(void) } #ifndef LIBINPUT -//core_initcall(chrdev_init); +core_initcall(chrdev_init); #endif /* Let modules do char dev stuff */ diff --git a/libdde_linux26/lib/src/kernel/workqueue.c b/libdde_linux26/lib/src/kernel/workqueue.c index d52b22b5..5ad26d9f 100644 --- a/libdde_linux26/lib/src/kernel/workqueue.c +++ b/libdde_linux26/lib/src/kernel/workqueue.c @@ -1034,5 +1034,5 @@ void __init init_workqueues(void) } #ifdef DDE_LINUX -//core_initcall(init_workqueues); +core_initcall(init_workqueues); #endif diff --git a/libdde_linux26/lib/src/net/core/dev.c b/libdde_linux26/lib/src/net/core/dev.c index b1307dd2..65b4ba42 100644 --- a/libdde_linux26/lib/src/net/core/dev.c +++ b/libdde_linux26/lib/src/net/core/dev.c @@ -5186,7 +5186,7 @@ static struct pernet_operations __net_initdata default_device_ops = { * This is called single threaded during boot, so no need * to take the rtnl semaphore. */ -int __init net_dev_init(void) +static int __init net_dev_init(void) { int i, rc = -ENOMEM; @@ -5254,7 +5254,7 @@ out: return rc; } -//subsys_initcall(net_dev_init); +subsys_initcall(net_dev_init); EXPORT_SYMBOL(__dev_get_by_index); EXPORT_SYMBOL(__dev_get_by_name); diff --git a/libdde_linux26/lib/src/net/core/net_namespace.c b/libdde_linux26/lib/src/net/core/net_namespace.c index 29f29621..ab5a0a7f 100644 --- a/libdde_linux26/lib/src/net/core/net_namespace.c +++ b/libdde_linux26/lib/src/net/core/net_namespace.c @@ -202,7 +202,7 @@ struct net *copy_net_ns(unsigned long flags, struct net *old_net) } #endif -int __init net_ns_init(void) +static int __init net_ns_init(void) { struct net_generic *ng; int err; @@ -239,7 +239,7 @@ int __init net_ns_init(void) return 0; } -//pure_initcall(net_ns_init); +pure_initcall(net_ns_init); #ifdef CONFIG_NET_NS static int register_pernet_operations(struct list_head *list, -- cgit v1.2.3