trampoline.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #ifndef _ASM_X86_TRAMPOLINE_H
  2. #define _ASM_X86_TRAMPOLINE_H
  3. #ifndef __ASSEMBLY__
  4. #include <linux/types.h>
  5. #include <asm/io.h>
  6. /*
  7. * Trampoline 80x86 program as an array. These are in the init rodata
  8. * segment, but that's okay, because we only care about the relative
  9. * addresses of the symbols.
  10. */
  11. extern const unsigned char x86_trampoline_start [];
  12. extern const unsigned char x86_trampoline_end [];
  13. extern unsigned char *x86_trampoline_base;
  14. extern unsigned long init_rsp;
  15. extern unsigned long initial_code;
  16. extern unsigned long initial_gs;
  17. extern void __init setup_trampolines(void);
  18. extern const unsigned char trampoline_data[];
  19. extern const unsigned char trampoline_status[];
  20. #define TRAMPOLINE_SYM(x) \
  21. ((void *)(x86_trampoline_base + \
  22. ((const unsigned char *)(x) - x86_trampoline_start)))
  23. /* Address of the SMP trampoline */
  24. static inline unsigned long trampoline_address(void)
  25. {
  26. return virt_to_phys(TRAMPOLINE_SYM(trampoline_data));
  27. }
  28. #endif /* __ASSEMBLY__ */
  29. #endif /* _ASM_X86_TRAMPOLINE_H */