initcall func(五)

来源:互联网 发布:永恒之塔气质美女数据 编辑:程序博客网 时间:2024/04/29 05:04

 

41. init_per_zone_pages_min()

\mm\page_alloc.c

Obj-y = page_alloc.o

module_init(init_per_zone_pages_min)

 

static int __init init_per_zone_pages_min(void)

{

       unsigned long lowmem_kbytes;

       lowmem_kbytes = nr_free_buffer_pages() * (PAGE_SIZE >> 10);

       min_free_kbytes = int_sqrt(lowmem_kbytes * 16);

       if (min_free_kbytes < 128)

              min_free_kbytes = 128;

       if (min_free_kbytes > 65536)

              min_free_kbytes = 65536;

       setup_per_zone_pages_min();

       setup_per_zone_lowmem_reserve();

       return 0;

}

 

42. procswaps_init

\mm\swapfile.c

obj-$(CONFIG_SWAP) = swapfile.o

__initcall(procswaps_init);

 

static int __init procswaps_init(void)

{

       proc_create("swaps", 0, NULL, &proc_swaps_operations);

       return 0;

}

 

43. cpucache_init()

\mm\slab.c

obj-$(CONFIG_SLAB) += slab.o

__initcall(cpucache_init);

 

static int __init cpucache_init(void)

{

       int cpu;

       /*

        * Register the timers that return unneeded pages to the page allocator

        */

       for_each_online_cpu(cpu)

              start_cpu_timer(cpu);

       return 0;

}

 

44. fasync_init

\fs\fcntl.c

Obj-y = fcntl.o

module_init(fasync_init)

 

static int __init fasync_init(void)

{

       fasync_cache = kmem_cache_create("fasync_cache",

              sizeof(struct fasync_struct), 0, SLAB_PANIC, NULL);

       return 0;

}

 

45aio_setup

\fs\aio.c

Obj-y = aio.o

__initcall(aio_setup);

 

static int __init aio_setup(void)

{

       kiocb_cachep = KMEM_CACHE(kiocb, SLAB_HWCACHE_ALIGN|SLAB_PANIC);

       kioctx_cachep = KMEM_CACHE(kioctx,SLAB_HWCACHE_ALIGN|SLAB_PANIC);

       aio_wq = create_workqueue("aio");

       pr_debug("aio_setup: sizeof(struct page) = %d\n", (int)sizeof(struct page));

       return 0;

}

 

46. rand_initialize

\drivers\char\random.c

Obj-y = random.o

module_init(rand_initialize);

 

static int rand_initialize(void)

{

       init_std_data(&input_pool);

       init_std_data(&blocking_pool);

       init_std_data(&nonblocking_pool);

       return 0;

}

 

47 pty_init

\drivers\char\pty.c

obj-$(CONFIG_LEGACY_PTYS) += pty.o

obj-$(CONFIG_UNIX98_PTYS)  += pty.o

 

static int __init pty_init(void)

{

       legacy_pty_init();

       unix98_pty_init();

       return 0;

}

 

48. net_olddevs_init

\drivers\net\space.c

obj-$(CONFIG_NET) += Space.o

device_initcall(net_olddevs_init);

 

/*  Statically configured drivers -- order matters here. */

static int __init net_olddevs_init(void)

{

       int num;

 

#ifdef CONFIG_SBNI

       for (num = 0; num < 8; ++num)

              sbni_probe(num);

#endif

#ifdef CONFIG_TR

       for (num = 0; num < 8; ++num)

              if (!trif_probe(num))

                     trif_probe2(num);

#endif

       for (num = 0; num < 8; ++num)

              ethif_probe2(num);

#ifdef CONFIG_COPS

       cops_probe(0);

       cops_probe(1);

       cops_probe(2);

#endif

#ifdef CONFIG_LTPC

       ltpc_probe();

#endif

       return 0;

}

 

49. init_mtd

\drivers\mtd\mtdcore.c

mtd-y                           := mtdcore.o

module_init(init_mtd);

 

static int __init init_mtd(void)

{

       if ((proc_mtd = create_proc_entry( "mtd", 0, NULL )))

              proc_mtd->read_proc = mtd_read_proc;

       return 0;

}

 

50.redboot_parser_init

\drivers\mtd\redboot.c

obj-$(CONFIG_MTD_REDBOOT_PARTS) += redboot.o

module_init(redboot_parser_init);

 

static int __init redboot_parser_init(void)

{

       return register_mtd_parser(&redboot_parser);

}

 

0 0
原创粉丝点击