diff options
Diffstat (limited to 'c/src/lib/libbsp/m68k/ods68302')
-rw-r--r-- | c/src/lib/libbsp/m68k/ods68302/start/debugreset.S | 18 | ||||
-rw-r--r-- | c/src/lib/libbsp/m68k/ods68302/start/reset.S | 11 | ||||
-rw-r--r-- | c/src/lib/libbsp/m68k/ods68302/startup/Makefile.in | 4 | ||||
-rw-r--r-- | c/src/lib/libbsp/m68k/ods68302/startup/bspstart.c | 43 | ||||
-rw-r--r-- | c/src/lib/libbsp/m68k/ods68302/startup/linkcmds | 22 |
5 files changed, 22 insertions, 76 deletions
diff --git a/c/src/lib/libbsp/m68k/ods68302/start/debugreset.S b/c/src/lib/libbsp/m68k/ods68302/start/debugreset.S index 74049191c4..3438f93c51 100644 --- a/c/src/lib/libbsp/m68k/ods68302/start/debugreset.S +++ b/c/src/lib/libbsp/m68k/ods68302/start/debugreset.S @@ -47,22 +47,17 @@ start: | zerobss: - moveal #end,%a0 | find end of .bss - moveal #bss_start,%a1 | find beginning of .bss + moveal #_clear_end,%a0 | find end of .bss + moveal #_clear_start,%a1 | find beginning of .bss moveq #0,%d0 zerobss_loop: movel %d0,%a1@+ | to zero out uninitialized cmpal %a0,%a1 - jlt zerobss_loop | loop until _end reached + jlt zerobss_loop | loop until end reached - movel #end,%d0 | d0 = end of bss/start of heap - addl #heap_size,%d0 | d0 = end of heap - - movel %d0,stack_start | Save for brk() routine - addl #stack_size,%d0 | make room for stack - andl #0xffffffc0,%d0 | align it on 16 byte boundary + movel %d0,_stack_init | load stack top movw #0x3700,%sr | SUPV MODE,INTERRUPTS OFF!!! movel %d0,%a7 | set master stack pointer @@ -81,11 +76,6 @@ zerobss_loop: start_frame: .space 4,0 - .global stack_start - -stack_start: - .space 4,0 - | | Uninitialised data | diff --git a/c/src/lib/libbsp/m68k/ods68302/start/reset.S b/c/src/lib/libbsp/m68k/ods68302/start/reset.S index 95447da7e1..1ed00d2401 100644 --- a/c/src/lib/libbsp/m68k/ods68302/start/reset.S +++ b/c/src/lib/libbsp/m68k/ods68302/start/reset.S @@ -453,8 +453,8 @@ copy_data_loop: | zerobss: - moveal #end,%a0 | find end of .bss - moveal #_bss_start,%a1 | find beginning of .bss + moveal #_clear_end,%a0 | find end of .bss + moveal #_clear_start,%a1 | find beginning of .bss moveq #0,%d0 zerobss_loop: @@ -463,12 +463,7 @@ zerobss_loop: cmpal %a0,%a1 jlt zerobss_loop | loop until _end reached - movel #end,%d0 | d0 = end of bss/start of heap - addl #heap_size,%d0 | d0 = end of heap - - movel %d0,stack_start | Save for brk() routine - addl #stack_size,%d0 | make room for stack - andl #0xffffffc0,%d0 | align it on 16 byte boundary + movel %d0,_stack_init | load stack top movw #0x3700,%sr | SUPV MODE,INTERRUPTS OFF!!! movel %d0,%a7 | set master stack pointer diff --git a/c/src/lib/libbsp/m68k/ods68302/startup/Makefile.in b/c/src/lib/libbsp/m68k/ods68302/startup/Makefile.in index 592d59cec2..cc5b6a7e82 100644 --- a/c/src/lib/libbsp/m68k/ods68302/startup/Makefile.in +++ b/c/src/lib/libbsp/m68k/ods68302/startup/Makefile.in @@ -17,8 +17,8 @@ PGM = ${ARCH}/startup.rel # C source names, if any, go here -- minus the .c C_PIECES = crc debugport gdb-hooks bootcard main m68302scc m68k-stub \ - memcheck trace gnatinstallhandler bsplibc bsppost bspstart bspclean sbrk \ - setvec + m68kpretaskinghook memcheck trace gnatinstallhandler bsplibc \ + bsppost bspstart bspclean sbrk setvec C_FILES = $(C_PIECES:%=%.c) C_O_FILES = $(C_PIECES:%=${ARCH}/%.o) diff --git a/c/src/lib/libbsp/m68k/ods68302/startup/bspstart.c b/c/src/lib/libbsp/m68k/ods68302/startup/bspstart.c index d752bb2cbe..c980c29e63 100644 --- a/c/src/lib/libbsp/m68k/ods68302/startup/bspstart.c +++ b/c/src/lib/libbsp/m68k/ods68302/startup/bspstart.c @@ -40,38 +40,9 @@ char *rtems_progname; void bsp_postdriver_hook(void); void bsp_libc_init( void *, unsigned32, int ); +void bsp_pretasking_hook(void); /* m68k version */ /* - * Function: bsp_pretasking_hook - * Created: 95/03/10 - * - * Description: - * BSP pretasking hook. Called just before drivers are initialized. - * Used to setup libc and install any BSP extensions. - * - * NOTES: - * Must not use libc (to do io) from here, since drivers are - * not yet initialized. - * - */ - -void bsp_pretasking_hook(void) -{ - extern int end; - rtems_unsigned32 heap_start; - - heap_start = (rtems_unsigned32) &end; - if (heap_start & (CPU_ALIGNMENT-1)) - heap_start = (heap_start + CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1); - - bsp_libc_init((void *) heap_start, 64 * 1024, 0); - -#ifdef RTEMS_DEBUG - rtems_debug_enable( RTEMS_DEBUG_ALL_MASK ); -#endif -} - -/* * bsp_start * * This routine does the bulk of the system initialization. @@ -79,13 +50,8 @@ void bsp_pretasking_hook(void) void bsp_start( void ) { - /* - * Allocate the memory for the RTEMS Work Space. This can come from - * a variety of places: hard coded address, malloc'ed from outside - * RTEMS world (e.g. simulator or primitive memory manager), or (as - * typically done by stock BSPs) by subtracting the required amount - * of work space from the last physical address on the CPU board. - */ + extern void *_WorkspaceBase; + #if 0 Cpu_table.interrupt_vector_table = (mc68000_isr *) 0/*&M68Kvec*/; #endif @@ -96,8 +62,7 @@ void bsp_start( void ) * not malloc'ed. It is just "pulled from the air". */ - BSP_Configuration.work_space_start = (void *) - (RAM_END - BSP_Configuration.work_space_size); + BSP_Configuration.work_space_start = (void *) &_WorkspaceBase; /* * initialize the CPU table for this BSP diff --git a/c/src/lib/libbsp/m68k/ods68302/startup/linkcmds b/c/src/lib/libbsp/m68k/ods68302/startup/linkcmds index 89858099cf..3911aaed12 100644 --- a/c/src/lib/libbsp/m68k/ods68302/startup/linkcmds +++ b/c/src/lib/libbsp/m68k/ods68302/startup/linkcmds @@ -8,8 +8,10 @@ /* * Declare some sizes. */ -HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000; -StackSize = DEFINED(StackSize) ? StackSize : 0x1000; +_RamBase = 0x0; +_RamSize = DEFINED(_RamSize) ? _RamSize : 1M; +_HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000; +_StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000; /* * Declare on-board memory. @@ -113,24 +115,18 @@ SECTIONS PROVIDE (_copy_end = .); } >ram .bss : { - PROVIDE (_bss_start = .); - PROVIDE (_clear_start = .); + _clear_start = .; *(.bss) *(COMMON) . = ALIGN (16); PROVIDE (end = .); - . += StackSize; - PROVIDE (_stack_init = .); - + . += _StackSize; . = ALIGN (16); - PROVIDE (_HeapStart = .); - . += HeapSize; - PROVIDE (_HeapEnd = .); - - PROVIDE (_clear_end = .); + _stack_init = .; + _clear_end = .; - PROVIDE (_WorkspaceBase = .); + _WorkspaceBase = .; } >ram } |