Skip to content

Commit

Permalink
m68k: Replace m68k-specific _[se]bss by generic __bss_{start,stop}
Browse files Browse the repository at this point in the history
BSS_SECTION() provides the __bss_{start,stop} symbols, so there's no need
to wrap our own _[se]bss around it.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Greg Ungerer<gerg@uclinux.org>
  • Loading branch information
Geert Uytterhoeven committed Jun 27, 2012
1 parent 363737d commit dc06105
Show file tree
Hide file tree
Showing 14 changed files with 30 additions and 38 deletions.
2 changes: 0 additions & 2 deletions arch/m68k/include/asm/sections.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,4 @@

#include <asm-generic/sections.h>

extern char _sbss[], _ebss[];

#endif /* _ASM_M68K_SECTIONS_H */
4 changes: 2 additions & 2 deletions arch/m68k/kernel/setup_no.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,9 @@ void __init setup_arch(char **cmdline_p)
#endif

pr_debug("KERNEL -> TEXT=0x%p-0x%p DATA=0x%p-0x%p BSS=0x%p-0x%p\n",
_stext, _etext, _sdata, _edata, _sbss, _ebss);
_stext, _etext, _sdata, _edata, __bss_start, __bss_stop);
pr_debug("MEMORY -> ROMFS=0x%p-0x%06lx MEM=0x%06lx-0x%06lx\n ",
_ebss, memory_start, memory_start, memory_end);
__bss_stop, memory_start, memory_start, memory_end);

/* Keep a copy of command line */
*cmdline_p = &command_line[0];
Expand Down
2 changes: 0 additions & 2 deletions arch/m68k/kernel/vmlinux-nommu.lds
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,7 @@ SECTIONS {
__init_end = .;
}

_sbss = .;
BSS_SECTION(0, 0, 0)
_ebss = .;

_end = .;

Expand Down
2 changes: 0 additions & 2 deletions arch/m68k/kernel/vmlinux-std.lds
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@ SECTIONS

RW_DATA_SECTION(16, PAGE_SIZE, THREAD_SIZE)

_sbss = .;
BSS_SECTION(0, 0, 0)
_ebss = .;

_edata = .; /* End of data section */

Expand Down
2 changes: 0 additions & 2 deletions arch/m68k/kernel/vmlinux-sun3.lds
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,7 @@ __init_begin = .;
. = ALIGN(PAGE_SIZE);
__init_end = .;

_sbss = .;
BSS_SECTION(0, 0, 0)
_ebss = .;

_end = . ;

Expand Down
2 changes: 1 addition & 1 deletion arch/m68k/mm/init_mm.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ void __init print_memmap(void)
MLK_ROUNDUP(__init_begin, __init_end),
MLK_ROUNDUP(_stext, _etext),
MLK_ROUNDUP(_sdata, _edata),
MLK_ROUNDUP(_sbss, _ebss));
MLK_ROUNDUP(__bss_start, __bss_stop));
}

void __init mem_init(void)
Expand Down
2 changes: 1 addition & 1 deletion arch/m68k/mm/init_no.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ void __init mem_init(void)
totalram_pages = free_all_bootmem();

codek = (_etext - _stext) >> 10;
datak = (_ebss - _sdata) >> 10;
datak = (__bss_stop - _sdata) >> 10;
initk = (__init_begin - __init_end) >> 10;

tmp = nr_free_pages() << PAGE_SHIFT;
Expand Down
8 changes: 4 additions & 4 deletions arch/m68k/platform/68328/head-de2.S
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ _start:
* Move ROM filesystem above bss :-)
*/

moveal #_sbss, %a0 /* romfs at the start of bss */
moveal #_ebss, %a1 /* Set up destination */
moveal #__bss_start, %a0 /* romfs at the start of bss */
moveal #__bss_stop, %a1 /* Set up destination */
movel %a0, %a2 /* Copy of bss start */

movel 8(%a0), %d1 /* Get size of ROMFS */
Expand All @@ -84,8 +84,8 @@ _start:
* Initialize BSS segment to 0
*/

lea _sbss, %a0
lea _ebss, %a1
lea __bss_start, %a0
lea __bss_stop, %a1

/* Copy 0 to %a0 until %a0 == %a1 */
2: cmpal %a0, %a1
Expand Down
10 changes: 5 additions & 5 deletions arch/m68k/platform/68328/head-pilot.S
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ L0:
movel #CONFIG_VECTORBASE, %d7
addl #16, %d7
moveal %d7, %a0
moveal #_ebss, %a1
moveal #__bss_stop, %a1
lea %a1@(512), %a2

DBG_PUTC('C')
Expand Down Expand Up @@ -138,8 +138,8 @@ LD1:

DBG_PUTC('E')

moveal #_sbss, %a0
moveal #_ebss, %a1
moveal #__bss_start, %a0
moveal #__bss_stop, %a1

/* Copy 0 to %a0 until %a0 == %a1 */
L1:
Expand All @@ -150,7 +150,7 @@ L1:
DBG_PUTC('F')

/* Copy command line from end of bss to command line */
moveal #_ebss, %a0
moveal #__bss_stop, %a0
moveal #command_line, %a1
lea %a1@(512), %a2

Expand All @@ -165,7 +165,7 @@ L3:

movel #_sdata, %d0
movel %d0, _rambase
movel #_ebss, %d0
movel #__bss_stop, %d0
movel %d0, _ramstart

movel %a4, %d0
Expand Down
4 changes: 2 additions & 2 deletions arch/m68k/platform/68328/head-ram.S
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ pclp3:
beq pclp3
#endif /* DEBUG */
moveal #0x007ffff0, %ssp
moveal #_sbss, %a0
moveal #_ebss, %a1
moveal #__bss_start, %a0
moveal #__bss_stop, %a1

/* Copy 0 to %a0 until %a0 >= %a1 */
L1:
Expand Down
6 changes: 3 additions & 3 deletions arch/m68k/platform/68328/head-rom.S
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ _stext: movew #0x2700,%sr
cmpal %a1, %a2
bhi 1b

moveal #_sbss, %a0
moveal #_ebss, %a1
moveal #__bss_start, %a0
moveal #__bss_stop, %a1
/* Copy 0 to %a0 until %a0 == %a1 */

1:
Expand All @@ -70,7 +70,7 @@ _stext: movew #0x2700,%sr

movel #_sdata, %d0
movel %d0, _rambase
movel #_ebss, %d0
movel #__bss_stop, %d0
movel %d0, _ramstart
movel #RAMEND-CONFIG_MEMORY_RESERVE*0x100000, %d0
movel %d0, _ramend
Expand Down
6 changes: 3 additions & 3 deletions arch/m68k/platform/68360/head-ram.S
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,8 @@ LD1:
cmp.l #_edata, %a1
blt LD1

moveal #_sbss, %a0
moveal #_ebss, %a1
moveal #__bss_start, %a0
moveal #__bss_stop, %a1

/* Copy 0 to %a0 until %a0 == %a1 */
L1:
Expand All @@ -234,7 +234,7 @@ load_quicc:
store_ram_size:
/* Set ram size information */
move.l #_sdata, _rambase
move.l #_ebss, _ramstart
move.l #__bss_stop, _ramstart
move.l #RAMEND, %d0
sub.l #0x1000, %d0 /* Reserve 4K for stack space.*/
move.l %d0, _ramend /* Different from RAMEND.*/
Expand Down
8 changes: 4 additions & 4 deletions arch/m68k/platform/68360/head-rom.S
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/

.global _stext
.global _sbss
.global __bss_start
.global _start

.global _rambase
Expand Down Expand Up @@ -229,8 +229,8 @@ LD1:
cmp.l #_edata, %a1
blt LD1

moveal #_sbss, %a0
moveal #_ebss, %a1
moveal #__bss_start, %a0
moveal #__bss_stop, %a1

/* Copy 0 to %a0 until %a0 == %a1 */
L1:
Expand All @@ -244,7 +244,7 @@ load_quicc:
store_ram_size:
/* Set ram size information */
move.l #_sdata, _rambase
move.l #_ebss, _ramstart
move.l #__bss_stop, _ramstart
move.l #RAMEND, %d0
sub.l #0x1000, %d0 /* Reserve 4K for stack space.*/
move.l %d0, _ramend /* Different from RAMEND.*/
Expand Down
10 changes: 5 additions & 5 deletions arch/m68k/platform/coldfire/head.S
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,8 @@ _vstart:
/*
* Move ROM filesystem above bss :-)
*/
lea _sbss,%a0 /* get start of bss */
lea _ebss,%a1 /* set up destination */
lea __bss_start,%a0 /* get start of bss */
lea __bss_stop,%a1 /* set up destination */
movel %a0,%a2 /* copy of bss start */

movel 8(%a0),%d0 /* get size of ROMFS */
Expand All @@ -249,16 +249,16 @@ _copy_romfs:
bne _copy_romfs

#else /* CONFIG_ROMFS_FS */
lea _ebss,%a1
lea __bss_stop,%a1
movel %a1,_ramstart
#endif /* CONFIG_ROMFS_FS */


/*
* Zero out the bss region.
*/
lea _sbss,%a0 /* get start of bss */
lea _ebss,%a1 /* get end of bss */
lea __bss_start,%a0 /* get start of bss */
lea __bss_stop,%a1 /* get end of bss */
clrl %d0 /* set value */
_clear_bss:
movel %d0,(%a0)+ /* clear each word */
Expand Down

0 comments on commit dc06105

Please sign in to comment.