Subversion Repositories HelenOS

Rev

Rev 1787 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
178 palkovsky 1
/** AMD64 linker script
164 palkovsky 2
 *  
3
 * umapped section:
4
 * 	kernel text
5
 * 	kernel data
6
 * mapped section:
7
 *	kernel text
8
 *	kernel data 
9
 */
10
 
289 palkovsky 11
#include <arch/boot/boot.h>
12
#include <arch/mm/page.h>
13
 
164 palkovsky 14
SECTIONS {
694 decky 15
	.unmapped BOOT_OFFSET: AT (0) {
164 palkovsky 16
		unmapped_ktext_start = .;
17
		*(K_TEXT_START);
18
		unmapped_ktext_end = .;
275 palkovsky 19
 
164 palkovsky 20
		unmapped_kdata_start = .;
21
		*(K_DATA_START);
22
		unmapped_kdata_end = .;
23
	}
24
 
694 decky 25
	.mapped (PA2KA(BOOT_OFFSET)+SIZEOF(.unmapped)) : AT (SIZEOF(.unmapped)) {
164 palkovsky 26
		ktext_start = .;
27
		*(.text);
28
		ktext_end = .;
29
 
30
		kdata_start = .;
31
		*(.data);		/* initialized data */
32
		*(.rodata*);		/* string literals */
216 palkovsky 33
		hardcoded_load_address = .;
694 decky 34
		QUAD(PA2KA(BOOT_OFFSET));
216 palkovsky 35
		hardcoded_ktext_size = .;
36
		QUAD(ktext_end - ktext_start + (unmapped_ktext_end - unmapped_ktext_start));
37
		hardcoded_kdata_size = .;
38
		QUAD(kdata_end - kdata_start + (unmapped_kdata_end - unmapped_kdata_start));
275 palkovsky 39
		hardcoded_unmapped_ktext_size = .;
820 jermar 40
		QUAD(unmapped_ktext_end - unmapped_ktext_start);
275 palkovsky 41
		hardcoded_unmapped_kdata_size = .;
820 jermar 42
		QUAD(unmapped_kdata_end - unmapped_kdata_start);
268 palkovsky 43
		*(COMMON);		/* global variables */
44
 
216 palkovsky 45
		*(.eh_frame);
268 palkovsky 46
 
47
		symbol_table = .;
48
		*(symtab.*);            /* Symbol table, must be LAST symbol!*/
49
 
602 palkovsky 50
		*(.bss);		/* uninitialized static variables */
51
 
164 palkovsky 52
		kdata_end = .;
53
	}
696 decky 54
 
55
#ifdef CONFIG_SMP	
56
	_hardcoded_unmapped_size = (unmapped_ktext_end - unmapped_ktext_start) + (unmapped_kdata_end - unmapped_kdata_start);
57
	ap_boot = unmapped_ap_boot - BOOT_OFFSET + AP_BOOT_OFFSET;
58
	ap_gdtr = unmapped_ap_gdtr - BOOT_OFFSET + AP_BOOT_OFFSET;
59
	protected_ap_gdtr = PA2KA(ap_gdtr);
60
 
61
#endif /* CONFIG_SMP */
62
 
164 palkovsky 63
}