linux/arch/x86/include/asm/setup.h
<<
>>
Prefs
   1#ifndef _ASM_X86_SETUP_H
   2#define _ASM_X86_SETUP_H
   3
   4#include <uapi/asm/setup.h>
   5
   6#define COMMAND_LINE_SIZE 2048
   7
   8#ifdef __i386__
   9
  10#include <linux/pfn.h>
  11/*
  12 * Reserved space for vmalloc and iomap - defined in asm/page.h
  13 */
  14#define MAXMEM_PFN      PFN_DOWN(MAXMEM)
  15#define MAX_NONPAE_PFN  (1 << 20)
  16
  17#endif /* __i386__ */
  18
  19#define PARAM_SIZE 4096         /* sizeof(struct boot_params) */
  20
  21#define OLD_CL_MAGIC            0xA33F
  22#define OLD_CL_ADDRESS          0x020   /* Relative to real mode data */
  23#define NEW_CL_POINTER          0x228   /* Relative to real mode data */
  24
  25#ifndef __ASSEMBLY__
  26#include <asm/bootparam.h>
  27#include <asm/x86_init.h>
  28
  29extern u64 relocated_ramdisk;
  30
  31/* Interrupt control for vSMPowered x86_64 systems */
  32#ifdef CONFIG_X86_64
  33void vsmp_init(void);
  34#else
  35static inline void vsmp_init(void) { }
  36#endif
  37
  38void setup_bios_corruption_check(void);
  39
  40#ifdef CONFIG_X86_VISWS
  41extern void visws_early_detect(void);
  42#else
  43static inline void visws_early_detect(void) { }
  44#endif
  45
  46extern unsigned long saved_video_mode;
  47
  48extern void reserve_standard_io_resources(void);
  49extern void i386_reserve_resources(void);
  50extern void setup_default_timer_irq(void);
  51
  52#ifdef CONFIG_X86_INTEL_MID
  53extern void x86_mrst_early_setup(void);
  54#else
  55static inline void x86_mrst_early_setup(void) { }
  56#endif
  57
  58#ifdef CONFIG_X86_INTEL_CE
  59extern void x86_ce4100_early_setup(void);
  60#else
  61static inline void x86_ce4100_early_setup(void) { }
  62#endif
  63
  64#ifndef _SETUP
  65
  66#include <linux/kernel.h>
  67
  68/*
  69 * This is set up by the setup-routine at boot-time
  70 */
  71extern struct boot_params boot_params;
  72extern char _text[];
  73
  74static inline bool kaslr_enabled(void)
  75{
  76        return !!(boot_params.hdr.loadflags & KASLR_FLAG);
  77}
  78
  79static inline unsigned long kaslr_offset(void)
  80{
  81        return (unsigned long)&_text - __START_KERNEL;
  82}
  83
  84/*
  85 * Do NOT EVER look at the BIOS memory size location.
  86 * It does not work on many machines.
  87 */
  88#define LOWMEMSIZE()    (0x9f000)
  89
  90/* exceedingly early brk-like allocator */
  91extern unsigned long _brk_end;
  92void *extend_brk(size_t size, size_t align);
  93
  94/*
  95 * Reserve space in the brk section.  The name must be unique within
  96 * the file, and somewhat descriptive.  The size is in bytes.  Must be
  97 * used at file scope.
  98 *
  99 * (This uses a temp function to wrap the asm so we can pass it the
 100 * size parameter; otherwise we wouldn't be able to.  We can't use a
 101 * "section" attribute on a normal variable because it always ends up
 102 * being @progbits, which ends up allocating space in the vmlinux
 103 * executable.)
 104 */
 105#define RESERVE_BRK(name,sz)                                            \
 106        static void __section(.discard.text) __used notrace             \
 107        __brk_reservation_fn_##name##__(void) {                         \
 108                asm volatile (                                          \
 109                        ".pushsection .brk_reservation,\"aw\",@nobits;" \
 110                        ".brk." #name ":"                               \
 111                        " 1:.skip %c0;"                                 \
 112                        " .size .brk." #name ", . - 1b;"                \
 113                        " .popsection"                                  \
 114                        : : "i" (sz));                                  \
 115        }
 116
 117/* Helper for reserving space for arrays of things */
 118#define RESERVE_BRK_ARRAY(type, name, entries)          \
 119        type *name;                                     \
 120        RESERVE_BRK(name, sizeof(type) * entries)
 121
 122extern void probe_roms(void);
 123#ifdef __i386__
 124
 125void __init i386_start_kernel(void);
 126
 127#else
 128void __init x86_64_start_kernel(char *real_mode);
 129void __init x86_64_start_reservations(char *real_mode_data);
 130
 131#endif /* __i386__ */
 132#endif /* _SETUP */
 133#else
 134#define RESERVE_BRK(name,sz)                            \
 135        .pushsection .brk_reservation,"aw",@nobits;     \
 136.brk.name:                                              \
 1371:      .skip sz;                                       \
 138        .size .brk.name,.-1b;                           \
 139        .popsection
 140#endif /* __ASSEMBLY__ */
 141#endif /* _ASM_X86_SETUP_H */
 142