Browse Source

arch/arm: Fixup formatting to match arch/i386

Aaron Lindsay 7 years ago
parent
commit
ed52a8af5c
2 changed files with 21 additions and 11 deletions
  1. 12 4
      arch/arm/kernel.ld
  2. 9 7
      arch/arm/start.S

+ 12 - 4
arch/arm/kernel.ld

@@ -2,8 +2,11 @@ ENTRY (start)
2 2
 
3 3
 SECTIONS
4 4
 {
5
-	. = 0x80100000;
6
-	.text : { *(.text*) *(.rodata*) }
5
+	. = 0xc0100000;
6
+	kernel_start = .;
7
+	.text : {
8
+		*(.text*) *(.rodata*)
9
+	}
7 10
 	.init : {
8 11
 		early_initcalls_start = .;
9 12
 		*(.earlyinitcalls*)
@@ -12,8 +15,13 @@ SECTIONS
12 15
 		*(.driversubsysinitcalls*)
13 16
 		*(.deviceinitcalls*)
14 17
 		initcalls_end = .;
18
+		*(.init*)
19
+	}
20
+	.data : {
21
+		*(.data*)
22
+	}
23
+	.bss : {
24
+		*(.bss*) *(COMMON*)
15 25
 	}
16
-	.data : { *(.data*) }
17
-	.bss : { *(.bss*) *(COMMON*) }
18 26
 	kernel_end = .;
19 27
 }

+ 9 - 7
arch/arm/start.S

@@ -18,6 +18,8 @@
18 18
     51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 19
  */
20 20
 
21
+#define STACK_SIZE 0x4000 /* 16k */
22
+
21 23
 /*
22 24
  * Kernel entry in assembly. This handles relocating the kernel so that it is
23 25
  * in both physical and virtual memory where we want it to be. We copy the
@@ -27,7 +29,7 @@
27 29
  * function in C using the address it is linked against. When the MMU gets
28 30
  * initialized fully later, it will remove the initial 1:1 mapping.
29 31
  */
30
-.globl start
32
+.global start
31 33
 start:
32 34
 	str r1, machine_type /* Backup atags/machine type registers so we can access them later from C */
33 35
 	str r2, atags_ptr
@@ -37,7 +39,7 @@ copy_kernel_lr: /* Used to calculate address at which kernel is currently loaded
37 39
 
38 40
 	bl setup_mmu
39 41
 
40
-	ldr sp, =stack+0x10000 /* Set up the stack */
42
+	ldr sp, =stack+STACK_SIZE /* Set up the stack */
41 43
 	bl main
42 44
 
43 45
 1:
@@ -174,17 +176,17 @@ tt_base_align:
174 176
 	.word 0b111111111111111 /* 16k - 1 */
175 177
 tt_section_align:
176 178
 	.word 0b11111111111111111111 /* 1mb - 1 */
177
-.globl tt_base_virtual
179
+.global tt_base_virtual
178 180
 tt_base_virtual:
179 181
 	.word 0
180
-.globl tt_base_physical
182
+.global tt_base_physical
181 183
 tt_base_physical:
182 184
 	.word 0
183
-.globl atags_ptr
185
+.global atags_ptr
184 186
 atags_ptr:
185 187
 	.word 0
186
-.globl machine_type
188
+.global machine_type
187 189
 machine_type:
188 190
 	.word 0
189 191
 
190
-.comm stack, 0x10000 /* Reserve 64k for the stack in .bss */
192
+.lcomm stack, STACK_SIZE /* Reserve space for the stack in .bss */