From 7150f00f5be87fa8e37f7d00fbbef35645081138 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Mon, 1 Dec 1997 22:06:48 +0000 Subject: Inclusion of PC386 BSP submitted by Pedro Miguel Da Cruz Neto Romano and Jose Rufino of NavIST (http://pandora.ist.utl.pt/). --- c/src/lib/libbsp/i386/pc386/startup/Makefile.in | 58 ++++++ c/src/lib/libbsp/i386/pc386/startup/bspstart.c | 241 ++++++++++++++++++++++++ c/src/lib/libbsp/i386/pc386/startup/exit.c | 73 +++++++ c/src/lib/libbsp/i386/pc386/startup/ldsegs.s | 205 ++++++++++++++++++++ c/src/lib/libbsp/i386/pc386/startup/linkcmds | 62 ++++++ c/src/lib/libbsp/i386/pc386/startup/sbrk.c | 50 +++++ 6 files changed, 689 insertions(+) create mode 100644 c/src/lib/libbsp/i386/pc386/startup/Makefile.in create mode 100644 c/src/lib/libbsp/i386/pc386/startup/bspstart.c create mode 100644 c/src/lib/libbsp/i386/pc386/startup/exit.c create mode 100644 c/src/lib/libbsp/i386/pc386/startup/ldsegs.s create mode 100644 c/src/lib/libbsp/i386/pc386/startup/linkcmds create mode 100644 c/src/lib/libbsp/i386/pc386/startup/sbrk.c (limited to 'c/src/lib/libbsp/i386/pc386/startup') diff --git a/c/src/lib/libbsp/i386/pc386/startup/Makefile.in b/c/src/lib/libbsp/i386/pc386/startup/Makefile.in new file mode 100644 index 0000000000..8d86ba9132 --- /dev/null +++ b/c/src/lib/libbsp/i386/pc386/startup/Makefile.in @@ -0,0 +1,58 @@ +# +# $Id$ +# + +@SET_MAKE@ +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH=@srcdir@:@srcdir@/../../../shared + +PGM=${ARCH}/startup.rel + +# C source names, if any, go here -- minus the .c +C_PIECES=bspstart exit irq sbrk +C_FILES=$(C_PIECES:%=%.c) +C_O_FILES=$(C_PIECES:%=${ARCH}/%.o) + +H_FILES= + +# Assembly source names, if any, go here -- minus the .s +S_PIECES=ldsegs +S_FILES=$(S_PIECES:%=%.s) +S_O_FILES=$(S_FILES:%.s=${ARCH}/%.o) + +SRCS=$(srcdir)/linkcmds $(C_FILES) $(H_FILES) $(S_FILES) +OBJS=$(C_O_FILES) $(S_O_FILES) + +include $(RTEMS_CUSTOM) +include $(PROJECT_ROOT)/make/leaf.cfg + +# +# (OPTIONAL) Add local stuff here using += +# + +DEFINES += +CPPFLAGS += +CFLAGS += + +LD_PATHS += +LD_LIBS += +LDFLAGS += + +# +# Add your list of files to delete here. The config files +# already know how to delete some stuff, so you may want +# to just run 'make clean' first to see what gets missed. +# 'make clobber' already includes 'make clean' +# + +CLEAN_ADDITIONS += +CLOBBER_ADDITIONS += + +${PGM}: ${SRCS} ${OBJS} + $(make-rel) +all: ${ARCH} $(SRCS) $(PGM) + $(INSTALL) $(srcdir)/linkcmds ${PROJECT_RELEASE}/lib + +# the .rel file built here will be put into libbsp.a by ../wrapup/Makefile + diff --git a/c/src/lib/libbsp/i386/pc386/startup/bspstart.c b/c/src/lib/libbsp/i386/pc386/startup/bspstart.c new file mode 100644 index 0000000000..73c9e6adeb --- /dev/null +++ b/c/src/lib/libbsp/i386/pc386/startup/bspstart.c @@ -0,0 +1,241 @@ +/*-------------------------------------------------------------------------+ +| bspstart.c v1.1 - PC386 BSP - 1997/08/07 ++--------------------------------------------------------------------------+ +| This file contains the PC386 BSP startup package. It includes application, +| board, and monitor specific initialization and configuration. The generic CPU +| dependent initialization has been performed before this routine is invoked. ++--------------------------------------------------------------------------+ +| (C) Copyright 1997 - +| - NavIST Group - Real-Time Distributed Systems and Industrial Automation +| +| http://pandora.ist.utl.pt +| +| Instituto Superior Tecnico * Lisboa * PORTUGAL ++--------------------------------------------------------------------------+ +| Disclaimer: +| +| This file is provided "AS IS" without warranty of any kind, either +| expressed or implied. ++--------------------------------------------------------------------------+ +| This code is based on: +| bspstart.c,v 1.8 1996/05/28 13:12:40 joel Exp - go32 BSP +| With the following copyright notice: +| ************************************************************************** +| * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994. * +| * On-Line Applications Research Corporation (OAR). * +| * All rights assigned to U.S. Government, 1994. * +| * * +| * This material may be reproduced by or for the U.S. Government pursuant * +| * to the copyright license under the clause at DFARS 252.227-7013. This * +| * notice must appear in all copies of this file and its derivatives. * +| ************************************************************************** ++--------------------------------------------------------------------------*/ + + +#include + +#include +#include +#include + +#ifdef STACK_CHECKER_ON +#include +#endif + +/*-------------------------------------------------------------------------+ +| Global Variables ++--------------------------------------------------------------------------*/ +#ifdef RTEMS_SMALL_MEMORY +extern rtems_unsigned32 _end; /* End of BSS. Defined in 'linkcmds'. */ + +rtems_unsigned32 rtemsFreeMemStart = (rtems_unsigned32)&_end; + /* Address of start of free memory - should be updated + after creating new partitions or regions. */ +#else +rtems_unsigned32 rtemsFreeMemStart = RAM_START; + /* RAM_START defined in 'bsp.h'. */ +#endif /* RTEMS_SMALL_MEMORY */ + +/* The original BSP configuration table from the application and our copy of it + with some changes. */ + +extern rtems_configuration_table Configuration; + rtems_configuration_table BSP_Configuration; + +rtems_cpu_table Cpu_table; /* CPU configuration table. */ +char *rtems_progname; /* Program name - from main(). */ + + +/*-------------------------------------------------------------------------+ +| External Prototypes ++--------------------------------------------------------------------------*/ +extern void _exit(int); /* define in exit.c */ + +/*-------------------------------------------------------------------------+ +| Function: bsp_libc_init +| Description: Initialize whatever libc we are using. Called from +| pretasking hook. +| Global Variables: rtemsFreeMemStart. +| Arguments: None. +| Returns: Nothing. ++--------------------------------------------------------------------------*/ +static void +bsp_libc_init(void) +{ + if (rtemsFreeMemStart & (CPU_ALIGNMENT - 1)) /* not aligned => align it */ + rtemsFreeMemStart = (rtemsFreeMemStart+CPU_ALIGNMENT) & ~(CPU_ALIGNMENT-1); + + RTEMS_Malloc_Initialize((void *)rtemsFreeMemStart, HEAP_SIZE << 10, 0); + rtemsFreeMemStart += HEAP_SIZE << 10; /* HEAP_SIZE is in KBytes */ + + /* Init the RTEMS libio facility to provide UNIX-like system calls for use by + newlib (ie: provide __rtems_open, __rtems_close, etc). Uses malloc() + to get area for the iops, so must be after malloc initialization. */ + + rtems_libio_init(); + + /* Set up for the libc handling. */ + + if (BSP_Configuration.ticks_per_timeslice > 0) + libc_init(1); /* reentrant if possible */ + else + libc_init(0); /* non-reentrant */ +} /* bsp_libc_init */ + + +/*-------------------------------------------------------------------------+ +| Function: bsp_pretasking_hook +| Description: BSP pretasking hook. Called just before drivers are +| initialized. Used to setup libc and install any BSP +| extensions. NOTE: Must not use libc (to do io) from here, +| since drivers are not yet initialized. +| Global Variables: None. +| Arguments: None. +| Returns: Nothing. ++--------------------------------------------------------------------------*/ +void +bsp_pretasking_hook(void) +{ + bsp_libc_init(); + +#ifdef STACK_CHECKER_ON + /* Initialize the stack bounds checker. We can either turn it on here or from + the app. */ + + Stack_check_Initialize(); + +#endif /* STACK_CHECKER_ON */ + +#ifdef RTEMS_DEBUG + + rtems_debug_enable(RTEMS_DEBUG_ALL_MASK); + +#endif /* RTEMS_DEBUG */ +} /* bsp_pretasking_hook */ + + +/*-------------------------------------------------------------------------+ +| Function: bsp_postdriver_hook +| Description: After drivers are setup, register some "filenames" and open +| stdin, stdout, stderr files. Newlib will automatically +| associate the files with these (it hardcodes the numbers). +| Global Variables: None. +| Arguments: None. +| Returns: Nothing. ++--------------------------------------------------------------------------*/ +void +bsp_postdriver_hook(void) +{ + int stdin_fd, stdout_fd, stderr_fd; + + rtems_status_code error_code; + + error_code = 'S' << 24 | 'T' << 16; + + /* open standard devices: stdout, stderr and stdin */ + + if ((stdin_fd = __rtems_open("/dev/console", O_RDONLY, 0)) < 0) + rtems_fatal_error_occurred( error_code | 'D' << 8 | '0' ); + + if ((stdout_fd = __rtems_open("/dev/console", O_WRONLY, 0)) < 0) + rtems_fatal_error_occurred( error_code | 'D' << 8 | '1' ); + + if ((stderr_fd = __rtems_open("/dev/console", O_WRONLY, 0)) < 1) + rtems_fatal_error_occurred( error_code | 'D' << 8 | '2' ); + + if ((stdin_fd != 0) || (stdout_fd != 1) || (stderr_fd != 2)) + rtems_fatal_error_occurred( error_code | 'I' << 8 | 'O' ); +} /* bsp_postdriver_hook */ + + +/*-------------------------------------------------------------------------+ +| Function: main +| Description: Called from bsp's startup code ('start.s'). +| Global Variables: None. +| Arguments: None. +| Returns: Nothing. ++--------------------------------------------------------------------------*/ +int main(int argc, char **argv, char **environp) +{ + /* If we don't have command line arguments set default program name. */ + + if ((argc > 0) && argv && argv[0]) + rtems_progname = argv[0]; + else + rtems_progname = "RTEMS"; + + Cpu_table.pretasking_hook = bsp_pretasking_hook; /* init libc, etc. */ + Cpu_table.predriver_hook = NULL; /* use system's */ + Cpu_table.postdriver_hook = bsp_postdriver_hook; + Cpu_table.idle_task = NULL; + /* do not override system IDLE task */ + Cpu_table.do_zero_of_workspace = TRUE; + Cpu_table.interrupt_table_segment = get_ds(); + Cpu_table.interrupt_table_offset = (void *)Interrupt_descriptor_table; + Cpu_table.interrupt_stack_size = 4096; + Cpu_table.extra_mpci_receive_server_stack = 0; + + /* Copy user's table and make necessary adjustments. */ + + BSP_Configuration = Configuration; + + /* Place RTEMS workspace at top of physical RAM (RAM_END defined in 'bsp.h' */ + + BSP_Configuration.work_space_start = + (void *)(RAM_END - BSP_Configuration.work_space_size); + + /* Add 1 region for Malloc in libc_low. */ + + BSP_Configuration.RTEMS_api_configuration->maximum_regions++; + + /* Add 1 extension for newlib libc. */ + +#ifdef RTEMS_NEWLIB + BSP_Configuration.maximum_extensions++; +#endif + + /* Add another extension if using the stack checker. */ + +#ifdef STACK_CHECKER_ON + BSP_Configuration.maximum_extensions++; +#endif + + /* Tell libio how many fd's we want and allow it to tweak config. */ + + rtems_libio_config(&BSP_Configuration, BSP_LIBIO_MAX_FDS); + + rtems_initialize_executive(&BSP_Configuration, &Cpu_table); + /* does not return */ + + /*-------------------------------------------------------------------------+ + | We only return here if the executive has finished. This happens when the + | task has called exit(). We will then call _exit() which is part of the bsp. + +--------------------------------------------------------------------------*/ + + for (;;) + _exit(0); + + /* no cleanup necessary for PC386 */ + + return 0; +} /* main */ diff --git a/c/src/lib/libbsp/i386/pc386/startup/exit.c b/c/src/lib/libbsp/i386/pc386/startup/exit.c new file mode 100644 index 0000000000..b518c71418 --- /dev/null +++ b/c/src/lib/libbsp/i386/pc386/startup/exit.c @@ -0,0 +1,73 @@ +/*-------------------------------------------------------------------------+ +| exit.c v1.1 - PC386 BSP - 1997/08/07 ++--------------------------------------------------------------------------+ +| Routines to shutdown and reboot the PC. ++--------------------------------------------------------------------------+ +| (C) Copyright 1997 - +| - NavIST Group - Real-Time Distributed Systems and Industrial Automation +| +| http://pandora.ist.utl.pt +| +| Instituto Superior Tecnico * Lisboa * PORTUGAL ++--------------------------------------------------------------------------+ +| Disclaimer: +| +| This file is provided "AS IS" without warranty of any kind, either +| expressed or implied. ++--------------------------------------------------------------------------+ +| This code is based on: +| exit.c,v 1.2 1995/12/19 20:07:36 joel Exp - go32 BSP +| With the following copyright notice: +| ************************************************************************** +| * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994. * +| * On-Line Applications Research Corporation (OAR). * +| * All rights assigned to U.S. Government, 1994. * +| * * +| * This material may be reproduced by or for the U.S. Government pursuant * +| * to the copyright license under the clause at DFARS 252.227-7013. This * +| * notice must appear in all copies of this file and its derivatives. * +| ************************************************************************** ++--------------------------------------------------------------------------*/ + + +#include + +#include + +/*-------------------------------------------------------------------------+ +| External Prototypes ++--------------------------------------------------------------------------*/ +extern rtems_boolean _IBMPC_scankey(char *); /* define in 'inch.c' */ + + +/*-------------------------------------------------------------------------+ +| Function: rtemsReboot +| Description: Reboot the PC. +| Global Variables: None. +| Arguments: None. +| Returns: Nothing. ++--------------------------------------------------------------------------*/ +inline void rtemsReboot(void) +{ + /* shutdown and reboot */ + outport_byte(0x64, 0xFE); /* use keyboard controler to do the job... */ +} /* rtemsReboot */ + + +/*-------------------------------------------------------------------------+ +| Function: _exit +| Description: Shutdown the PC. Called from libc's 'exit'. +| Global Variables: None. +| Arguments: status - exit status (ignored). +| Returns: Nothing. ++--------------------------------------------------------------------------*/ +void _exit(int status) +{ + unsigned char ch; + puts("\nEXECUTIVE SHUTDOWN! Any key to reboot..."); + + while(!_IBMPC_scankey(&ch)) + ; + + rtemsReboot(); +} /* _exit */ diff --git a/c/src/lib/libbsp/i386/pc386/startup/ldsegs.s b/c/src/lib/libbsp/i386/pc386/startup/ldsegs.s new file mode 100644 index 0000000000..507eee92de --- /dev/null +++ b/c/src/lib/libbsp/i386/pc386/startup/ldsegs.s @@ -0,0 +1,205 @@ +/*-------------------------------------------------------------------------+ +| ldsegs.s v1.1 - PC386 BSP - 1997/08/07 ++--------------------------------------------------------------------------+ +| This file assists the board independent startup code by loading the proper +| segment register values. The values loaded are board dependent. In addition +| it contains code to enable the A20 line and to reprogram the PIC to relocate +| the IRQ interrupt vectors to 0x20 -> 0x2f. +| NOTE: No stack has been established when this routine is invoked. +| It returns by jumping back to bspentry. ++--------------------------------------------------------------------------+ +| (C) Copyright 1997 - +| - NavIST Group - Real-Time Distributed Systems and Industrial Automation +| +| http://pandora.ist.utl.pt +| +| Instituto Superior Tecnico * Lisboa * PORTUGAL ++--------------------------------------------------------------------------+ +| Disclaimer: +| +| This file is provided "AS IS" without warranty of any kind, either +| expressed or implied. ++--------------------------------------------------------------------------+ +| This code is base on: +| ldsegs.s,v 1.4 1996/04/20 16:48:30 joel Exp - go32 BSP +| With the following copyright notice: +| ************************************************************************** +| * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994. * +| * On-Line Applications Research Corporation (OAR). * +| * All rights assigned to U.S. Government, 1994. * +| * * +| * This material may be reproduced by or for the U.S. Government pursuant * +| * to the copyright license under the clause at DFARS 252.227-7013. This * +| * notice must appear in all copies of this file and its derivatives. * +| ************************************************************************** +| +| Also based on (from the Linux source tree): +| setup.S - Copyright (C) 1991, 1992 Linus Torvalds ++--------------------------------------------------------------------------*/ + + +#include "asm.h" + +/*----------------------------------------------------------------------------+ +| Constants ++----------------------------------------------------------------------------*/ +.set PROT_DATA_SEG, 0x10 # offset in gdt +.set RESET_SS, PROT_DATA_SEG # initial value of stack segment register +.set RESET_DS, PROT_DATA_SEG # initial value of data segment register +.set RESET_ES, PROT_DATA_SEG # initial value of extra segment register +.set RESET_FS, PROT_DATA_SEG # initial value of "f" segment register +.set RESET_GS, PROT_DATA_SEG # initial value of "g" segment register + + +/*----------------------------------------------------------------------------+ +| Macros ++----------------------------------------------------------------------------*/ +#define LOAD_SEGMENTS(_value, _segment) \ + movw $ ## _value, ax; \ + movw ax, _segment + +/*----------------------------------------------------------------------------+ +| CODE section ++----------------------------------------------------------------------------*/ + +BEGIN_CODE + + EXTERN (establish_stack) + +/*----------------------------------------------------------------------------+ +| empty_8042 ++------------------------------------------------------------------------------ +| This routine checks that the keyboard command queue is empty (after emptying +| the output buffers). +| No timeout is used - if this hangs there is something wrong with the machine, +| and we probably couldn't proceed anyway. ++----------------------------------------------------------------------------*/ +SYM(empty_8042): + call delay + inb $0x64, al # 8042 status port + testb $0x01, al # output buffer? + jz SYM(no_output) + call SYM(delay) + in $0x60, al # read it + jmp SYM(empty_8042) +SYM(no_output): + test $0x02, al # is input buffer full? + jnz SYM(empty_8042) # yes - loop + ret + +/*----------------------------------------------------------------------------+ +| delay ++------------------------------------------------------------------------------ +| Delay is needed after doing I/O. We do it by writing to a non-existent port. ++----------------------------------------------------------------------------*/ +SYM(delay): + outb al, $0xED # about 1uS delay + ret + +/*-------------------------------------------------------------------------+ +| Function: _load_segments +| Description: Load board segment registers with apropriate values + enable + A20 line + reprogram PIC. +| Global Variables: None. +| Arguments: None. +| Returns: Nothing. ++--------------------------------------------------------------------------*/ + PUBLIC (_load_segments) +SYM (_load_segments): + + LOAD_SEGMENTS(RESET_SS, ss) + LOAD_SEGMENTS(RESET_DS, ds) + LOAD_SEGMENTS(RESET_ES, es) + LOAD_SEGMENTS(RESET_FS, fs) + LOAD_SEGMENTS(RESET_GS, gs) + + /*---------------------------------------------------------------------+ + | we have to enable A20 in order to access memory above 1MByte + +---------------------------------------------------------------------*/ + + call SYM(empty_8042) + movb $0xD1, al # command write + outb al, $0x64 + call SYM(empty_8042) + movb $0xDF, al # A20 on + outb al, $0x60 + call SYM(empty_8042) + + /*---------------------------------------------------------------------+ + | Now we have to reprogram the interrupts :-(. We put them right after + | the intel-reserved hardware interrupts, at int 0x20-0x2F. There they + | won't mess up anything. Sadly IBM really messed this up with the + | original PC, and they haven't been able to rectify it afterwards. Thus + | the bios puts interrupts at 0x08-0x0f, which is used for the internal + | hardware interrupts as well. We just have to reprogram the 8259's, and + | it isn't fun. + +---------------------------------------------------------------------*/ + + movb $0x11, al /* initialization sequence */ + outb al, $0x20 /* send it to 8259A-1 */ + call SYM(delay) + outb al, $0xA0 /* and to 8259A-2 */ + call SYM(delay) + + movb $0x20, al /* start of hardware int's (0x20) */ + outb al, $0x21 + call SYM(delay) + movb $0x28, al /* start of hardware int's 2 (0x28) */ + outb al, $0xA1 + call SYM(delay) + + movb $0x04, al /* 8259-1 is master */ + outb al, $0x21 + call SYM(delay) + movb $0x02, al /* 8259-2 is slave */ + outb al, $0xA1 + call SYM(delay) + + movb $0x01, al /* 8086 mode for both */ + outb al, $0x21 + call SYM(delay) + outb al, $0xA1 + call SYM(delay) + + movb $0xFF, al /* mask off all interrupts for now */ + outb al, $0xA1 + call SYM(delay) + movb $0xFB, al /* mask all irq's but irq2 which */ + outb al, $0x21 /* is cascaded */ + call SYM(delay) + + jmp SYM (_establish_stack) # return to the bsp entry code + +/*-------------------------------------------------------------------------+ +| Function: _return_to_monitor +| Description: Return to board's monitor (we have none so simply restart). +| Global Variables: None. +| Arguments: None. +| Returns: Nothing. ++--------------------------------------------------------------------------*/ + PUBLIC (_return_to_monitor) +SYM (_return_to_monitor): + + call SYM (Timer_exit) + call SYM (Clock_exit) + jmp SYM (start) + +END_CODE + +/*----------------------------------------------------------------------------+ +| DATA section ++----------------------------------------------------------------------------*/ + +BEGIN_DATA + + PUBLIC (_Do_Load_IDT) +SYM (_Do_Load_IDT): + .byte 1 # load RTEMS own Interrupt Descriptor Table + + PUBLIC (_Do_Load_GDT) +SYM (_Do_Load_GDT): + .byte 0 # use the Global Descriptor Table that is already defined + +END_DATA + +END diff --git a/c/src/lib/libbsp/i386/pc386/startup/linkcmds b/c/src/lib/libbsp/i386/pc386/startup/linkcmds new file mode 100644 index 0000000000..516d9c3393 --- /dev/null +++ b/c/src/lib/libbsp/i386/pc386/startup/linkcmds @@ -0,0 +1,62 @@ +/*-------------------------------------------------------------------------+ +| linkcmds v1.1 - PC386 BSP - 1997/08/07 ++--------------------------------------------------------------------------+ +| This file contains directives for the GNU linker which are specific to the +| PC386 bsp. ++--------------------------------------------------------------------------+ +| (C) Copyright 1997 - +| - NavIST Group - Real-Time Distributed Systems and Industrial Automation +| +| http://pandora.ist.utl.pt +| +| Instituto Superior Tecnico * Lisboa * PORTUGAL ++--------------------------------------------------------------------------+ +| Disclaimer: +| +| This file is provided "AS IS" without warranty of any kind, either +| expressed or implied. ++--------------------------------------------------------------------------+ +| This code is based on: +| linkcmds,v 1.3 1995/12/19 20:06:58 joel Exp - FORCE CPU386 BSP +| With the following copyright notice: +| ************************************************************************** +| * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994. * +| * On-Line Applications Research Corporation (OAR). * +| * All rights assigned to U.S. Government, 1994. * +| * * +| * This material may be reproduced by or for the U.S. Government pursuant * +| * to the copyright license under the clause at DFARS 252.227-7013. This * +| * notice must appear in all copies of this file and its derivatives. * +| ************************************************************************** ++--------------------------------------------------------------------------*/ + + +SECTIONS +{ + .text : + { + _text_start = . ; + *(.text) + _etext = ALIGN( 0x10 ) ; + } + .rodata ADDR( .text ) + SIZEOF( .text ): + { + _rodata_start = . ; + *(.rodata) + _erodata = ALIGN( 0x10 ) ; + } + .data ADDR( .rodata ) + SIZEOF( .rodata ): + { + _data_start = . ; + *(.data) + _edata = ALIGN( 0x10 ) ; + } + .bss ADDR( .data ) + SIZEOF( .data ): + { + _bss_start = . ; + *(.bss) + *(COMMON) + _end = . ; + __end = . ; + } +} diff --git a/c/src/lib/libbsp/i386/pc386/startup/sbrk.c b/c/src/lib/libbsp/i386/pc386/startup/sbrk.c new file mode 100644 index 0000000000..851f9ed0e6 --- /dev/null +++ b/c/src/lib/libbsp/i386/pc386/startup/sbrk.c @@ -0,0 +1,50 @@ +/*-------------------------------------------------------------------------+ +| sbrk.c v1.1 - PC386 BSP - 1997/08/07 ++--------------------------------------------------------------------------+ +| If the BSP wants to dynamically allocate the memory for the C Library heap +| (malloc) and/or be able to extend the heap, then this routine must be +| functional. RTEMS newlib suppport has an implementation of malloc using +| RTEMS regions => the user can do mallocs. ++--------------------------------------------------------------------------+ +| (C) Copyright 1997 - +| - NavIST Group - Real-Time Distributed Systems and Industrial Automation +| +| http://pandora.ist.utl.pt +| +| Instituto Superior Tecnico * Lisboa * PORTUGAL ++--------------------------------------------------------------------------+ +| Disclaimer: +| +| This file is provided "AS IS" without warranty of any kind, either +| expressed or implied. ++--------------------------------------------------------------------------+ +| This code is based on: +| sbrk.c,v 1.2 1995/12/19 20:07:38 joel Exp - go32 BSP +| With the following copyright notice: +| ************************************************************************** +| * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994. * +| * On-Line Applications Research Corporation (OAR). * +| * All rights assigned to U.S. Government, 1994. * +| * * +| * This material may be reproduced by or for the U.S. Government pursuant * +| * to the copyright license under the clause at DFARS 252.227-7013. This * +| * notice must appear in all copies of this file and its derivatives. * +| ************************************************************************** ++--------------------------------------------------------------------------*/ + + +#include +#include + +/*-------------------------------------------------------------------------+ +| Function: sbrk +| Description: Stub for sbrk. +| Global Variables: None. +| Arguments: Not relevant. +| Returns: Not relevant. ++--------------------------------------------------------------------------*/ +void *sbrk(size_t incr) +{ + errno = EINVAL; + return (void *)NULL; +} /* sbrk */ -- cgit v1.2.3