summaryrefslogtreecommitdiff
path: root/kernel_call/kernel_slide.h
blob: 924485d97c43e2f938b98e300174da4df4655b5e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
 * kernel_slide.h
 * Brandon Azad
 */
#ifndef VOUCHER_SWAP__KERNEL_SLIDE_H_
#define VOUCHER_SWAP__KERNEL_SLIDE_H_

#include <stdbool.h>
#include <stdint.h>

#ifdef KERNEL_SLIDE_EXTERN
#define extern KERNEL_SLIDE_EXTERN
#endif

/*
 * kernel_slide
 *
 * Description:
 * 	The kASLR slide.
 */
extern uint64_t kernel_slide;

/*
 * kernel_slide_init
 *
 * Description:
 * 	Find the value of the kernel slide using kernel_read() and current_task.
 */
bool kernel_slide_init(void);

/*
 * kernel_slide_init_with_kernel_image_address
 *
 * Description:
 * 	Find the value of the kernel slide using kernel_read(), starting with an address that is
 * 	known to reside within the kernel image.
 */
bool kernel_slide_init_with_kernel_image_address(uint64_t address);

#undef extern

#endif