ia64/xen-unstable

changeset 15082:759d924af6d8

xen: Free initmem after boot. Mark lots of init functions as __init
that weren't before.
Signed-off-by: Keir Fraser <keir@xensource.com>
author Keir Fraser <keir@xensource.com>
date Sat May 12 10:28:53 2007 +0100 (2007-05-12)
parents b47488b17279
children 03a13457d993
files xen/acm/acm_core.c xen/arch/x86/domain_build.c xen/arch/x86/extable.c xen/arch/x86/mm.c xen/arch/x86/setup.c xen/arch/x86/x86_32/mm.c xen/arch/x86/x86_64/mm.c xen/common/gdbstub.c xen/common/keyhandler.c xen/common/page_alloc.c xen/common/rcupdate.c xen/common/trace.c xen/drivers/char/console.c xen/drivers/char/ns16550.c xen/drivers/char/serial.c xen/drivers/video/vga.c
line diff
     1.1 --- a/xen/acm/acm_core.c	Sat May 12 09:48:33 2007 +0100
     1.2 +++ b/xen/acm/acm_core.c	Sat May 12 10:28:53 2007 +0100
     1.3 @@ -269,7 +269,7 @@ acm_setup(char *policy_start,
     1.4  }
     1.5  
     1.6  
     1.7 -int
     1.8 +int __init
     1.9  acm_init(char *policy_start,
    1.10           unsigned long policy_len)
    1.11  {
     2.1 --- a/xen/arch/x86/domain_build.c	Sat May 12 09:48:33 2007 +0100
     2.2 +++ b/xen/arch/x86/domain_build.c	Sat May 12 10:28:53 2007 +0100
     2.3 @@ -33,7 +33,9 @@
     2.4  extern unsigned long initial_images_nrpages(void);
     2.5  extern void discard_initial_images(void);
     2.6  
     2.7 -static long dom0_nrpages, dom0_min_nrpages, dom0_max_nrpages = LONG_MAX;
     2.8 +static long __initdata dom0_nrpages;
     2.9 +static long __initdata dom0_min_nrpages;
    2.10 +static long __initdata dom0_max_nrpages = LONG_MAX;
    2.11  
    2.12  /*
    2.13   * dom0_mem=[min:<min_amt>,][max:<max_amt>,][<amt>]
    2.14 @@ -55,12 +57,12 @@ static long dom0_nrpages, dom0_min_nrpag
    2.15   *  If +ve: The specified amount is an absolute value.
    2.16   *  If -ve: The specified amount is subtracted from total available memory.
    2.17   */
    2.18 -static long parse_amt(const char *s, const char **ps)
    2.19 +static long __init parse_amt(const char *s, const char **ps)
    2.20  {
    2.21      long pages = parse_size_and_unit((*s == '-') ? s+1 : s, ps) >> PAGE_SHIFT;
    2.22      return (*s == '-') ? -pages : pages;
    2.23  }
    2.24 -static void parse_dom0_mem(const char *s)
    2.25 +static void __init parse_dom0_mem(const char *s)
    2.26  {
    2.27      do {
    2.28          if ( !strncmp(s, "min:", 4) )
    2.29 @@ -103,7 +105,8 @@ string_param("dom0_ioports_disable", opt
    2.30  #define round_pgup(_p)    (((_p)+(PAGE_SIZE-1))&PAGE_MASK)
    2.31  #define round_pgdown(_p)  ((_p)&PAGE_MASK)
    2.32  
    2.33 -static struct page_info *alloc_chunk(struct domain *d, unsigned long max_pages)
    2.34 +static struct page_info * __init alloc_chunk(
    2.35 +    struct domain *d, unsigned long max_pages)
    2.36  {
    2.37      struct page_info *page;
    2.38      unsigned int order;
    2.39 @@ -122,7 +125,7 @@ static struct page_info *alloc_chunk(str
    2.40      return page;
    2.41  }
    2.42  
    2.43 -static unsigned long compute_dom0_nr_pages(void)
    2.44 +static unsigned long __init compute_dom0_nr_pages(void)
    2.45  {
    2.46      unsigned long avail = avail_domheap_pages() + initial_images_nrpages();
    2.47  
    2.48 @@ -151,7 +154,7 @@ static unsigned long compute_dom0_nr_pag
    2.49      return dom0_nrpages;
    2.50  }
    2.51  
    2.52 -static void process_dom0_ioports_disable(void)
    2.53 +static void __init process_dom0_ioports_disable(void)
    2.54  {
    2.55      unsigned long io_from, io_to;
    2.56      char *t, *s = opt_dom0_ioports_disable;
    2.57 @@ -189,10 +192,11 @@ static void process_dom0_ioports_disable
    2.58      }
    2.59  }
    2.60  
    2.61 -int construct_dom0(struct domain *d,
    2.62 -                   unsigned long _image_start, unsigned long image_len, 
    2.63 -                   unsigned long _initrd_start, unsigned long initrd_len,
    2.64 -                   char *cmdline)
    2.65 +int __init construct_dom0(
    2.66 +    struct domain *d,
    2.67 +    unsigned long _image_start, unsigned long image_len, 
    2.68 +    unsigned long _initrd_start, unsigned long initrd_len,
    2.69 +    char *cmdline)
    2.70  {
    2.71      int i, rc, compatible, compat32, order, machine;
    2.72      struct cpu_user_regs *regs;
     3.1 --- a/xen/arch/x86/extable.c	Sat May 12 09:48:33 2007 +0100
     3.2 +++ b/xen/arch/x86/extable.c	Sat May 12 10:28:53 2007 +0100
     3.3 @@ -1,5 +1,6 @@
     3.4  
     3.5  #include <xen/config.h>
     3.6 +#include <xen/init.h>
     3.7  #include <xen/perfc.h>
     3.8  #include <xen/spinlock.h>
     3.9  #include <asm/uaccess.h>
    3.10 @@ -9,8 +10,8 @@ extern struct exception_table_entry __st
    3.11  extern struct exception_table_entry __start___pre_ex_table[];
    3.12  extern struct exception_table_entry __stop___pre_ex_table[];
    3.13  
    3.14 -static void sort_exception_table(struct exception_table_entry *start,
    3.15 -                                 struct exception_table_entry *end)
    3.16 +static void __init sort_exception_table(struct exception_table_entry *start,
    3.17 +                                        struct exception_table_entry *end)
    3.18  {
    3.19      struct exception_table_entry *p, *q, tmp;
    3.20  
    3.21 @@ -28,7 +29,7 @@ static void sort_exception_table(struct 
    3.22      }
    3.23  }
    3.24  
    3.25 -void sort_exception_tables(void)
    3.26 +void __init sort_exception_tables(void)
    3.27  {
    3.28      sort_exception_table(__start___ex_table, __stop___ex_table);
    3.29      sort_exception_table(__start___pre_ex_table, __stop___pre_ex_table);
     4.1 --- a/xen/arch/x86/mm.c	Sat May 12 09:48:33 2007 +0100
     4.2 +++ b/xen/arch/x86/mm.c	Sat May 12 10:28:53 2007 +0100
     4.3 @@ -184,7 +184,7 @@ void __init init_frametable(void)
     4.4      memset(frame_table, 0, nr_pages << PAGE_SHIFT);
     4.5  }
     4.6  
     4.7 -void arch_init_memory(void)
     4.8 +void __init arch_init_memory(void)
     4.9  {
    4.10      extern void subarch_init_memory(void);
    4.11  
     5.1 --- a/xen/arch/x86/setup.c	Sat May 12 09:48:33 2007 +0100
     5.2 +++ b/xen/arch/x86/setup.c	Sat May 12 10:28:53 2007 +0100
     5.3 @@ -202,6 +202,14 @@ static void __init percpu_init_areas(voi
     5.4      init_xenheap_pages(__pa(__per_cpu_start) + (first_unused << PERCPU_SHIFT),
     5.5                         __pa(__per_cpu_end));
     5.6  #endif
     5.7 +    memguard_guard_range(&__per_cpu_start[first_unused << PERCPU_SHIFT],
     5.8 +                         (NR_CPUS - first_unused) << PERCPU_SHIFT);
     5.9 +#if defined(CONFIG_X86_64)
    5.10 +    /* Also zap the mapping in the 1:1 area. */
    5.11 +    memguard_guard_range(__va(__pa(__per_cpu_start)) +
    5.12 +                         (first_unused << PERCPU_SHIFT),
    5.13 +                         (NR_CPUS - first_unused) << PERCPU_SHIFT);
    5.14 +#endif
    5.15  }
    5.16  
    5.17  /* Fetch acm policy module from multiboot modules. */
    5.18 @@ -310,6 +318,24 @@ static void __init reserve_in_boot_e820(
    5.19      }
    5.20  }
    5.21  
    5.22 +void init_done(void)
    5.23 +{
    5.24 +    extern char __init_begin[], __init_end[];
    5.25 +
    5.26 +    /* Free (or page-protect) the init areas. */
    5.27 +#ifndef MEMORY_GUARD
    5.28 +    init_xenheap_pages(__pa(__init_begin), __pa(__init_end));
    5.29 +#endif
    5.30 +    memguard_guard_range(__init_begin, __init_end - __init_begin);
    5.31 +#if defined(CONFIG_X86_64)
    5.32 +    /* Also zap the mapping in the 1:1 area. */
    5.33 +    memguard_guard_range(__va(__pa(__init_begin)), __init_end - __init_begin);
    5.34 +#endif
    5.35 +    printk("Freed %ldkB init memory.\n", (long)(__init_end-__init_begin)>>10);
    5.36 +
    5.37 +    startup_cpu_idle_loop();
    5.38 +}
    5.39 +
    5.40  void __init __start_xen(multiboot_info_t *mbi)
    5.41  {
    5.42      char __cmdline[] = "", *cmdline = __cmdline;
    5.43 @@ -895,7 +921,7 @@ void __init __start_xen(multiboot_info_t
    5.44  
    5.45      domain_unpause_by_systemcontroller(dom0);
    5.46  
    5.47 -    startup_cpu_idle_loop();
    5.48 +    reset_stack_and_jump(init_done);
    5.49  }
    5.50  
    5.51  void arch_get_xen_caps(xen_capabilities_info_t *info)
     6.1 --- a/xen/arch/x86/x86_32/mm.c	Sat May 12 09:48:33 2007 +0100
     6.2 +++ b/xen/arch/x86/x86_32/mm.c	Sat May 12 10:28:53 2007 +0100
     6.3 @@ -159,7 +159,7 @@ void __init zap_low_mappings(l2_pgentry_
     6.4      flush_tlb_all_pge();
     6.5  }
     6.6  
     6.7 -void subarch_init_memory(void)
     6.8 +void __init subarch_init_memory(void)
     6.9  {
    6.10      unsigned long m2p_start_mfn;
    6.11      unsigned int i, j;
     7.1 --- a/xen/arch/x86/x86_64/mm.c	Sat May 12 09:48:33 2007 +0100
     7.2 +++ b/xen/arch/x86/x86_64/mm.c	Sat May 12 10:28:53 2007 +0100
     7.3 @@ -213,7 +213,7 @@ void __init zap_low_mappings(void)
     7.4      flush_tlb_all_pge();
     7.5  }
     7.6  
     7.7 -void subarch_init_memory(void)
     7.8 +void __init subarch_init_memory(void)
     7.9  {
    7.10      unsigned long i, v, m2p_start_mfn;
    7.11      l3_pgentry_t l3e;
     8.1 --- a/xen/common/gdbstub.c	Sat May 12 09:48:33 2007 +0100
     8.2 +++ b/xen/common/gdbstub.c	Sat May 12 10:28:53 2007 +0100
     8.3 @@ -584,7 +584,7 @@ int
     8.4      return rc;
     8.5  }
     8.6  
     8.7 -void
     8.8 +void __init
     8.9  initialise_gdb(void)
    8.10  {
    8.11      gdb_ctx->serhnd = serial_parse_handle(opt_gdb);
     9.1 --- a/xen/common/keyhandler.c	Sat May 12 09:48:33 2007 +0100
     9.2 +++ b/xen/common/keyhandler.c	Sat May 12 10:28:53 2007 +0100
     9.3 @@ -282,7 +282,7 @@ static void do_debug_key(unsigned char k
     9.4                               bit. */
     9.5  }
     9.6  
     9.7 -void initialize_keytable(void)
     9.8 +void __init initialize_keytable(void)
     9.9  {
    9.10      open_softirq(KEYPRESS_SOFTIRQ, keypress_softirq);
    9.11  
    10.1 --- a/xen/common/page_alloc.c	Sat May 12 09:48:33 2007 +0100
    10.2 +++ b/xen/common/page_alloc.c	Sat May 12 10:28:53 2007 +0100
    10.3 @@ -50,7 +50,7 @@ string_param("badpage", opt_badpage);
    10.4   */
    10.5  static unsigned int  dma_bitsize = CONFIG_DMA_BITSIZE;
    10.6  static unsigned long max_dma_mfn = (1UL<<(CONFIG_DMA_BITSIZE-PAGE_SHIFT))-1;
    10.7 -static void parse_dma_bits(char *s)
    10.8 +static void __init parse_dma_bits(char *s)
    10.9  {
   10.10      unsigned int v = simple_strtol(s, NULL, 0);
   10.11      if ( v >= (BITS_PER_LONG + PAGE_SHIFT) )
   10.12 @@ -74,7 +74,7 @@ custom_param("dma_bits", parse_dma_bits)
   10.13   * lowmem emergency pool.
   10.14   */
   10.15  static unsigned long dma_emergency_pool_pages;
   10.16 -static void parse_dma_emergency_pool(char *s)
   10.17 +static void __init parse_dma_emergency_pool(char *s)
   10.18  {
   10.19      unsigned long long bytes;
   10.20      bytes = parse_size_and_unit(s, NULL);
   10.21 @@ -176,7 +176,7 @@ static void map_free(unsigned long first
   10.22  static unsigned long first_valid_mfn = ~0UL;
   10.23  
   10.24  /* Initialise allocator to handle up to @max_page pages. */
   10.25 -paddr_t init_boot_allocator(paddr_t bitmap_start)
   10.26 +paddr_t __init init_boot_allocator(paddr_t bitmap_start)
   10.27  {
   10.28      unsigned long bitmap_size;
   10.29  
   10.30 @@ -197,7 +197,7 @@ paddr_t init_boot_allocator(paddr_t bitm
   10.31      return bitmap_start + bitmap_size;
   10.32  }
   10.33  
   10.34 -void init_boot_pages(paddr_t ps, paddr_t pe)
   10.35 +void __init init_boot_pages(paddr_t ps, paddr_t pe)
   10.36  {
   10.37      unsigned long bad_spfn, bad_epfn, i;
   10.38      const char *p;
   10.39 @@ -243,7 +243,7 @@ void init_boot_pages(paddr_t ps, paddr_t
   10.40      }
   10.41  }
   10.42  
   10.43 -int reserve_boot_pages(unsigned long first_pfn, unsigned long nr_pfns)
   10.44 +int __init reserve_boot_pages(unsigned long first_pfn, unsigned long nr_pfns)
   10.45  {
   10.46      unsigned long i;
   10.47  
   10.48 @@ -258,7 +258,7 @@ int reserve_boot_pages(unsigned long fir
   10.49      return 1;
   10.50  }
   10.51  
   10.52 -unsigned long alloc_boot_low_pages(
   10.53 +unsigned long __init alloc_boot_low_pages(
   10.54      unsigned long nr_pfns, unsigned long pfn_align)
   10.55  {
   10.56      unsigned long pg, i;
   10.57 @@ -281,7 +281,7 @@ unsigned long alloc_boot_low_pages(
   10.58      return 0;
   10.59  }
   10.60  
   10.61 -unsigned long alloc_boot_pages(
   10.62 +unsigned long __init alloc_boot_pages(
   10.63      unsigned long nr_pfns, unsigned long pfn_align)
   10.64  {
   10.65      unsigned long pg, i;
   10.66 @@ -587,7 +587,7 @@ static unsigned long avail_heap_pages(
   10.67  
   10.68  #define avail_for_domheap(mfn) \
   10.69      (!allocated_in_map(mfn) && !is_xen_heap_frame(mfn_to_page(mfn)))
   10.70 -void end_boot_allocator(void)
   10.71 +void __init end_boot_allocator(void)
   10.72  {
   10.73      unsigned long i;
   10.74      int curr_free, next_free;
   10.75 @@ -614,7 +614,7 @@ void end_boot_allocator(void)
   10.76   * convoluted than appears necessary because we do not want to continuously
   10.77   * hold the lock while scrubbing very large memory areas.
   10.78   */
   10.79 -void scrub_heap_pages(void)
   10.80 +void __init scrub_heap_pages(void)
   10.81  {
   10.82      void *p;
   10.83      unsigned long mfn;
    11.1 --- a/xen/common/rcupdate.c	Sat May 12 09:48:33 2007 +0100
    11.2 +++ b/xen/common/rcupdate.c	Sat May 12 10:28:53 2007 +0100
    11.3 @@ -341,7 +341,7 @@ void __devinit rcu_online_cpu(int cpu)
    11.4      rcu_init_percpu_data(cpu, &rcu_ctrlblk, rdp);
    11.5  }
    11.6  
    11.7 -void rcu_init(void)
    11.8 +void __init rcu_init(void)
    11.9  {
   11.10      rcu_online_cpu(smp_processor_id());
   11.11      open_softirq(RCU_SOFTIRQ, rcu_process_callbacks);
    12.1 --- a/xen/common/trace.c	Sat May 12 09:48:33 2007 +0100
    12.2 +++ b/xen/common/trace.c	Sat May 12 10:28:53 2007 +0100
    12.3 @@ -168,7 +168,7 @@ static int tb_set_size(int size)
    12.4   * trace buffers.  The trace buffers are then available for debugging use, via
    12.5   * the %TRACE_xD macros exported in <xen/trace.h>.
    12.6   */
    12.7 -void init_trace_bufs(void)
    12.8 +void __init init_trace_bufs(void)
    12.9  {
   12.10      if ( opt_tbuf_size == 0 )
   12.11      {
    13.1 --- a/xen/drivers/char/console.c	Sat May 12 09:48:33 2007 +0100
    13.2 +++ b/xen/drivers/char/console.c	Sat May 12 10:28:53 2007 +0100
    13.3 @@ -121,7 +121,7 @@ static atomic_t print_everything = ATOMI
    13.4          return (lvlnum);                                \
    13.5      }
    13.6  
    13.7 -static int __parse_loglvl(char *s, char **ps)
    13.8 +static int __init __parse_loglvl(char *s, char **ps)
    13.9  {
   13.10      ___parse_loglvl(s, ps, "none",    0);
   13.11      ___parse_loglvl(s, ps, "error",   1);
   13.12 @@ -132,7 +132,7 @@ static int __parse_loglvl(char *s, char 
   13.13      return 2; /* sane fallback */
   13.14  }
   13.15  
   13.16 -static void _parse_loglvl(char *s, int *lower, int *upper)
   13.17 +static void __init _parse_loglvl(char *s, int *lower, int *upper)
   13.18  {
   13.19      *lower = *upper = __parse_loglvl(s, &s);
   13.20      if ( *s == '/' )
   13.21 @@ -141,17 +141,17 @@ static void _parse_loglvl(char *s, int *
   13.22          *upper = *lower;
   13.23  }
   13.24  
   13.25 -static void parse_loglvl(char *s)
   13.26 +static void __init parse_loglvl(char *s)
   13.27  {
   13.28      _parse_loglvl(s, &xenlog_lower_thresh, &xenlog_upper_thresh);
   13.29  }
   13.30  
   13.31 -static void parse_guest_loglvl(char *s)
   13.32 +static void __init parse_guest_loglvl(char *s)
   13.33  {
   13.34      _parse_loglvl(s, &xenlog_guest_lower_thresh, &xenlog_guest_upper_thresh);
   13.35  }
   13.36  
   13.37 -static char *loglvl_str(int lvl)
   13.38 +static char * __init loglvl_str(int lvl)
   13.39  {
   13.40      switch ( lvl )
   13.41      {
   13.42 @@ -504,7 +504,7 @@ void set_printk_prefix(const char *prefi
   13.43      safe_strcpy(printk_prefix, prefix);
   13.44  }
   13.45  
   13.46 -void init_console(void)
   13.47 +void __init init_console(void)
   13.48  {
   13.49      char *p;
   13.50  
   13.51 @@ -540,7 +540,7 @@ void init_console(void)
   13.52      }
   13.53  }
   13.54  
   13.55 -void console_endboot(void)
   13.56 +void __init console_endboot(void)
   13.57  {
   13.58      int i, j;
   13.59  
    14.1 --- a/xen/drivers/char/ns16550.c	Sat May 12 09:48:33 2007 +0100
    14.2 +++ b/xen/drivers/char/ns16550.c	Sat May 12 10:28:53 2007 +0100
    14.3 @@ -170,7 +170,7 @@ static int ns16550_getc(struct serial_po
    14.4      return 1;
    14.5  }
    14.6  
    14.7 -static void ns16550_init_preirq(struct serial_port *port)
    14.8 +static void __init ns16550_init_preirq(struct serial_port *port)
    14.9  {
   14.10      struct ns16550 *uart = port->uart;
   14.11      unsigned char lcr;
   14.12 @@ -214,7 +214,7 @@ static void ns16550_init_preirq(struct s
   14.13          port->tx_fifo_size = 16;
   14.14  }
   14.15  
   14.16 -static void ns16550_init_postirq(struct serial_port *port)
   14.17 +static void __init ns16550_init_postirq(struct serial_port *port)
   14.18  {
   14.19      struct ns16550 *uart = port->uart;
   14.20      int rc, bits;
   14.21 @@ -250,7 +250,7 @@ static void ns16550_init_postirq(struct 
   14.22  }
   14.23  
   14.24  #ifdef CONFIG_X86
   14.25 -static void ns16550_endboot(struct serial_port *port)
   14.26 +static void __init ns16550_endboot(struct serial_port *port)
   14.27  {
   14.28      struct ns16550 *uart = port->uart;
   14.29      if ( ioports_deny_access(dom0, uart->io_base, uart->io_base + 7) != 0 )
   14.30 @@ -276,7 +276,7 @@ static struct uart_driver ns16550_driver
   14.31      .irq          = ns16550_irq
   14.32  };
   14.33  
   14.34 -static int parse_parity_char(int c)
   14.35 +static int __init parse_parity_char(int c)
   14.36  {
   14.37      switch ( c )
   14.38      {
   14.39 @@ -300,7 +300,8 @@ static int parse_parity_char(int c)
   14.40          return;                              \
   14.41      } while ( 0 )
   14.42  
   14.43 -static void ns16550_parse_port_config(struct ns16550 *uart, const char *conf)
   14.44 +static void __init ns16550_parse_port_config(
   14.45 +    struct ns16550 *uart, const char *conf)
   14.46  {
   14.47      int baud;
   14.48  
   14.49 @@ -360,7 +361,7 @@ static void ns16550_parse_port_config(st
   14.50      serial_register_uart(uart - ns16550_com, &ns16550_driver, uart);
   14.51  }
   14.52  
   14.53 -void ns16550_init(int index, struct ns16550_defaults *defaults)
   14.54 +void __init ns16550_init(int index, struct ns16550_defaults *defaults)
   14.55  {
   14.56      struct ns16550 *uart = &ns16550_com[index];
   14.57  
    15.1 --- a/xen/drivers/char/serial.c	Sat May 12 09:48:33 2007 +0100
    15.2 +++ b/xen/drivers/char/serial.c	Sat May 12 10:28:53 2007 +0100
    15.3 @@ -348,7 +348,7 @@ int serial_tx_space(int handle)
    15.4      return SERIAL_TXBUFSZ - (port->txbufp - port->txbufc);
    15.5  }
    15.6  
    15.7 -void serial_init_preirq(void)
    15.8 +void __init serial_init_preirq(void)
    15.9  {
   15.10      int i;
   15.11      for ( i = 0; i < ARRAY_SIZE(com); i++ )
   15.12 @@ -356,7 +356,7 @@ void serial_init_preirq(void)
   15.13              com[i].driver->init_preirq(&com[i]);
   15.14  }
   15.15  
   15.16 -void serial_init_postirq(void)
   15.17 +void __init serial_init_postirq(void)
   15.18  {
   15.19      int i;
   15.20      for ( i = 0; i < ARRAY_SIZE(com); i++ )
   15.21 @@ -364,7 +364,7 @@ void serial_init_postirq(void)
   15.22              com[i].driver->init_postirq(&com[i]);
   15.23  }
   15.24  
   15.25 -void serial_endboot(void)
   15.26 +void __init serial_endboot(void)
   15.27  {
   15.28      int i;
   15.29      for ( i = 0; i < ARRAY_SIZE(com); i++ )
    16.1 --- a/xen/drivers/video/vga.c	Sat May 12 09:48:33 2007 +0100
    16.2 +++ b/xen/drivers/video/vga.c	Sat May 12 10:28:53 2007 +0100
    16.3 @@ -299,7 +299,7 @@ static inline void vga_wattr(void __iome
    16.4      vga_w(regbase, VGA_ATT_W, val);
    16.5  }
    16.6  
    16.7 -static int detect_video(void *video_base)
    16.8 +static int __init detect_video(void *video_base)
    16.9  {
   16.10      volatile u16 *p = (volatile u16 *)video_base;
   16.11      u16 saved1 = p[0], saved2 = p[1];
   16.12 @@ -322,7 +322,7 @@ static int detect_video(void *video_base
   16.13  }
   16.14  
   16.15  /* This is actually code from vgaHWRestore in an old version of XFree86 :-) */
   16.16 -static void *setup_vga(void)
   16.17 +static void * __init setup_vga(void)
   16.18  {
   16.19      /* The following VGA state was saved from a chip in text mode 3. */
   16.20      static unsigned char regs[] = {
   16.21 @@ -382,7 +382,7 @@ static void *setup_vga(void)
   16.22      return NULL;
   16.23  }
   16.24  
   16.25 -static int vga_set_scanlines(unsigned scanlines)
   16.26 +static int __init vga_set_scanlines(unsigned scanlines)
   16.27  {
   16.28      unsigned vtot, ovr, vss, vbs;
   16.29      uint8_t vse, vbe, misc = 0;
   16.30 @@ -459,7 +459,7 @@ static int vga_set_scanlines(unsigned sc
   16.31  static unsigned font_slot = 0;
   16.32  integer_param("fontslot", font_slot);
   16.33  
   16.34 -static int vga_load_font(const struct font_desc *font, unsigned rows)
   16.35 +static int __init vga_load_font(const struct font_desc *font, unsigned rows)
   16.36  {
   16.37      unsigned fontheight = font ? font->height : 16;
   16.38      uint8_t fsr = vga_rcrt(vgabase, VGA_CRTC_MAX_SCAN); /* Font size register */
   16.39 @@ -573,7 +573,7 @@ string_param("vga", opt_vga);
   16.40  #define ATTRIBUTE   7
   16.41  #define VIDEO_SIZE  (COLUMNS * LINES * 2)
   16.42  
   16.43 -void vga_init(void)
   16.44 +void __init vga_init(void)
   16.45  {
   16.46      char *p;
   16.47  
   16.48 @@ -624,7 +624,7 @@ void vga_init(void)
   16.49      vgacon_enabled = 1;
   16.50  }
   16.51  
   16.52 -void vga_endboot(void)
   16.53 +void __init vga_endboot(void)
   16.54  {
   16.55      if ( !vgacon_enabled )
   16.56          return;
   16.57 @@ -670,7 +670,7 @@ void vga_putchar(int c)
   16.58      }
   16.59  }
   16.60  
   16.61 -int fill_console_start_info(struct dom0_vga_console_info *ci)
   16.62 +int __init fill_console_start_info(struct dom0_vga_console_info *ci)
   16.63  {
   16.64      memset(ci, 0, sizeof(*ci));
   16.65