]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - arch/x86/include/asm/setup.h
x86: introduce kaslr_offset()
[mirror_ubuntu-artful-kernel.git] / arch / x86 / include / asm / setup.h
index f69e06b283fb9ee03e8704847558aa577aecf221..785ac2f27271f88beeff59f65b7f99b5edda9019 100644 (file)
@@ -65,12 +65,18 @@ static inline void x86_ce4100_early_setup(void) { }
  * This is set up by the setup-routine at boot-time
  */
 extern struct boot_params boot_params;
+extern char _text[];
 
 static inline bool kaslr_enabled(void)
 {
        return !!(boot_params.hdr.loadflags & KASLR_FLAG);
 }
 
+static inline unsigned long kaslr_offset(void)
+{
+       return (unsigned long)&_text - __START_KERNEL;
+}
+
 /*
  * Do NOT EVER look at the BIOS memory size location.
  * It does not work on many machines.