diff --git a/conts/libc/src/sys-userspace/arch-arm/plat-pb926/sys_fputc.c b/conts/libc/src/sys-userspace/arch-arm/plat-pb926/sys_fputc.c index 1cdc629..3dc2f1d 100644 --- a/conts/libc/src/sys-userspace/arch-arm/plat-pb926/sys_fputc.c +++ b/conts/libc/src/sys-userspace/arch-arm/plat-pb926/sys_fputc.c @@ -80,7 +80,6 @@ #include #include -extern int __fputc(int c, FILE *stream); extern struct pl011_uart uart; /* UART-specific internal error codes */ diff --git a/loader/libs/c/SConscript b/loader/libs/c/SConscript index 4063103..7ff03c1 100644 --- a/loader/libs/c/SConscript +++ b/loader/libs/c/SConscript @@ -16,13 +16,11 @@ from config.configuration import * from config.projpaths import * Import('env', 'arch', 'platform') - variant = 'baremetal' e = env.Clone() - e.Append(CPPPATH = ['include/sys-' + variant + '/arch-' + arch]) -e.Append(CCFLAGS = '-nostdinc') +e.Append(CCFLAGS = ['-nostdinc', ('-D' + platform)]) source = \ Glob('src/*.c') + \ diff --git a/loader/libs/c/SConstruct b/loader/libs/c/SConstruct index 7d07b7b..3a1ecc8 100644 --- a/loader/libs/c/SConstruct +++ b/loader/libs/c/SConstruct @@ -24,7 +24,7 @@ env = Environment(CC = config.kernel_toolchain + 'gcc', PROGSUFFIX = '.elf', # The suffix to use for final executable ENV = {'PATH' : os.environ['PATH']}, # Inherit shell path LIBS = 'gcc', # libgcc.a - This is required for division routines. - CPPPATH = "#include") + CPPFLAGS = []) e = env.Clone() e.Append(CPPPATH = ['include/sys-' + variant + '/arch-' + arch]) diff --git a/loader/libs/c/include/arch/arm/arch/inttypes.h b/loader/libs/c/include/arch/arm/arch/inttypes.h deleted file mode 100644 index 329ca46..0000000 --- a/loader/libs/c/include/arch/arm/arch/inttypes.h +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 National ICT Australia - * - * All rights reserved. - * - * Developed by: Embedded, Real-time and Operating Systems Program (ERTOS) - * National ICT Australia - * http://www.ertos.nicta.com.au - * - * Permission is granted by National ICT Australia, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of National ICT Australia, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on National ICT - * Australia or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of National ICT Australia or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ -/* - Author: Ben Leslie -*/ -#define __LENGTH_8_MOD "hh" -#define __LENGTH_16_MOD "h" -#define __LENGTH_32_MOD -#define __LENGTH_64_MOD "ll" -#define __LENGTH_MAX_MOD "ll" -#define __LENGTH_PTR_MOD diff --git a/loader/libs/c/include/arch/arm/arch/pl011_uart.h b/loader/libs/c/include/arch/arm/arch/pl011_uart.h deleted file mode 100644 index cd2551f..0000000 --- a/loader/libs/c/include/arch/arm/arch/pl011_uart.h +++ /dev/null @@ -1,408 +0,0 @@ - -#ifndef __PL011__UART__H__ -#define __PL011__UART__H__ - -/* - * PL011 UART Generic driver implementation. - * Copyright Bahadir Balban (C) 2006 - * - * The particular intention of this code is that it has been carefully - * written as decoupled from os-specific code and in a verbose way such - * that it clearly demonstrates how the device operates, reducing the - * amount of time to be spent for understanding the operational model - * and implementing a driver from scratch. This is the very first to be - * such a driver so far, hopefully it will turn out to be useful. - */ - -/* Default base address for this chip */ -#define PL011_DEFAULT_PHYSICAL_BASE 0x101F1000 -#define PL011_BASE PL011_DEFAULT_PHYSICAL_BASE - -/* Architecture specific memory access macros */ -#define read(val, address) val = *((volatile unsigned int *) address) -#define write(val, address) *((volatile unsigned int *) address) = val - -/* Register offsets */ -#define PL011_UARTDR (PL011_BASE + 0x00) -#define PL011_UARTRSR (PL011_BASE + 0x04) -#define PL011_UARTECR (PL011_BASE + 0x04) -#define PL011_UARTFR (PL011_BASE + 0x18) -#define PL011_UARTILPR (PL011_BASE + 0x20) -#define PL011_UARTIBRD (PL011_BASE + 0x24) -#define PL011_UARTFBRD (PL011_BASE + 0x28) -#define PL011_UARTLCR_H (PL011_BASE + 0x2C) -#define PL011_UARTCR (PL011_BASE + 0x30) -#define PL011_UARTIFLS (PL011_BASE + 0x34) -#define PL011_UARTIMSC (PL011_BASE + 0x38) -#define PL011_UARTRIS (PL011_BASE + 0x3C) -#define PL011_UARTMIS (PL011_BASE + 0x40) -#define PL011_UARTICR (PL011_BASE + 0x44) -#define PL011_UARTDMACR (PL011_BASE + 0x48) - -/* IRQ bits for each uart irq event */ -#define PL011_RXIRQ (1 << 4) -#define PL011_TXIRQ (1 << 5) -#define PL011_RXTIMEOUTIRQ (1 << 6) -#define PL011_FEIRQ (1 << 7) -#define PL011_PEIRQ (1 << 8) -#define PL011_BEIRQ (1 << 9) -#define PL011_OEIRQ (1 << 10) - -struct pl011_uart; - -int pl011_initialise(struct pl011_uart *); -int pl011_tx_char(char); -int pl011_rx_char(char *); - -void pl011_set_baudrate(unsigned int, unsigned int); -void pl011_set_irq_mask(unsigned int); -void pl011_clr_irq_mask(unsigned int); - -void pl011_irq_handler(struct pl011_uart *); -void pl011_tx_irq_handler(struct pl011_uart *, unsigned int); -void pl011_rx_irq_handler(struct pl011_uart *, unsigned int); -void pl011_error_irq_handler(struct pl011_uart *, unsigned int); - -static inline void pl011_uart_enable(void); -static inline void pl011_uart_disable(void); -static inline void pl011_tx_enable(void); -static inline void pl011_tx_disable(void); -static inline void pl011_rx_enable(void); -static inline void pl011_rx_disable(void); -static inline void pl011_irq_clear(unsigned int flags); -static inline unsigned int pl011_read_irqstat(void); -static inline unsigned int pl011_read_irqmask(void); -static inline void pl011_rx_dma_disable(void); -static inline void pl011_rx_dma_enable(void); -static inline void pl011_tx_dma_enable(void); -static inline void pl011_tx_dma_disable(void); -static inline void pl011_set_irq_fifolevel(unsigned int xfer, - unsigned int level); -static inline void pl011_set_word_width(int size); -static inline void pl011_disable_fifos(void); -static inline void pl011_set_parity_even(void); -static inline void pl011_parity_enable(void); -static inline void pl011_set_stopbits(int stopbits); - -static inline void pl011_set_parity_odd(void); -static inline void pl011_enable_fifos(void); -static inline void pl011_parity_disable(void); - -struct pl011_uart_ops { - int (*initialise)(struct pl011_uart *); - - int (*tx_char)(char); - int (*rx_char)(char *); - - void (*set_baudrate)(unsigned int, unsigned int); - void (*set_irq_mask)(unsigned int); - void (*clr_irq_mask)(unsigned int); - - void (*irq_handler)(struct pl011_uart *); - void (*tx_irq_handler)(struct pl011_uart *, unsigned int); - void (*rx_irq_handler)(struct pl011_uart *, unsigned int); - void (*error_irq_handler)(struct pl011_uart *, unsigned int); -}; - -struct pl011_uart { - const unsigned int base; - struct pl011_uart_ops ops; - unsigned int frame_errors; - unsigned int parity_errors; - unsigned int break_errors; - unsigned int overrun_errors; - unsigned int rx_timeout_errors; -}; - - - -#define PL011_UARTEN (1 << 0) -static inline void pl011_uart_enable() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTCR); - val |= PL011_UARTEN; - write(val, PL011_UARTCR); - - return; -} - -static inline void pl011_uart_disable() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTCR); - val &= ~PL011_UARTEN; - write(val, PL011_UARTCR); - - return; -} - -#define PL011_TXE (1 << 8) -static inline void pl011_tx_enable() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTCR); - val |= PL011_TXE; - write(val, PL011_UARTCR); - return; -} - -static inline void pl011_tx_disable() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTCR); - val &= ~PL011_TXE; - write(val, PL011_UARTCR); - return; -} - - -#define PL011_RXE (1 << 9) -static inline void pl011_rx_enable() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTCR); - val |= PL011_RXE; - write(val, PL011_UARTCR); - return; -} - -static inline void pl011_rx_disable() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTCR); - val &= ~PL011_RXE; - write(val, PL011_UARTCR); - return; -} - -#define PL011_TWO_STOPBITS_SELECT (1 << 3) -static inline void pl011_set_stopbits(int stopbits) -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTLCR_H); - - if(stopbits == 2) { /* Set to two bits */ - val |= PL011_TWO_STOPBITS_SELECT; - } else { /* Default is 1 */ - val &= ~PL011_TWO_STOPBITS_SELECT; - } - write(val, PL011_UARTLCR_H); - return; -} - -#define PL011_PARITY_ENABLE (1 << 1) -static inline void pl011_parity_enable() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTLCR_H); - val |= PL011_PARITY_ENABLE; - write(val, PL011_UARTLCR_H); - return; -} - -static inline void pl011_parity_disable() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTLCR_H); - val &= ~PL011_PARITY_ENABLE; - write(val, PL011_UARTLCR_H); - return; -} - -#define PL011_PARITY_EVEN (1 << 2) -static inline void pl011_set_parity_even() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTLCR_H); - val |= PL011_PARITY_EVEN; - write(val, PL011_UARTLCR_H); - return; -} - -static inline void pl011_set_parity_odd() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTLCR_H); - val &= ~PL011_PARITY_EVEN; - write(val, PL011_UARTLCR_H); - return; -} - -#define PL011_ENABLE_FIFOS (1 << 4) -static inline void pl011_enable_fifos() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTLCR_H); - val |= PL011_ENABLE_FIFOS; - write(val, PL011_UARTLCR_H); - return; -} - -static inline void pl011_disable_fifos() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTLCR_H); - val &= ~PL011_ENABLE_FIFOS; - write(val, PL011_UARTLCR_H); - return; -} - - -#define PL011_WORD_WIDTH_SHIFT (5) -/* Sets the transfer word width for the data register. */ -static inline void pl011_set_word_width(int size) -{ - unsigned int val; - val = 0; - - if(size < 5 || size > 8) /* Default is 8 */ - size = 8; - - /* Clear size field */ - read(val, PL011_UARTLCR_H); - val &= ~(0x3 << PL011_WORD_WIDTH_SHIFT); - write(val, PL011_UARTLCR_H); - - /* The formula is to write 5 less of size given: - * 11 = 8 bits - * 10 = 7 bits - * 01 = 6 bits - * 00 = 5 bits - */ - read(val, PL011_UARTLCR_H); - val |= (size - 5) << PL011_WORD_WIDTH_SHIFT; - write(val, PL011_UARTLCR_H); - - return; -} - -/* - * Defines at which level of fifo fullness an irq will be generated. - * @xfer: tx fifo = 0, rx fifo = 1 - * @level: Generate irq if: - * 0 rxfifo >= 1/8 full txfifo <= 1/8 full - * 1 rxfifo >= 1/4 full txfifo <= 1/4 full - * 2 rxfifo >= 1/2 full txfifo <= 1/2 full - * 3 rxfifo >= 3/4 full txfifo <= 3/4 full - * 4 rxfifo >= 7/8 full txfifo <= 7/8 full - * 5-7 reserved reserved - */ -static inline void pl011_set_irq_fifolevel(unsigned int xfer, unsigned int level) -{ - if(xfer != 1 && xfer != 0) /* Invalid fifo */ - return; - - if(level > 4) /* Invalid level */ - return; - - write(level << (xfer * 3), PL011_UARTIFLS); - return; -} - -/* returns which irqs are masked */ -static inline unsigned int pl011_read_irqmask(void) -{ - unsigned int flags; - read(flags, PL011_UARTIMSC); - return flags; -} - -/* returns masked irq status */ -static inline unsigned int pl011_read_irqstat(void) -{ - unsigned int irqstatus; - read(irqstatus, PL011_UARTMIS); - return irqstatus; -} -/* Clears the given asserted irqs */ -static inline void pl011_irq_clear(unsigned int flags) -{ - if(flags > 0x3FF) { /* Invalid irq clearing bitvector */ - return; - } - /* Simply write the flags since it's a write-only register */ - write(flags, PL011_UARTICR); - return; -} - -#define PL011_TXDMAEN (1 << 1) -#define PL011_RXDMAEN (1 << 0) - -/* Enables dma transfers for uart. The dma controller - * must be initialised, set-up and enabled separately. - */ -static inline void pl011_tx_dma_enable() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTDMACR); - val |= PL011_TXDMAEN; - write(val, PL011_UARTDMACR); - return; -} - -/* Disables dma transfers for uart */ -static inline void pl011_tx_dma_disable() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTDMACR); - val &= ~PL011_TXDMAEN; - write(val, PL011_UARTDMACR); - return; -} - -static inline void pl011_rx_dma_enable() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTDMACR); - val |= PL011_RXDMAEN; - write(val, PL011_UARTDMACR); - return; -} - -static inline void pl011_rx_dma_disable() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTDMACR); - val &= ~PL011_RXDMAEN; - write(val, PL011_UARTDMACR); - return; -} - - -#endif /* __PL011__UART__ */ - diff --git a/loader/libs/c/include/arch/arm/arch/setjmp.h b/loader/libs/c/include/arch/arm/arch/setjmp.h deleted file mode 100644 index 22a17cd..0000000 --- a/loader/libs/c/include/arch/arm/arch/setjmp.h +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 National ICT Australia - * - * All rights reserved. - * - * Developed by: Embedded, Real-time and Operating Systems Program (ERTOS) - * National ICT Australia - * http://www.ertos.nicta.com.au - * - * Permission is granted by National ICT Australia, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of National ICT Australia, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on National ICT - * Australia or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of National ICT Australia or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ -/* - Author: Alex Webster -*/ - -typedef int jmp_buf[10]; diff --git a/loader/libs/c/include/arch/arm/arch/stdint.h b/loader/libs/c/include/arch/arm/arch/stdint.h deleted file mode 100644 index 6078b0a..0000000 --- a/loader/libs/c/include/arch/arm/arch/stdint.h +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 National ICT Australia - * - * All rights reserved. - * - * Developed by: Embedded, Real-time and Operating Systems Program (ERTOS) - * National ICT Australia - * http://www.ertos.nicta.com.au - * - * Permission is granted by National ICT Australia, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of National ICT Australia, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on National ICT - * Australia or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of National ICT Australia or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ -/* - Author: Ben Leslie -*/ -typedef signed char int8_t; -typedef short int16_t; -typedef int int32_t; -typedef long long int64_t; - -typedef unsigned char uint8_t; -typedef unsigned short uint16_t; -typedef unsigned int uint32_t; -typedef unsigned long long uint64_t; - -#define __PTR_SIZE 32 diff --git a/loader/libs/c/include/arch/pl011_uart.h b/loader/libs/c/include/arch/pl011_uart.h index cd2551f..f3a44e6 100644 --- a/loader/libs/c/include/arch/pl011_uart.h +++ b/loader/libs/c/include/arch/pl011_uart.h @@ -2,42 +2,42 @@ #ifndef __PL011__UART__H__ #define __PL011__UART__H__ -/* +/* * PL011 UART Generic driver implementation. * Copyright Bahadir Balban (C) 2006 * - * The particular intention of this code is that it has been carefully + * The particular intention of this code is that it has been carefully * written as decoupled from os-specific code and in a verbose way such - * that it clearly demonstrates how the device operates, reducing the - * amount of time to be spent for understanding the operational model + * that it clearly demonstrates how the device operates, reducing the + * amount of time to be spent for understanding the operational model * and implementing a driver from scratch. This is the very first to be * such a driver so far, hopefully it will turn out to be useful. */ -/* Default base address for this chip */ +/* FIXME: Select based on arch */ #define PL011_DEFAULT_PHYSICAL_BASE 0x101F1000 -#define PL011_BASE PL011_DEFAULT_PHYSICAL_BASE +#define PL011_BASE PL011_DEFAULT_PHYSICAL_BASE /* Architecture specific memory access macros */ #define read(val, address) val = *((volatile unsigned int *) address) #define write(val, address) *((volatile unsigned int *) address) = val /* Register offsets */ -#define PL011_UARTDR (PL011_BASE + 0x00) -#define PL011_UARTRSR (PL011_BASE + 0x04) -#define PL011_UARTECR (PL011_BASE + 0x04) -#define PL011_UARTFR (PL011_BASE + 0x18) -#define PL011_UARTILPR (PL011_BASE + 0x20) -#define PL011_UARTIBRD (PL011_BASE + 0x24) -#define PL011_UARTFBRD (PL011_BASE + 0x28) -#define PL011_UARTLCR_H (PL011_BASE + 0x2C) -#define PL011_UARTCR (PL011_BASE + 0x30) -#define PL011_UARTIFLS (PL011_BASE + 0x34) -#define PL011_UARTIMSC (PL011_BASE + 0x38) -#define PL011_UARTRIS (PL011_BASE + 0x3C) -#define PL011_UARTMIS (PL011_BASE + 0x40) -#define PL011_UARTICR (PL011_BASE + 0x44) -#define PL011_UARTDMACR (PL011_BASE + 0x48) +#define PL011_UARTDR 0x00 +#define PL011_UARTRSR 0x04 +#define PL011_UARTECR 0x04 +#define PL011_UARTFR 0x18 +#define PL011_UARTILPR 0x20 +#define PL011_UARTIBRD 0x24 +#define PL011_UARTFBRD 0x28 +#define PL011_UARTLCR_H 0x2C +#define PL011_UARTCR 0x30 +#define PL011_UARTIFLS 0x34 +#define PL011_UARTIMSC 0x38 +#define PL011_UARTRIS 0x3C +#define PL011_UARTMIS 0x40 +#define PL011_UARTICR 0x44 +#define PL011_UARTDMACR 0x48 /* IRQ bits for each uart irq event */ #define PL011_RXIRQ (1 << 4) @@ -48,262 +48,228 @@ #define PL011_BEIRQ (1 << 9) #define PL011_OEIRQ (1 << 10) +/* FIXME: Need to define this somewhere else */ struct pl011_uart; -int pl011_initialise(struct pl011_uart *); -int pl011_tx_char(char); -int pl011_rx_char(char *); +int pl011_initialise(struct pl011_uart *uart); +int pl011_tx_char(unsigned int base, char c); +int pl011_rx_char(unsigned int base, char *c); + +void pl011_set_baudrate(unsigned int base, unsigned int baud, + unsigned int clkrate); +void pl011_set_irq_mask(unsigned int base, unsigned int flags); +void pl011_clr_irq_mask(unsigned int base, unsigned int flags); -void pl011_set_baudrate(unsigned int, unsigned int); -void pl011_set_irq_mask(unsigned int); -void pl011_clr_irq_mask(unsigned int); - void pl011_irq_handler(struct pl011_uart *); -void pl011_tx_irq_handler(struct pl011_uart *, unsigned int); -void pl011_rx_irq_handler(struct pl011_uart *, unsigned int); -void pl011_error_irq_handler(struct pl011_uart *, unsigned int); +void pl011_tx_irq_handler(struct pl011_uart *uart, unsigned int); +void pl011_rx_irq_handler(struct pl011_uart *uart, unsigned int); +void pl011_error_irq_handler(struct pl011_uart *uart, unsigned int); -static inline void pl011_uart_enable(void); -static inline void pl011_uart_disable(void); -static inline void pl011_tx_enable(void); -static inline void pl011_tx_disable(void); -static inline void pl011_rx_enable(void); -static inline void pl011_rx_disable(void); -static inline void pl011_irq_clear(unsigned int flags); -static inline unsigned int pl011_read_irqstat(void); -static inline unsigned int pl011_read_irqmask(void); -static inline void pl011_rx_dma_disable(void); -static inline void pl011_rx_dma_enable(void); -static inline void pl011_tx_dma_enable(void); -static inline void pl011_tx_dma_disable(void); -static inline void pl011_set_irq_fifolevel(unsigned int xfer, - unsigned int level); -static inline void pl011_set_word_width(int size); -static inline void pl011_disable_fifos(void); -static inline void pl011_set_parity_even(void); -static inline void pl011_parity_enable(void); -static inline void pl011_set_stopbits(int stopbits); +static inline void pl011_uart_enable(unsigned int base); +static inline void pl011_uart_disable(unsigned int base); +static inline void pl011_tx_enable(unsigned int base); +static inline void pl011_tx_disable(unsigned int base); +static inline void pl011_rx_enable(unsigned int base); +static inline void pl011_rx_disable(unsigned int base); +static inline void pl011_irq_clear(unsigned int base, unsigned int flags); +static inline unsigned int pl011_read_irqstat(unsigned int base); +static inline unsigned int pl011_read_irqmask(unsigned int base); +static inline void pl011_rx_dma_disable(unsigned int base); +static inline void pl011_rx_dma_enable(unsigned int base); +static inline void pl011_tx_dma_enable(unsigned int base); +static inline void pl011_tx_dma_disable(unsigned int base); +static inline void pl011_set_irq_fifolevel(unsigned int base, + unsigned int xfer, unsigned int level); +static inline void pl011_set_word_width(unsigned int base, int size); +static inline void pl011_disable_fifos(unsigned int base); +static inline void pl011_set_parity_even(unsigned int base); +static inline void pl011_parity_enable(unsigned int base); +static inline void pl011_set_stopbits(unsigned int base, int stopbits); -static inline void pl011_set_parity_odd(void); -static inline void pl011_enable_fifos(void); -static inline void pl011_parity_disable(void); - -struct pl011_uart_ops { - int (*initialise)(struct pl011_uart *); - - int (*tx_char)(char); - int (*rx_char)(char *); - - void (*set_baudrate)(unsigned int, unsigned int); - void (*set_irq_mask)(unsigned int); - void (*clr_irq_mask)(unsigned int); - - void (*irq_handler)(struct pl011_uart *); - void (*tx_irq_handler)(struct pl011_uart *, unsigned int); - void (*rx_irq_handler)(struct pl011_uart *, unsigned int); - void (*error_irq_handler)(struct pl011_uart *, unsigned int); -}; +static inline void pl011_set_parity_odd(unsigned int base); +static inline void pl011_enable_fifos(unsigned int base); +static inline void pl011_parity_disable(unsigned int base); struct pl011_uart { - const unsigned int base; - struct pl011_uart_ops ops; + unsigned int base; unsigned int frame_errors; unsigned int parity_errors; unsigned int break_errors; unsigned int overrun_errors; unsigned int rx_timeout_errors; -}; - - +}; #define PL011_UARTEN (1 << 0) -static inline void pl011_uart_enable() +static inline void pl011_uart_enable(unsigned int base) { - unsigned int val; - val = 0; - - read(val, PL011_UARTCR); + unsigned int val = 0; + + read(val, (base + PL011_UARTCR)); val |= PL011_UARTEN; - write(val, PL011_UARTCR); - - return; + write(val, (base + PL011_UARTCR)); + + return; } -static inline void pl011_uart_disable() +static inline void pl011_uart_disable(unsigned int base) { - unsigned int val; - val = 0; - - read(val, PL011_UARTCR); + unsigned int val = 0; + + read(val, (base + PL011_UARTCR)); val &= ~PL011_UARTEN; - write(val, PL011_UARTCR); - + write(val, (base + PL011_UARTCR)); + return; } #define PL011_TXE (1 << 8) -static inline void pl011_tx_enable() +static inline void pl011_tx_enable(unsigned int base) { - unsigned int val; - val = 0; - - read(val, PL011_UARTCR); + unsigned int val = 0; + + read(val, (base + PL011_UARTCR)); val |= PL011_TXE; - write(val, PL011_UARTCR); + write(val, (base + PL011_UARTCR)); return; } -static inline void pl011_tx_disable() +static inline void pl011_tx_disable(unsigned int base) { - unsigned int val; - val = 0; - - read(val, PL011_UARTCR); + unsigned int val = 0; + + read(val, (base + PL011_UARTCR)); val &= ~PL011_TXE; - write(val, PL011_UARTCR); + write(val, (base + PL011_UARTCR)); return; } - #define PL011_RXE (1 << 9) -static inline void pl011_rx_enable() +static inline void pl011_rx_enable(unsigned int base) { - unsigned int val; - val = 0; - - read(val, PL011_UARTCR); + unsigned int val = 0; + + read(val, (base + PL011_UARTCR)); val |= PL011_RXE; - write(val, PL011_UARTCR); + write(val, (base + PL011_UARTCR)); return; } -static inline void pl011_rx_disable() +static inline void pl011_rx_disable(unsigned int base) { - unsigned int val; - val = 0; - - read(val, PL011_UARTCR); + unsigned int val = 0; + + read(val, (base + PL011_UARTCR)); val &= ~PL011_RXE; - write(val, PL011_UARTCR); + write(val, (base + PL011_UARTCR)); return; } #define PL011_TWO_STOPBITS_SELECT (1 << 3) -static inline void pl011_set_stopbits(int stopbits) +static inline void pl011_set_stopbits(unsigned int base, int stopbits) { - unsigned int val; - val = 0; - - read(val, PL011_UARTLCR_H); - + unsigned int val = 0; + read(val, (base + PL011_UARTLCR_H)); + if(stopbits == 2) { /* Set to two bits */ val |= PL011_TWO_STOPBITS_SELECT; } else { /* Default is 1 */ val &= ~PL011_TWO_STOPBITS_SELECT; } - write(val, PL011_UARTLCR_H); - return; -} - -#define PL011_PARITY_ENABLE (1 << 1) -static inline void pl011_parity_enable() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTLCR_H); - val |= PL011_PARITY_ENABLE; - write(val, PL011_UARTLCR_H); + write(val, (base + PL011_UARTLCR_H)); return; } -static inline void pl011_parity_disable() +#define PL011_PARITY_ENABLE (1 << 1) +static inline void pl011_parity_enable(unsigned int base) { - unsigned int val; - val = 0; - - read(val, PL011_UARTLCR_H); + unsigned int val = 0; + + read(val, (base +PL011_UARTLCR_H)); + val |= PL011_PARITY_ENABLE; + write(val, (base + PL011_UARTLCR_H)); + return; +} + +static inline void pl011_parity_disable(unsigned int base) +{ + unsigned int val = 0; + + read(val, (base + PL011_UARTLCR_H)); val &= ~PL011_PARITY_ENABLE; - write(val, PL011_UARTLCR_H); + write(val, (base + PL011_UARTLCR_H)); return; } #define PL011_PARITY_EVEN (1 << 2) -static inline void pl011_set_parity_even() +static inline void pl011_set_parity_even(unsigned int base) { - unsigned int val; - val = 0; - - read(val, PL011_UARTLCR_H); + unsigned int val = 0; + + read(val, (base + PL011_UARTLCR_H)); val |= PL011_PARITY_EVEN; - write(val, PL011_UARTLCR_H); + write(val, (base + PL011_UARTLCR_H)); return; } -static inline void pl011_set_parity_odd() +static inline void pl011_set_parity_odd(unsigned int base) { - unsigned int val; - val = 0; - - read(val, PL011_UARTLCR_H); + unsigned int val = 0; + + read(val, (base + PL011_UARTLCR_H)); val &= ~PL011_PARITY_EVEN; - write(val, PL011_UARTLCR_H); + write(val, (base + PL011_UARTLCR_H)); return; } #define PL011_ENABLE_FIFOS (1 << 4) -static inline void pl011_enable_fifos() +static inline void pl011_enable_fifos(unsigned int base) { - unsigned int val; - val = 0; - - read(val, PL011_UARTLCR_H); + unsigned int val = 0; + + read(val, (base + PL011_UARTLCR_H)); val |= PL011_ENABLE_FIFOS; - write(val, PL011_UARTLCR_H); + write(val, (base + PL011_UARTLCR_H)); return; } -static inline void pl011_disable_fifos() +static inline void pl011_disable_fifos(unsigned int base) { - unsigned int val; - val = 0; - - read(val, PL011_UARTLCR_H); + unsigned int val = 0; + + read(val, (base + PL011_UARTLCR_H)); val &= ~PL011_ENABLE_FIFOS; - write(val, PL011_UARTLCR_H); + write(val, (base + PL011_UARTLCR_H)); return; } - #define PL011_WORD_WIDTH_SHIFT (5) /* Sets the transfer word width for the data register. */ -static inline void pl011_set_word_width(int size) +static inline void pl011_set_word_width(unsigned int base, int size) { - unsigned int val; - val = 0; - + unsigned int val = 0; if(size < 5 || size > 8) /* Default is 8 */ size = 8; - - /* Clear size field */ - read(val, PL011_UARTLCR_H); - val &= ~(0x3 << PL011_WORD_WIDTH_SHIFT); - write(val, PL011_UARTLCR_H); - /* The formula is to write 5 less of size given: + /* Clear size field */ + read(val, (base + PL011_UARTLCR_H)); + val &= ~(0x3 << PL011_WORD_WIDTH_SHIFT); + write(val, (base + PL011_UARTLCR_H)); + + /* + * The formula is to write 5 less of size given: * 11 = 8 bits * 10 = 7 bits * 01 = 6 bits * 00 = 5 bits */ - read(val, PL011_UARTLCR_H); + read(val, (base + PL011_UARTLCR_H)); val |= (size - 5) << PL011_WORD_WIDTH_SHIFT; - write(val, PL011_UARTLCR_H); - + write(val, (base + PL011_UARTLCR_H)); + return; } -/* +/* * Defines at which level of fifo fullness an irq will be generated. * @xfer: tx fifo = 0, rx fifo = 1 * @level: Generate irq if: @@ -314,95 +280,92 @@ static inline void pl011_set_word_width(int size) * 4 rxfifo >= 7/8 full txfifo <= 7/8 full * 5-7 reserved reserved */ -static inline void pl011_set_irq_fifolevel(unsigned int xfer, unsigned int level) +static inline void pl011_set_irq_fifolevel(unsigned int base, \ + unsigned int xfer, unsigned int level) { if(xfer != 1 && xfer != 0) /* Invalid fifo */ return; - if(level > 4) /* Invalid level */ - return; - - write(level << (xfer * 3), PL011_UARTIFLS); + return; + + write(level << (xfer * 3), (base + PL011_UARTIFLS)); return; } /* returns which irqs are masked */ -static inline unsigned int pl011_read_irqmask(void) +static inline unsigned int pl011_read_irqmask(unsigned int base) { unsigned int flags; - read(flags, PL011_UARTIMSC); + read(flags, (base + PL011_UARTIMSC)); return flags; } /* returns masked irq status */ -static inline unsigned int pl011_read_irqstat(void) +static inline unsigned int pl011_read_irqstat(unsigned int base) { unsigned int irqstatus; - read(irqstatus, PL011_UARTMIS); - return irqstatus; + read(irqstatus, (base + PL011_UARTMIS)); + return irqstatus; } + /* Clears the given asserted irqs */ -static inline void pl011_irq_clear(unsigned int flags) +static inline void pl011_irq_clear(unsigned int base, unsigned int flags) { - if(flags > 0x3FF) { /* Invalid irq clearing bitvector */ + if(flags > 0x3FF) { + /* Invalid irq clearing bitvector */ return; } /* Simply write the flags since it's a write-only register */ - write(flags, PL011_UARTICR); + write(flags, (base + PL011_UARTICR)); return; } #define PL011_TXDMAEN (1 << 1) #define PL011_RXDMAEN (1 << 0) - -/* Enables dma transfers for uart. The dma controller - * must be initialised, set-up and enabled separately. +/* + * Enables dma transfers for uart. The dma controller + * must be initialised, set-up and enabled separately. */ -static inline void pl011_tx_dma_enable() +static inline void pl011_tx_dma_enable(unsigned int base) { - unsigned int val; - val = 0; - - read(val, PL011_UARTDMACR); + unsigned int val = 0; + + read(val, (base + PL011_UARTDMACR)); val |= PL011_TXDMAEN; - write(val, PL011_UARTDMACR); + write(val, (base + PL011_UARTDMACR)); return; } /* Disables dma transfers for uart */ -static inline void pl011_tx_dma_disable() +static inline void pl011_tx_dma_disable(unsigned int base) { - unsigned int val; - val = 0; - - read(val, PL011_UARTDMACR); + unsigned int val = 0; + + read(val, (base + PL011_UARTDMACR)); val &= ~PL011_TXDMAEN; - write(val, PL011_UARTDMACR); + write(val, (base + PL011_UARTDMACR)); return; } -static inline void pl011_rx_dma_enable() +static inline void pl011_rx_dma_enable(unsigned int base) { - unsigned int val; - val = 0; - - read(val, PL011_UARTDMACR); + unsigned int val = 0; + + read(val, (base + PL011_UARTDMACR)); val |= PL011_RXDMAEN; - write(val, PL011_UARTDMACR); + write(val, (base + PL011_UARTDMACR)); return; } -static inline void pl011_rx_dma_disable() +static inline void pl011_rx_dma_disable(unsigned int base) { - unsigned int val; - val = 0; - - read(val, PL011_UARTDMACR); + unsigned int val = 0; + + read(val, (base + PL011_UARTDMACR)); val &= ~PL011_RXDMAEN; - write(val, PL011_UARTDMACR); + write(val, (base +PL011_UARTDMACR)); return; } - #endif /* __PL011__UART__ */ diff --git a/loader/libs/c/include/arch/setjmp.h b/loader/libs/c/include/arch/setjmp.h deleted file mode 100644 index 22a17cd..0000000 --- a/loader/libs/c/include/arch/setjmp.h +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 National ICT Australia - * - * All rights reserved. - * - * Developed by: Embedded, Real-time and Operating Systems Program (ERTOS) - * National ICT Australia - * http://www.ertos.nicta.com.au - * - * Permission is granted by National ICT Australia, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of National ICT Australia, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on National ICT - * Australia or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of National ICT Australia or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ -/* - Author: Alex Webster -*/ - -typedef int jmp_buf[10]; diff --git a/loader/libs/c/include/complex.h b/loader/libs/c/include/complex.h deleted file mode 100644 index 36734ca..0000000 --- a/loader/libs/c/include/complex.h +++ /dev/null @@ -1,212 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 National ICT Australia - * - * All rights reserved. - * - * Developed by: Embedded, Real-time and Operating Systems Program (ERTOS) - * National ICT Australia - * http://www.ertos.nicta.com.au - * - * Permission is granted by National ICT Australia, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of National ICT Australia, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on National ICT - * Australia or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of National ICT Australia or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ - -/* - Authors: Ben Leslie - Description: - Complex arithmetic as per 7.3 - Status: Functions defined, not implemented -*/ - -#error The complex library is incomplete - -#define complex _Complex -#define _Complex_I (const float _Complex) foo - -#define I _Complex_I - -/* 7.3.5 Trigonometric functions */ - -/* 7.3.5.1 cacos */ -double complex cacos(double complex z); -float complex cacosf(float complex z); -long double complex cacosl(long double complex z); - -/* 7.3.5.2 casin */ -double complex casin(double complex z); -float complex casinf(float complex z); -long double complex casinl(long double complex z); - -/* 7.3.5.3 catan */ -double complex catan(double complex z); -float complex catanf(float complex z); -long double complex catanl(long double complex z); - -/* 7.3.5.4 ccos */ -double complex ccos(double complex z); -float complex ccosf(float complex z); -long double complex ccosl(long double complex z); - -/* 7.3.5.5 csin */ -double complex csin(double complex z); -float complex csinf(float complex z); -long double complex csinl(long double complex z); - -/* 7.3.5.6 ctan */ -double complex ctan(double complex z); -float complex ctanf(float complex z); -long double complex ctanl(long double complex z); - -/* 7.3.6 Hyperbolic functions */ - -/* 7.3.6.1 cacosh */ -double complex cacosh(double complex z); -float complex cacoshf(float complex z); -long double complex cacoshf(long double complex z); - -/* 7.3.6.2 casinh */ -double complex casinh(double complex z); -float complex casinhf(float complex z); -long double complex casinhl(long double complex z); - -/* 7.3.6.3 catanh */ -double complex catanh(double complex z); -float complex catanhf(float complex z); -long double complex catanhl(long double complex z); - -/* 7.3.6.4 ccosh */ -double complex ccosh(double complex z); -float complex ccoshf(float complex z); -long double complex ccoshl(long double complex z); - -/* 7.3.6.5 csinh */ -double complex csinh(double complex z); -float complex csinhf(float complex z); -long double complex csinhl(long double complex z); - -/* 7.3.6.6 ctanh */ -double complex ctanh(double complex z); -float complex ctanhl(float complex z); -long double complex ctanhl(long double complex z); - -/* 7.3.7 Exponential and logarithmic functions */ - -/* 7.3.7.1 cexp */ -double complex cexp(double complex z); -float complex cexpf(float complex z); -long double complex cexpl(long double complex z); - -/* 7.3.7.2 clog */ -double complex clog(double complex z); -float complex clogf(float complex z); -long double complex clogl(long double complex z); - -/* 7.3.8 Power and absolute value functions */ - -/* 7.3.8.1 cabs */ -double complex cabs(double complex z); -float complex cabsf(float complex z); -long double complex cabsl(long double complex z); - -/* 7.3.8.2 cpow */ -double complex cpow(double complex z); -float complex cpowf(float complex z); -long double complex cpowl(long double complex z); - -/* 7.3.8.3 csqrt */ -double complex csqrt(double complex z); -float complex csqrtf(float complex z); -long double complex csqrtl(long double complex z); - -/* 7.3.9 Manipulation functions */ - -/* 7.3.9.1 carg */ -double complex carg(double complex z); -float complex cargf(float complex z); -long double complex cargl(long double complex z); - -/* 7.3.9.2 cimag */ -double complex cimag(double complex z); -float complex cimagf(float complex z); -long double complex cimagl(long double complex z); - -/* 7.3.9.3 conj */ -double complex conj(double complex z); -float complex conjf(float complex z); -long double complex conjl(long double complex z); - -/* 7.3.9.4 cproj */ -double complex cproj(double complex z); -float complex cprojf(float complex z); -long double complex cprojl(long double complex z); - -/* 7.3.9.5 creal */ -double complex creal(double complex z); -float complex crealf(float complex z); -long double complex creall(long double complex z); diff --git a/loader/libs/c/include/ctype.h b/loader/libs/c/include/ctype.h deleted file mode 100644 index 817d9d9..0000000 --- a/loader/libs/c/include/ctype.h +++ /dev/null @@ -1,204 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 National ICT Australia - * - * All rights reserved. - * - * Developed by: Embedded, Real-time and Operating Systems Program (ERTOS) - * National ICT Australia - * http://www.ertos.nicta.com.au - * - * Permission is granted by National ICT Australia, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of National ICT Australia, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on National ICT - * Australia or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of National ICT Australia or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ - -/* - Authors: Cristan Szmadja, Ben Leslie - Description: - Implements character handling as per 7.4 - Status: Incomplete - Ignores locale -*/ - -#ifndef _CTYPE_H_ -#define _CTYPE_H_ - -static inline int -iscntrl(int c) -{ - return (0 <= c && c <= '\037') || c == '\177'; -} - -static inline int -isgraph(int c) -{ - return ' ' < c && c < '\177'; -} - -static inline int -isprint(int c) -{ - return ' ' <= c && c < '\177'; -} - -static inline int -isdigit(int c) -{ - return '0' <= c && c <= '9'; -} - -static inline int -islower(int c) -{ - return 'a' <= c && c <= 'z'; -} - -static inline int -isspace(int c) -{ - return c == ' ' || ('\011' <= c && c <= '\015'); -} - -static inline int -isupper(int c) -{ - return 'A' <= c && c <= 'Z'; -} - -static inline int -isalpha(int c) -{ - return isupper(c) || islower(c); -} - -static inline int -isalnum(int c) -{ - return isalpha(c) || isdigit(c); -} - -static inline int -ispunct(int c) -{ - return isgraph(c) && !isalnum(c); -} - -static inline int -isxdigit(int c) -{ - return isdigit(c) || ('A' <= c && c <= 'F') || ('a' <= c && c <= 'f'); -} - -static inline int -tolower(int c) -{ - return isupper(c) ? c + ('a' - 'A') : c; -} - -static inline int -toupper(int c) -{ - return islower(c) ? c - ('a' - 'A') : c; -} - -static inline int -isascii(int c) -{ - return 0 <= c && c <= '\177'; -} - -static inline int -toascii(int c) -{ - return c & 0177; -} - -static inline int -digittoint(int c) -{ - return isdigit(c) ? c - '0' : 'A' <= c - && c <= 'Z' ? c - 'A' : 'a' <= c && c <= 'z' ? c - 'a' : 99; -} - -#endif /* !_CTYPE_H_ */ - -/* XXX: Extra things needed by POSIX... need to find a correct #ifndef */ - -/* - -int isascii(int); -int toascii(int); - -#define _toupper(x) -#define _tolower(x) - - -*/ - - - diff --git a/loader/libs/c/include/errno.h b/loader/libs/c/include/errno.h deleted file mode 100644 index 4b4db9a..0000000 --- a/loader/libs/c/include/errno.h +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 National ICT Australia - * - * All rights reserved. - * - * Developed by: Embedded, Real-time and Operating Systems Program (ERTOS) - * National ICT Australia - * http://www.ertos.nicta.com.au - * - * Permission is granted by National ICT Australia, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of National ICT Australia, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on National ICT - * Australia or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of National ICT Australia or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ - -/* - Authors: Ben Leslie - Description: - Errors as per 7.5 - Status: Complete - Restrictions: Single threaded -*/ - -#ifndef _ERRNO_H_ -#define _ERRNO_H_ - -#define EDOM 1 -#define EILSEQ 2 -#define ERANGE 3 - -#include - -#ifndef THREAD_SAFE -extern int errno; -#else -#define errno (*((int *)__L4_TCR_ThreadLocalStorage())) -#endif - -#endif /* _ERRNO_H_ */ - diff --git a/loader/libs/c/include/iso646.h b/loader/libs/c/include/iso646.h deleted file mode 100644 index a1a4d9f..0000000 --- a/loader/libs/c/include/iso646.h +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 National ICT Australia - * - * All rights reserved. - * - * Developed by: Embedded, Real-time and Operating Systems Program (ERTOS) - * National ICT Australia - * http://www.ertos.nicta.com.au - * - * Permission is granted by National ICT Australia, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of National ICT Australia, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on National ICT - * Australia or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of National ICT Australia or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ - -/* - Authors: Ben Leslie - Description: - Alternative spellings as per 7.9 -*/ - -#ifndef _ISO646_H_ -#define _ISO646_H_ - -#define and && -#define and_q &= -#define bitand & -#define bitor | -#define compl ~ -#define not ! -#define not_eq != -#define or || -#define or_eq |= -#define xor ^ -#define xor_eq ^= - -#endif /* _ISO646_H_ */ diff --git a/loader/libs/c/include/locale.h b/loader/libs/c/include/locale.h deleted file mode 100644 index 9ceaeb6..0000000 --- a/loader/libs/c/include/locale.h +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 National ICT Australia - * - * All rights reserved. - * - * Developed by: Embedded, Real-time and Operating Systems Program (ERTOS) - * National ICT Australia - * http://www.ertos.nicta.com.au - * - * Permission is granted by National ICT Australia, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of National ICT Australia, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on National ICT - * Australia or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of National ICT Australia or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ - -#include - -struct lconv { - char *decimal_point; - char *thousands_sep; - char *grouping; - char *mon_deciaml_point; - char *mon_thouasands_sep; - char *mon_grouping; - char *positive_sign; - char *negative_sign; - char *currency_symbol; - char frac_digits; - char p_cs_precedes; - char n_cs_precedes; - char p_sep_by_space; - char n_sep_by_space; - char p_sign_posn; - char n_sign_posn; - char *int_curr_symbol; - char int_frac_digits; - char int_p_cs_precedes; - char int_n_cs_precedes; - char int_p_sep_by_space; - char int_n_sep_by_space; - char int_p_sign_posn; - char int_n_sign_posn; -}; - -#define LC_ALL 1 -#define LC_COLLATE 2 -#define LC_CTYPE 3 -#define LC_MONETARY 4 -#define LC_NUMERIC 5 -#define LC_TIME 6 - -char *setlocale(int category, const char *locale); -struct lconv *localeconv(void); diff --git a/loader/libs/c/include/setjmp.h b/loader/libs/c/include/setjmp.h deleted file mode 100644 index ea5790a..0000000 --- a/loader/libs/c/include/setjmp.h +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 National ICT Australia - * - * All rights reserved. - * - * Developed by: Embedded, Real-time and Operating Systems Program (ERTOS) - * National ICT Australia - * http://www.ertos.nicta.com.au - * - * Permission is granted by National ICT Australia, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of National ICT Australia, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on National ICT - * Australia or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of National ICT Australia or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ -/* - Author: Ben Leslie, Alex Webster -*/ -#ifndef _SETJMP_H_ -#define _SETJMP_H_ - -#include - -int setjmp(jmp_buf); -void longjmp(jmp_buf, int); - -#endif /* _SETJMP_H_ */ diff --git a/loader/libs/c/include/sys-baremetal/arch-arm/arch/inttypes.h b/loader/libs/c/include/sys-baremetal/arch-arm/arch/inttypes.h deleted file mode 100644 index 329ca46..0000000 --- a/loader/libs/c/include/sys-baremetal/arch-arm/arch/inttypes.h +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 National ICT Australia - * - * All rights reserved. - * - * Developed by: Embedded, Real-time and Operating Systems Program (ERTOS) - * National ICT Australia - * http://www.ertos.nicta.com.au - * - * Permission is granted by National ICT Australia, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of National ICT Australia, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on National ICT - * Australia or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of National ICT Australia or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ -/* - Author: Ben Leslie -*/ -#define __LENGTH_8_MOD "hh" -#define __LENGTH_16_MOD "h" -#define __LENGTH_32_MOD -#define __LENGTH_64_MOD "ll" -#define __LENGTH_MAX_MOD "ll" -#define __LENGTH_PTR_MOD diff --git a/loader/libs/c/include/sys-baremetal/arch-arm/arch/pl011_uart.h b/loader/libs/c/include/sys-baremetal/arch-arm/arch/pl011_uart.h deleted file mode 100644 index cd2551f..0000000 --- a/loader/libs/c/include/sys-baremetal/arch-arm/arch/pl011_uart.h +++ /dev/null @@ -1,408 +0,0 @@ - -#ifndef __PL011__UART__H__ -#define __PL011__UART__H__ - -/* - * PL011 UART Generic driver implementation. - * Copyright Bahadir Balban (C) 2006 - * - * The particular intention of this code is that it has been carefully - * written as decoupled from os-specific code and in a verbose way such - * that it clearly demonstrates how the device operates, reducing the - * amount of time to be spent for understanding the operational model - * and implementing a driver from scratch. This is the very first to be - * such a driver so far, hopefully it will turn out to be useful. - */ - -/* Default base address for this chip */ -#define PL011_DEFAULT_PHYSICAL_BASE 0x101F1000 -#define PL011_BASE PL011_DEFAULT_PHYSICAL_BASE - -/* Architecture specific memory access macros */ -#define read(val, address) val = *((volatile unsigned int *) address) -#define write(val, address) *((volatile unsigned int *) address) = val - -/* Register offsets */ -#define PL011_UARTDR (PL011_BASE + 0x00) -#define PL011_UARTRSR (PL011_BASE + 0x04) -#define PL011_UARTECR (PL011_BASE + 0x04) -#define PL011_UARTFR (PL011_BASE + 0x18) -#define PL011_UARTILPR (PL011_BASE + 0x20) -#define PL011_UARTIBRD (PL011_BASE + 0x24) -#define PL011_UARTFBRD (PL011_BASE + 0x28) -#define PL011_UARTLCR_H (PL011_BASE + 0x2C) -#define PL011_UARTCR (PL011_BASE + 0x30) -#define PL011_UARTIFLS (PL011_BASE + 0x34) -#define PL011_UARTIMSC (PL011_BASE + 0x38) -#define PL011_UARTRIS (PL011_BASE + 0x3C) -#define PL011_UARTMIS (PL011_BASE + 0x40) -#define PL011_UARTICR (PL011_BASE + 0x44) -#define PL011_UARTDMACR (PL011_BASE + 0x48) - -/* IRQ bits for each uart irq event */ -#define PL011_RXIRQ (1 << 4) -#define PL011_TXIRQ (1 << 5) -#define PL011_RXTIMEOUTIRQ (1 << 6) -#define PL011_FEIRQ (1 << 7) -#define PL011_PEIRQ (1 << 8) -#define PL011_BEIRQ (1 << 9) -#define PL011_OEIRQ (1 << 10) - -struct pl011_uart; - -int pl011_initialise(struct pl011_uart *); -int pl011_tx_char(char); -int pl011_rx_char(char *); - -void pl011_set_baudrate(unsigned int, unsigned int); -void pl011_set_irq_mask(unsigned int); -void pl011_clr_irq_mask(unsigned int); - -void pl011_irq_handler(struct pl011_uart *); -void pl011_tx_irq_handler(struct pl011_uart *, unsigned int); -void pl011_rx_irq_handler(struct pl011_uart *, unsigned int); -void pl011_error_irq_handler(struct pl011_uart *, unsigned int); - -static inline void pl011_uart_enable(void); -static inline void pl011_uart_disable(void); -static inline void pl011_tx_enable(void); -static inline void pl011_tx_disable(void); -static inline void pl011_rx_enable(void); -static inline void pl011_rx_disable(void); -static inline void pl011_irq_clear(unsigned int flags); -static inline unsigned int pl011_read_irqstat(void); -static inline unsigned int pl011_read_irqmask(void); -static inline void pl011_rx_dma_disable(void); -static inline void pl011_rx_dma_enable(void); -static inline void pl011_tx_dma_enable(void); -static inline void pl011_tx_dma_disable(void); -static inline void pl011_set_irq_fifolevel(unsigned int xfer, - unsigned int level); -static inline void pl011_set_word_width(int size); -static inline void pl011_disable_fifos(void); -static inline void pl011_set_parity_even(void); -static inline void pl011_parity_enable(void); -static inline void pl011_set_stopbits(int stopbits); - -static inline void pl011_set_parity_odd(void); -static inline void pl011_enable_fifos(void); -static inline void pl011_parity_disable(void); - -struct pl011_uart_ops { - int (*initialise)(struct pl011_uart *); - - int (*tx_char)(char); - int (*rx_char)(char *); - - void (*set_baudrate)(unsigned int, unsigned int); - void (*set_irq_mask)(unsigned int); - void (*clr_irq_mask)(unsigned int); - - void (*irq_handler)(struct pl011_uart *); - void (*tx_irq_handler)(struct pl011_uart *, unsigned int); - void (*rx_irq_handler)(struct pl011_uart *, unsigned int); - void (*error_irq_handler)(struct pl011_uart *, unsigned int); -}; - -struct pl011_uart { - const unsigned int base; - struct pl011_uart_ops ops; - unsigned int frame_errors; - unsigned int parity_errors; - unsigned int break_errors; - unsigned int overrun_errors; - unsigned int rx_timeout_errors; -}; - - - -#define PL011_UARTEN (1 << 0) -static inline void pl011_uart_enable() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTCR); - val |= PL011_UARTEN; - write(val, PL011_UARTCR); - - return; -} - -static inline void pl011_uart_disable() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTCR); - val &= ~PL011_UARTEN; - write(val, PL011_UARTCR); - - return; -} - -#define PL011_TXE (1 << 8) -static inline void pl011_tx_enable() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTCR); - val |= PL011_TXE; - write(val, PL011_UARTCR); - return; -} - -static inline void pl011_tx_disable() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTCR); - val &= ~PL011_TXE; - write(val, PL011_UARTCR); - return; -} - - -#define PL011_RXE (1 << 9) -static inline void pl011_rx_enable() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTCR); - val |= PL011_RXE; - write(val, PL011_UARTCR); - return; -} - -static inline void pl011_rx_disable() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTCR); - val &= ~PL011_RXE; - write(val, PL011_UARTCR); - return; -} - -#define PL011_TWO_STOPBITS_SELECT (1 << 3) -static inline void pl011_set_stopbits(int stopbits) -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTLCR_H); - - if(stopbits == 2) { /* Set to two bits */ - val |= PL011_TWO_STOPBITS_SELECT; - } else { /* Default is 1 */ - val &= ~PL011_TWO_STOPBITS_SELECT; - } - write(val, PL011_UARTLCR_H); - return; -} - -#define PL011_PARITY_ENABLE (1 << 1) -static inline void pl011_parity_enable() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTLCR_H); - val |= PL011_PARITY_ENABLE; - write(val, PL011_UARTLCR_H); - return; -} - -static inline void pl011_parity_disable() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTLCR_H); - val &= ~PL011_PARITY_ENABLE; - write(val, PL011_UARTLCR_H); - return; -} - -#define PL011_PARITY_EVEN (1 << 2) -static inline void pl011_set_parity_even() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTLCR_H); - val |= PL011_PARITY_EVEN; - write(val, PL011_UARTLCR_H); - return; -} - -static inline void pl011_set_parity_odd() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTLCR_H); - val &= ~PL011_PARITY_EVEN; - write(val, PL011_UARTLCR_H); - return; -} - -#define PL011_ENABLE_FIFOS (1 << 4) -static inline void pl011_enable_fifos() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTLCR_H); - val |= PL011_ENABLE_FIFOS; - write(val, PL011_UARTLCR_H); - return; -} - -static inline void pl011_disable_fifos() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTLCR_H); - val &= ~PL011_ENABLE_FIFOS; - write(val, PL011_UARTLCR_H); - return; -} - - -#define PL011_WORD_WIDTH_SHIFT (5) -/* Sets the transfer word width for the data register. */ -static inline void pl011_set_word_width(int size) -{ - unsigned int val; - val = 0; - - if(size < 5 || size > 8) /* Default is 8 */ - size = 8; - - /* Clear size field */ - read(val, PL011_UARTLCR_H); - val &= ~(0x3 << PL011_WORD_WIDTH_SHIFT); - write(val, PL011_UARTLCR_H); - - /* The formula is to write 5 less of size given: - * 11 = 8 bits - * 10 = 7 bits - * 01 = 6 bits - * 00 = 5 bits - */ - read(val, PL011_UARTLCR_H); - val |= (size - 5) << PL011_WORD_WIDTH_SHIFT; - write(val, PL011_UARTLCR_H); - - return; -} - -/* - * Defines at which level of fifo fullness an irq will be generated. - * @xfer: tx fifo = 0, rx fifo = 1 - * @level: Generate irq if: - * 0 rxfifo >= 1/8 full txfifo <= 1/8 full - * 1 rxfifo >= 1/4 full txfifo <= 1/4 full - * 2 rxfifo >= 1/2 full txfifo <= 1/2 full - * 3 rxfifo >= 3/4 full txfifo <= 3/4 full - * 4 rxfifo >= 7/8 full txfifo <= 7/8 full - * 5-7 reserved reserved - */ -static inline void pl011_set_irq_fifolevel(unsigned int xfer, unsigned int level) -{ - if(xfer != 1 && xfer != 0) /* Invalid fifo */ - return; - - if(level > 4) /* Invalid level */ - return; - - write(level << (xfer * 3), PL011_UARTIFLS); - return; -} - -/* returns which irqs are masked */ -static inline unsigned int pl011_read_irqmask(void) -{ - unsigned int flags; - read(flags, PL011_UARTIMSC); - return flags; -} - -/* returns masked irq status */ -static inline unsigned int pl011_read_irqstat(void) -{ - unsigned int irqstatus; - read(irqstatus, PL011_UARTMIS); - return irqstatus; -} -/* Clears the given asserted irqs */ -static inline void pl011_irq_clear(unsigned int flags) -{ - if(flags > 0x3FF) { /* Invalid irq clearing bitvector */ - return; - } - /* Simply write the flags since it's a write-only register */ - write(flags, PL011_UARTICR); - return; -} - -#define PL011_TXDMAEN (1 << 1) -#define PL011_RXDMAEN (1 << 0) - -/* Enables dma transfers for uart. The dma controller - * must be initialised, set-up and enabled separately. - */ -static inline void pl011_tx_dma_enable() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTDMACR); - val |= PL011_TXDMAEN; - write(val, PL011_UARTDMACR); - return; -} - -/* Disables dma transfers for uart */ -static inline void pl011_tx_dma_disable() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTDMACR); - val &= ~PL011_TXDMAEN; - write(val, PL011_UARTDMACR); - return; -} - -static inline void pl011_rx_dma_enable() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTDMACR); - val |= PL011_RXDMAEN; - write(val, PL011_UARTDMACR); - return; -} - -static inline void pl011_rx_dma_disable() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTDMACR); - val &= ~PL011_RXDMAEN; - write(val, PL011_UARTDMACR); - return; -} - - -#endif /* __PL011__UART__ */ - diff --git a/loader/libs/c/include/sys-baremetal/arch-arm/arch/setjmp.h b/loader/libs/c/include/sys-baremetal/arch-arm/arch/setjmp.h deleted file mode 100644 index 22a17cd..0000000 --- a/loader/libs/c/include/sys-baremetal/arch-arm/arch/setjmp.h +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 National ICT Australia - * - * All rights reserved. - * - * Developed by: Embedded, Real-time and Operating Systems Program (ERTOS) - * National ICT Australia - * http://www.ertos.nicta.com.au - * - * Permission is granted by National ICT Australia, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of National ICT Australia, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on National ICT - * Australia or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of National ICT Australia or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ -/* - Author: Alex Webster -*/ - -typedef int jmp_buf[10]; diff --git a/loader/libs/c/include/sys-baremetal/arch-arm/arch/stdint.h b/loader/libs/c/include/sys-baremetal/arch-arm/arch/stdint.h deleted file mode 100644 index 6078b0a..0000000 --- a/loader/libs/c/include/sys-baremetal/arch-arm/arch/stdint.h +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 National ICT Australia - * - * All rights reserved. - * - * Developed by: Embedded, Real-time and Operating Systems Program (ERTOS) - * National ICT Australia - * http://www.ertos.nicta.com.au - * - * Permission is granted by National ICT Australia, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of National ICT Australia, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on National ICT - * Australia or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of National ICT Australia or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ -/* - Author: Ben Leslie -*/ -typedef signed char int8_t; -typedef short int16_t; -typedef int int32_t; -typedef long long int64_t; - -typedef unsigned char uint8_t; -typedef unsigned short uint16_t; -typedef unsigned int uint32_t; -typedef unsigned long long uint64_t; - -#define __PTR_SIZE 32 diff --git a/loader/libs/c/include/sys-baremetal/arch-arm/inttypes.h b/loader/libs/c/include/sys-baremetal/arch-arm/inttypes.h deleted file mode 100644 index 329ca46..0000000 --- a/loader/libs/c/include/sys-baremetal/arch-arm/inttypes.h +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 National ICT Australia - * - * All rights reserved. - * - * Developed by: Embedded, Real-time and Operating Systems Program (ERTOS) - * National ICT Australia - * http://www.ertos.nicta.com.au - * - * Permission is granted by National ICT Australia, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of National ICT Australia, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on National ICT - * Australia or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of National ICT Australia or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ -/* - Author: Ben Leslie -*/ -#define __LENGTH_8_MOD "hh" -#define __LENGTH_16_MOD "h" -#define __LENGTH_32_MOD -#define __LENGTH_64_MOD "ll" -#define __LENGTH_MAX_MOD "ll" -#define __LENGTH_PTR_MOD diff --git a/loader/libs/c/include/sys-baremetal/arch-arm/pl011_uart.h b/loader/libs/c/include/sys-baremetal/arch-arm/pl011_uart.h deleted file mode 100644 index cd2551f..0000000 --- a/loader/libs/c/include/sys-baremetal/arch-arm/pl011_uart.h +++ /dev/null @@ -1,408 +0,0 @@ - -#ifndef __PL011__UART__H__ -#define __PL011__UART__H__ - -/* - * PL011 UART Generic driver implementation. - * Copyright Bahadir Balban (C) 2006 - * - * The particular intention of this code is that it has been carefully - * written as decoupled from os-specific code and in a verbose way such - * that it clearly demonstrates how the device operates, reducing the - * amount of time to be spent for understanding the operational model - * and implementing a driver from scratch. This is the very first to be - * such a driver so far, hopefully it will turn out to be useful. - */ - -/* Default base address for this chip */ -#define PL011_DEFAULT_PHYSICAL_BASE 0x101F1000 -#define PL011_BASE PL011_DEFAULT_PHYSICAL_BASE - -/* Architecture specific memory access macros */ -#define read(val, address) val = *((volatile unsigned int *) address) -#define write(val, address) *((volatile unsigned int *) address) = val - -/* Register offsets */ -#define PL011_UARTDR (PL011_BASE + 0x00) -#define PL011_UARTRSR (PL011_BASE + 0x04) -#define PL011_UARTECR (PL011_BASE + 0x04) -#define PL011_UARTFR (PL011_BASE + 0x18) -#define PL011_UARTILPR (PL011_BASE + 0x20) -#define PL011_UARTIBRD (PL011_BASE + 0x24) -#define PL011_UARTFBRD (PL011_BASE + 0x28) -#define PL011_UARTLCR_H (PL011_BASE + 0x2C) -#define PL011_UARTCR (PL011_BASE + 0x30) -#define PL011_UARTIFLS (PL011_BASE + 0x34) -#define PL011_UARTIMSC (PL011_BASE + 0x38) -#define PL011_UARTRIS (PL011_BASE + 0x3C) -#define PL011_UARTMIS (PL011_BASE + 0x40) -#define PL011_UARTICR (PL011_BASE + 0x44) -#define PL011_UARTDMACR (PL011_BASE + 0x48) - -/* IRQ bits for each uart irq event */ -#define PL011_RXIRQ (1 << 4) -#define PL011_TXIRQ (1 << 5) -#define PL011_RXTIMEOUTIRQ (1 << 6) -#define PL011_FEIRQ (1 << 7) -#define PL011_PEIRQ (1 << 8) -#define PL011_BEIRQ (1 << 9) -#define PL011_OEIRQ (1 << 10) - -struct pl011_uart; - -int pl011_initialise(struct pl011_uart *); -int pl011_tx_char(char); -int pl011_rx_char(char *); - -void pl011_set_baudrate(unsigned int, unsigned int); -void pl011_set_irq_mask(unsigned int); -void pl011_clr_irq_mask(unsigned int); - -void pl011_irq_handler(struct pl011_uart *); -void pl011_tx_irq_handler(struct pl011_uart *, unsigned int); -void pl011_rx_irq_handler(struct pl011_uart *, unsigned int); -void pl011_error_irq_handler(struct pl011_uart *, unsigned int); - -static inline void pl011_uart_enable(void); -static inline void pl011_uart_disable(void); -static inline void pl011_tx_enable(void); -static inline void pl011_tx_disable(void); -static inline void pl011_rx_enable(void); -static inline void pl011_rx_disable(void); -static inline void pl011_irq_clear(unsigned int flags); -static inline unsigned int pl011_read_irqstat(void); -static inline unsigned int pl011_read_irqmask(void); -static inline void pl011_rx_dma_disable(void); -static inline void pl011_rx_dma_enable(void); -static inline void pl011_tx_dma_enable(void); -static inline void pl011_tx_dma_disable(void); -static inline void pl011_set_irq_fifolevel(unsigned int xfer, - unsigned int level); -static inline void pl011_set_word_width(int size); -static inline void pl011_disable_fifos(void); -static inline void pl011_set_parity_even(void); -static inline void pl011_parity_enable(void); -static inline void pl011_set_stopbits(int stopbits); - -static inline void pl011_set_parity_odd(void); -static inline void pl011_enable_fifos(void); -static inline void pl011_parity_disable(void); - -struct pl011_uart_ops { - int (*initialise)(struct pl011_uart *); - - int (*tx_char)(char); - int (*rx_char)(char *); - - void (*set_baudrate)(unsigned int, unsigned int); - void (*set_irq_mask)(unsigned int); - void (*clr_irq_mask)(unsigned int); - - void (*irq_handler)(struct pl011_uart *); - void (*tx_irq_handler)(struct pl011_uart *, unsigned int); - void (*rx_irq_handler)(struct pl011_uart *, unsigned int); - void (*error_irq_handler)(struct pl011_uart *, unsigned int); -}; - -struct pl011_uart { - const unsigned int base; - struct pl011_uart_ops ops; - unsigned int frame_errors; - unsigned int parity_errors; - unsigned int break_errors; - unsigned int overrun_errors; - unsigned int rx_timeout_errors; -}; - - - -#define PL011_UARTEN (1 << 0) -static inline void pl011_uart_enable() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTCR); - val |= PL011_UARTEN; - write(val, PL011_UARTCR); - - return; -} - -static inline void pl011_uart_disable() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTCR); - val &= ~PL011_UARTEN; - write(val, PL011_UARTCR); - - return; -} - -#define PL011_TXE (1 << 8) -static inline void pl011_tx_enable() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTCR); - val |= PL011_TXE; - write(val, PL011_UARTCR); - return; -} - -static inline void pl011_tx_disable() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTCR); - val &= ~PL011_TXE; - write(val, PL011_UARTCR); - return; -} - - -#define PL011_RXE (1 << 9) -static inline void pl011_rx_enable() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTCR); - val |= PL011_RXE; - write(val, PL011_UARTCR); - return; -} - -static inline void pl011_rx_disable() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTCR); - val &= ~PL011_RXE; - write(val, PL011_UARTCR); - return; -} - -#define PL011_TWO_STOPBITS_SELECT (1 << 3) -static inline void pl011_set_stopbits(int stopbits) -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTLCR_H); - - if(stopbits == 2) { /* Set to two bits */ - val |= PL011_TWO_STOPBITS_SELECT; - } else { /* Default is 1 */ - val &= ~PL011_TWO_STOPBITS_SELECT; - } - write(val, PL011_UARTLCR_H); - return; -} - -#define PL011_PARITY_ENABLE (1 << 1) -static inline void pl011_parity_enable() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTLCR_H); - val |= PL011_PARITY_ENABLE; - write(val, PL011_UARTLCR_H); - return; -} - -static inline void pl011_parity_disable() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTLCR_H); - val &= ~PL011_PARITY_ENABLE; - write(val, PL011_UARTLCR_H); - return; -} - -#define PL011_PARITY_EVEN (1 << 2) -static inline void pl011_set_parity_even() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTLCR_H); - val |= PL011_PARITY_EVEN; - write(val, PL011_UARTLCR_H); - return; -} - -static inline void pl011_set_parity_odd() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTLCR_H); - val &= ~PL011_PARITY_EVEN; - write(val, PL011_UARTLCR_H); - return; -} - -#define PL011_ENABLE_FIFOS (1 << 4) -static inline void pl011_enable_fifos() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTLCR_H); - val |= PL011_ENABLE_FIFOS; - write(val, PL011_UARTLCR_H); - return; -} - -static inline void pl011_disable_fifos() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTLCR_H); - val &= ~PL011_ENABLE_FIFOS; - write(val, PL011_UARTLCR_H); - return; -} - - -#define PL011_WORD_WIDTH_SHIFT (5) -/* Sets the transfer word width for the data register. */ -static inline void pl011_set_word_width(int size) -{ - unsigned int val; - val = 0; - - if(size < 5 || size > 8) /* Default is 8 */ - size = 8; - - /* Clear size field */ - read(val, PL011_UARTLCR_H); - val &= ~(0x3 << PL011_WORD_WIDTH_SHIFT); - write(val, PL011_UARTLCR_H); - - /* The formula is to write 5 less of size given: - * 11 = 8 bits - * 10 = 7 bits - * 01 = 6 bits - * 00 = 5 bits - */ - read(val, PL011_UARTLCR_H); - val |= (size - 5) << PL011_WORD_WIDTH_SHIFT; - write(val, PL011_UARTLCR_H); - - return; -} - -/* - * Defines at which level of fifo fullness an irq will be generated. - * @xfer: tx fifo = 0, rx fifo = 1 - * @level: Generate irq if: - * 0 rxfifo >= 1/8 full txfifo <= 1/8 full - * 1 rxfifo >= 1/4 full txfifo <= 1/4 full - * 2 rxfifo >= 1/2 full txfifo <= 1/2 full - * 3 rxfifo >= 3/4 full txfifo <= 3/4 full - * 4 rxfifo >= 7/8 full txfifo <= 7/8 full - * 5-7 reserved reserved - */ -static inline void pl011_set_irq_fifolevel(unsigned int xfer, unsigned int level) -{ - if(xfer != 1 && xfer != 0) /* Invalid fifo */ - return; - - if(level > 4) /* Invalid level */ - return; - - write(level << (xfer * 3), PL011_UARTIFLS); - return; -} - -/* returns which irqs are masked */ -static inline unsigned int pl011_read_irqmask(void) -{ - unsigned int flags; - read(flags, PL011_UARTIMSC); - return flags; -} - -/* returns masked irq status */ -static inline unsigned int pl011_read_irqstat(void) -{ - unsigned int irqstatus; - read(irqstatus, PL011_UARTMIS); - return irqstatus; -} -/* Clears the given asserted irqs */ -static inline void pl011_irq_clear(unsigned int flags) -{ - if(flags > 0x3FF) { /* Invalid irq clearing bitvector */ - return; - } - /* Simply write the flags since it's a write-only register */ - write(flags, PL011_UARTICR); - return; -} - -#define PL011_TXDMAEN (1 << 1) -#define PL011_RXDMAEN (1 << 0) - -/* Enables dma transfers for uart. The dma controller - * must be initialised, set-up and enabled separately. - */ -static inline void pl011_tx_dma_enable() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTDMACR); - val |= PL011_TXDMAEN; - write(val, PL011_UARTDMACR); - return; -} - -/* Disables dma transfers for uart */ -static inline void pl011_tx_dma_disable() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTDMACR); - val &= ~PL011_TXDMAEN; - write(val, PL011_UARTDMACR); - return; -} - -static inline void pl011_rx_dma_enable() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTDMACR); - val |= PL011_RXDMAEN; - write(val, PL011_UARTDMACR); - return; -} - -static inline void pl011_rx_dma_disable() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTDMACR); - val &= ~PL011_RXDMAEN; - write(val, PL011_UARTDMACR); - return; -} - - -#endif /* __PL011__UART__ */ - diff --git a/loader/libs/c/include/sys-baremetal/arch-arm/setjmp.h b/loader/libs/c/include/sys-baremetal/arch-arm/setjmp.h deleted file mode 100644 index 22a17cd..0000000 --- a/loader/libs/c/include/sys-baremetal/arch-arm/setjmp.h +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 National ICT Australia - * - * All rights reserved. - * - * Developed by: Embedded, Real-time and Operating Systems Program (ERTOS) - * National ICT Australia - * http://www.ertos.nicta.com.au - * - * Permission is granted by National ICT Australia, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of National ICT Australia, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on National ICT - * Australia or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of National ICT Australia or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ -/* - Author: Alex Webster -*/ - -typedef int jmp_buf[10]; diff --git a/loader/libs/c/include/sys-baremetal/arch-arm/stdint.h b/loader/libs/c/include/sys-baremetal/arch-arm/stdint.h deleted file mode 100644 index 6078b0a..0000000 --- a/loader/libs/c/include/sys-baremetal/arch-arm/stdint.h +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 National ICT Australia - * - * All rights reserved. - * - * Developed by: Embedded, Real-time and Operating Systems Program (ERTOS) - * National ICT Australia - * http://www.ertos.nicta.com.au - * - * Permission is granted by National ICT Australia, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of National ICT Australia, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on National ICT - * Australia or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of National ICT Australia or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ -/* - Author: Ben Leslie -*/ -typedef signed char int8_t; -typedef short int16_t; -typedef int int32_t; -typedef long long int64_t; - -typedef unsigned char uint8_t; -typedef unsigned short uint16_t; -typedef unsigned int uint32_t; -typedef unsigned long long uint64_t; - -#define __PTR_SIZE 32 diff --git a/loader/libs/c/include/sys-userspace/arch-arm/arch/inttypes.h b/loader/libs/c/include/sys-userspace/arch-arm/arch/inttypes.h deleted file mode 100644 index 329ca46..0000000 --- a/loader/libs/c/include/sys-userspace/arch-arm/arch/inttypes.h +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 National ICT Australia - * - * All rights reserved. - * - * Developed by: Embedded, Real-time and Operating Systems Program (ERTOS) - * National ICT Australia - * http://www.ertos.nicta.com.au - * - * Permission is granted by National ICT Australia, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of National ICT Australia, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on National ICT - * Australia or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of National ICT Australia or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ -/* - Author: Ben Leslie -*/ -#define __LENGTH_8_MOD "hh" -#define __LENGTH_16_MOD "h" -#define __LENGTH_32_MOD -#define __LENGTH_64_MOD "ll" -#define __LENGTH_MAX_MOD "ll" -#define __LENGTH_PTR_MOD diff --git a/loader/libs/c/include/sys-userspace/arch-arm/arch/pl011_uart.h b/loader/libs/c/include/sys-userspace/arch-arm/arch/pl011_uart.h deleted file mode 100644 index 341aac3..0000000 --- a/loader/libs/c/include/sys-userspace/arch-arm/arch/pl011_uart.h +++ /dev/null @@ -1,408 +0,0 @@ - -#ifndef __PL011__UART__H__ -#define __PL011__UART__H__ - -/* - * PL011 UART Generic driver implementation. - * Copyright Bahadir Balban (C) 2006 - * - * The particular intention of this code is that it has been carefully - * written as decoupled from os-specific code and in a verbose way such - * that it clearly demonstrates how the device operates, reducing the - * amount of time to be spent for understanding the operational model - * and implementing a driver from scratch. This is the very first to be - * such a driver so far, hopefully it will turn out to be useful. - */ - -/* Default base address for this chip */ -#define PL011_USR_BASE 0x500000 -#define PL011_BASE PL011_USR_BASE - -/* Architecture specific memory access macros */ -#define read(val, address) val = *((volatile unsigned int *) address) -#define write(val, address) *((volatile unsigned int *) address) = val - -/* Register offsets */ -#define PL011_UARTDR (PL011_BASE + 0x00) -#define PL011_UARTRSR (PL011_BASE + 0x04) -#define PL011_UARTECR (PL011_BASE + 0x04) -#define PL011_UARTFR (PL011_BASE + 0x18) -#define PL011_UARTILPR (PL011_BASE + 0x20) -#define PL011_UARTIBRD (PL011_BASE + 0x24) -#define PL011_UARTFBRD (PL011_BASE + 0x28) -#define PL011_UARTLCR_H (PL011_BASE + 0x2C) -#define PL011_UARTCR (PL011_BASE + 0x30) -#define PL011_UARTIFLS (PL011_BASE + 0x34) -#define PL011_UARTIMSC (PL011_BASE + 0x38) -#define PL011_UARTRIS (PL011_BASE + 0x3C) -#define PL011_UARTMIS (PL011_BASE + 0x40) -#define PL011_UARTICR (PL011_BASE + 0x44) -#define PL011_UARTDMACR (PL011_BASE + 0x48) - -/* IRQ bits for each uart irq event */ -#define PL011_RXIRQ (1 << 4) -#define PL011_TXIRQ (1 << 5) -#define PL011_RXTIMEOUTIRQ (1 << 6) -#define PL011_FEIRQ (1 << 7) -#define PL011_PEIRQ (1 << 8) -#define PL011_BEIRQ (1 << 9) -#define PL011_OEIRQ (1 << 10) - -struct pl011_uart; - -int pl011_initialise(struct pl011_uart *); -int pl011_tx_char(char); -int pl011_rx_char(char *); - -void pl011_set_baudrate(unsigned int, unsigned int); -void pl011_set_irq_mask(unsigned int); -void pl011_clr_irq_mask(unsigned int); - -void pl011_irq_handler(struct pl011_uart *); -void pl011_tx_irq_handler(struct pl011_uart *, unsigned int); -void pl011_rx_irq_handler(struct pl011_uart *, unsigned int); -void pl011_error_irq_handler(struct pl011_uart *, unsigned int); - -static inline void pl011_uart_enable(void); -static inline void pl011_uart_disable(void); -static inline void pl011_tx_enable(void); -static inline void pl011_tx_disable(void); -static inline void pl011_rx_enable(void); -static inline void pl011_rx_disable(void); -static inline void pl011_irq_clear(unsigned int flags); -static inline unsigned int pl011_read_irqstat(void); -static inline unsigned int pl011_read_irqmask(void); -static inline void pl011_rx_dma_disable(void); -static inline void pl011_rx_dma_enable(void); -static inline void pl011_tx_dma_enable(void); -static inline void pl011_tx_dma_disable(void); -static inline void pl011_set_irq_fifolevel(unsigned int xfer, - unsigned int level); -static inline void pl011_set_word_width(int size); -static inline void pl011_disable_fifos(void); -static inline void pl011_set_parity_even(void); -static inline void pl011_parity_enable(void); -static inline void pl011_set_stopbits(int stopbits); - -static inline void pl011_set_parity_odd(void); -static inline void pl011_enable_fifos(void); -static inline void pl011_parity_disable(void); - -struct pl011_uart_ops { - int (*initialise)(struct pl011_uart *); - - int (*tx_char)(char); - int (*rx_char)(char *); - - void (*set_baudrate)(unsigned int, unsigned int); - void (*set_irq_mask)(unsigned int); - void (*clr_irq_mask)(unsigned int); - - void (*irq_handler)(struct pl011_uart *); - void (*tx_irq_handler)(struct pl011_uart *, unsigned int); - void (*rx_irq_handler)(struct pl011_uart *, unsigned int); - void (*error_irq_handler)(struct pl011_uart *, unsigned int); -}; - -struct pl011_uart { - const unsigned int base; - struct pl011_uart_ops ops; - unsigned int frame_errors; - unsigned int parity_errors; - unsigned int break_errors; - unsigned int overrun_errors; - unsigned int rx_timeout_errors; -}; - - - -#define PL011_UARTEN (1 << 0) -static inline void pl011_uart_enable() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTCR); - val |= PL011_UARTEN; - write(val, PL011_UARTCR); - - return; -} - -static inline void pl011_uart_disable() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTCR); - val &= ~PL011_UARTEN; - write(val, PL011_UARTCR); - - return; -} - -#define PL011_TXE (1 << 8) -static inline void pl011_tx_enable() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTCR); - val |= PL011_TXE; - write(val, PL011_UARTCR); - return; -} - -static inline void pl011_tx_disable() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTCR); - val &= ~PL011_TXE; - write(val, PL011_UARTCR); - return; -} - - -#define PL011_RXE (1 << 9) -static inline void pl011_rx_enable() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTCR); - val |= PL011_RXE; - write(val, PL011_UARTCR); - return; -} - -static inline void pl011_rx_disable() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTCR); - val &= ~PL011_RXE; - write(val, PL011_UARTCR); - return; -} - -#define PL011_TWO_STOPBITS_SELECT (1 << 3) -static inline void pl011_set_stopbits(int stopbits) -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTLCR_H); - - if(stopbits == 2) { /* Set to two bits */ - val |= PL011_TWO_STOPBITS_SELECT; - } else { /* Default is 1 */ - val &= ~PL011_TWO_STOPBITS_SELECT; - } - write(val, PL011_UARTLCR_H); - return; -} - -#define PL011_PARITY_ENABLE (1 << 1) -static inline void pl011_parity_enable() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTLCR_H); - val |= PL011_PARITY_ENABLE; - write(val, PL011_UARTLCR_H); - return; -} - -static inline void pl011_parity_disable() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTLCR_H); - val &= ~PL011_PARITY_ENABLE; - write(val, PL011_UARTLCR_H); - return; -} - -#define PL011_PARITY_EVEN (1 << 2) -static inline void pl011_set_parity_even() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTLCR_H); - val |= PL011_PARITY_EVEN; - write(val, PL011_UARTLCR_H); - return; -} - -static inline void pl011_set_parity_odd() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTLCR_H); - val &= ~PL011_PARITY_EVEN; - write(val, PL011_UARTLCR_H); - return; -} - -#define PL011_ENABLE_FIFOS (1 << 4) -static inline void pl011_enable_fifos() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTLCR_H); - val |= PL011_ENABLE_FIFOS; - write(val, PL011_UARTLCR_H); - return; -} - -static inline void pl011_disable_fifos() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTLCR_H); - val &= ~PL011_ENABLE_FIFOS; - write(val, PL011_UARTLCR_H); - return; -} - - -#define PL011_WORD_WIDTH_SHIFT (5) -/* Sets the transfer word width for the data register. */ -static inline void pl011_set_word_width(int size) -{ - unsigned int val; - val = 0; - - if(size < 5 || size > 8) /* Default is 8 */ - size = 8; - - /* Clear size field */ - read(val, PL011_UARTLCR_H); - val &= ~(0x3 << PL011_WORD_WIDTH_SHIFT); - write(val, PL011_UARTLCR_H); - - /* The formula is to write 5 less of size given: - * 11 = 8 bits - * 10 = 7 bits - * 01 = 6 bits - * 00 = 5 bits - */ - read(val, PL011_UARTLCR_H); - val |= (size - 5) << PL011_WORD_WIDTH_SHIFT; - write(val, PL011_UARTLCR_H); - - return; -} - -/* - * Defines at which level of fifo fullness an irq will be generated. - * @xfer: tx fifo = 0, rx fifo = 1 - * @level: Generate irq if: - * 0 rxfifo >= 1/8 full txfifo <= 1/8 full - * 1 rxfifo >= 1/4 full txfifo <= 1/4 full - * 2 rxfifo >= 1/2 full txfifo <= 1/2 full - * 3 rxfifo >= 3/4 full txfifo <= 3/4 full - * 4 rxfifo >= 7/8 full txfifo <= 7/8 full - * 5-7 reserved reserved - */ -static inline void pl011_set_irq_fifolevel(unsigned int xfer, unsigned int level) -{ - if(xfer != 1 && xfer != 0) /* Invalid fifo */ - return; - - if(level > 4) /* Invalid level */ - return; - - write(level << (xfer * 3), PL011_UARTIFLS); - return; -} - -/* returns which irqs are masked */ -static inline unsigned int pl011_read_irqmask(void) -{ - unsigned int flags; - read(flags, PL011_UARTIMSC); - return flags; -} - -/* returns masked irq status */ -static inline unsigned int pl011_read_irqstat(void) -{ - unsigned int irqstatus; - read(irqstatus, PL011_UARTMIS); - return irqstatus; -} -/* Clears the given asserted irqs */ -static inline void pl011_irq_clear(unsigned int flags) -{ - if(flags > 0x3FF) { /* Invalid irq clearing bitvector */ - return; - } - /* Simply write the flags since it's a write-only register */ - write(flags, PL011_UARTICR); - return; -} - -#define PL011_TXDMAEN (1 << 1) -#define PL011_RXDMAEN (1 << 0) - -/* Enables dma transfers for uart. The dma controller - * must be initialised, set-up and enabled separately. - */ -static inline void pl011_tx_dma_enable() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTDMACR); - val |= PL011_TXDMAEN; - write(val, PL011_UARTDMACR); - return; -} - -/* Disables dma transfers for uart */ -static inline void pl011_tx_dma_disable() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTDMACR); - val &= ~PL011_TXDMAEN; - write(val, PL011_UARTDMACR); - return; -} - -static inline void pl011_rx_dma_enable() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTDMACR); - val |= PL011_RXDMAEN; - write(val, PL011_UARTDMACR); - return; -} - -static inline void pl011_rx_dma_disable() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTDMACR); - val &= ~PL011_RXDMAEN; - write(val, PL011_UARTDMACR); - return; -} - - -#endif /* __PL011__UART__ */ - diff --git a/loader/libs/c/include/sys-userspace/arch-arm/arch/setjmp.h b/loader/libs/c/include/sys-userspace/arch-arm/arch/setjmp.h deleted file mode 100644 index 22a17cd..0000000 --- a/loader/libs/c/include/sys-userspace/arch-arm/arch/setjmp.h +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 National ICT Australia - * - * All rights reserved. - * - * Developed by: Embedded, Real-time and Operating Systems Program (ERTOS) - * National ICT Australia - * http://www.ertos.nicta.com.au - * - * Permission is granted by National ICT Australia, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of National ICT Australia, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on National ICT - * Australia or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of National ICT Australia or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ -/* - Author: Alex Webster -*/ - -typedef int jmp_buf[10]; diff --git a/loader/libs/c/include/sys-userspace/arch-arm/arch/stdint.h b/loader/libs/c/include/sys-userspace/arch-arm/arch/stdint.h deleted file mode 100644 index 6078b0a..0000000 --- a/loader/libs/c/include/sys-userspace/arch-arm/arch/stdint.h +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 National ICT Australia - * - * All rights reserved. - * - * Developed by: Embedded, Real-time and Operating Systems Program (ERTOS) - * National ICT Australia - * http://www.ertos.nicta.com.au - * - * Permission is granted by National ICT Australia, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of National ICT Australia, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on National ICT - * Australia or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of National ICT Australia or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ -/* - Author: Ben Leslie -*/ -typedef signed char int8_t; -typedef short int16_t; -typedef int int32_t; -typedef long long int64_t; - -typedef unsigned char uint8_t; -typedef unsigned short uint16_t; -typedef unsigned int uint32_t; -typedef unsigned long long uint64_t; - -#define __PTR_SIZE 32 diff --git a/loader/libs/c/include/sys-userspace/arch-arm/inttypes.h b/loader/libs/c/include/sys-userspace/arch-arm/inttypes.h deleted file mode 100644 index 329ca46..0000000 --- a/loader/libs/c/include/sys-userspace/arch-arm/inttypes.h +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 National ICT Australia - * - * All rights reserved. - * - * Developed by: Embedded, Real-time and Operating Systems Program (ERTOS) - * National ICT Australia - * http://www.ertos.nicta.com.au - * - * Permission is granted by National ICT Australia, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of National ICT Australia, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on National ICT - * Australia or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of National ICT Australia or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ -/* - Author: Ben Leslie -*/ -#define __LENGTH_8_MOD "hh" -#define __LENGTH_16_MOD "h" -#define __LENGTH_32_MOD -#define __LENGTH_64_MOD "ll" -#define __LENGTH_MAX_MOD "ll" -#define __LENGTH_PTR_MOD diff --git a/loader/libs/c/include/sys-userspace/arch-arm/pl011_uart.h b/loader/libs/c/include/sys-userspace/arch-arm/pl011_uart.h deleted file mode 100644 index 341aac3..0000000 --- a/loader/libs/c/include/sys-userspace/arch-arm/pl011_uart.h +++ /dev/null @@ -1,408 +0,0 @@ - -#ifndef __PL011__UART__H__ -#define __PL011__UART__H__ - -/* - * PL011 UART Generic driver implementation. - * Copyright Bahadir Balban (C) 2006 - * - * The particular intention of this code is that it has been carefully - * written as decoupled from os-specific code and in a verbose way such - * that it clearly demonstrates how the device operates, reducing the - * amount of time to be spent for understanding the operational model - * and implementing a driver from scratch. This is the very first to be - * such a driver so far, hopefully it will turn out to be useful. - */ - -/* Default base address for this chip */ -#define PL011_USR_BASE 0x500000 -#define PL011_BASE PL011_USR_BASE - -/* Architecture specific memory access macros */ -#define read(val, address) val = *((volatile unsigned int *) address) -#define write(val, address) *((volatile unsigned int *) address) = val - -/* Register offsets */ -#define PL011_UARTDR (PL011_BASE + 0x00) -#define PL011_UARTRSR (PL011_BASE + 0x04) -#define PL011_UARTECR (PL011_BASE + 0x04) -#define PL011_UARTFR (PL011_BASE + 0x18) -#define PL011_UARTILPR (PL011_BASE + 0x20) -#define PL011_UARTIBRD (PL011_BASE + 0x24) -#define PL011_UARTFBRD (PL011_BASE + 0x28) -#define PL011_UARTLCR_H (PL011_BASE + 0x2C) -#define PL011_UARTCR (PL011_BASE + 0x30) -#define PL011_UARTIFLS (PL011_BASE + 0x34) -#define PL011_UARTIMSC (PL011_BASE + 0x38) -#define PL011_UARTRIS (PL011_BASE + 0x3C) -#define PL011_UARTMIS (PL011_BASE + 0x40) -#define PL011_UARTICR (PL011_BASE + 0x44) -#define PL011_UARTDMACR (PL011_BASE + 0x48) - -/* IRQ bits for each uart irq event */ -#define PL011_RXIRQ (1 << 4) -#define PL011_TXIRQ (1 << 5) -#define PL011_RXTIMEOUTIRQ (1 << 6) -#define PL011_FEIRQ (1 << 7) -#define PL011_PEIRQ (1 << 8) -#define PL011_BEIRQ (1 << 9) -#define PL011_OEIRQ (1 << 10) - -struct pl011_uart; - -int pl011_initialise(struct pl011_uart *); -int pl011_tx_char(char); -int pl011_rx_char(char *); - -void pl011_set_baudrate(unsigned int, unsigned int); -void pl011_set_irq_mask(unsigned int); -void pl011_clr_irq_mask(unsigned int); - -void pl011_irq_handler(struct pl011_uart *); -void pl011_tx_irq_handler(struct pl011_uart *, unsigned int); -void pl011_rx_irq_handler(struct pl011_uart *, unsigned int); -void pl011_error_irq_handler(struct pl011_uart *, unsigned int); - -static inline void pl011_uart_enable(void); -static inline void pl011_uart_disable(void); -static inline void pl011_tx_enable(void); -static inline void pl011_tx_disable(void); -static inline void pl011_rx_enable(void); -static inline void pl011_rx_disable(void); -static inline void pl011_irq_clear(unsigned int flags); -static inline unsigned int pl011_read_irqstat(void); -static inline unsigned int pl011_read_irqmask(void); -static inline void pl011_rx_dma_disable(void); -static inline void pl011_rx_dma_enable(void); -static inline void pl011_tx_dma_enable(void); -static inline void pl011_tx_dma_disable(void); -static inline void pl011_set_irq_fifolevel(unsigned int xfer, - unsigned int level); -static inline void pl011_set_word_width(int size); -static inline void pl011_disable_fifos(void); -static inline void pl011_set_parity_even(void); -static inline void pl011_parity_enable(void); -static inline void pl011_set_stopbits(int stopbits); - -static inline void pl011_set_parity_odd(void); -static inline void pl011_enable_fifos(void); -static inline void pl011_parity_disable(void); - -struct pl011_uart_ops { - int (*initialise)(struct pl011_uart *); - - int (*tx_char)(char); - int (*rx_char)(char *); - - void (*set_baudrate)(unsigned int, unsigned int); - void (*set_irq_mask)(unsigned int); - void (*clr_irq_mask)(unsigned int); - - void (*irq_handler)(struct pl011_uart *); - void (*tx_irq_handler)(struct pl011_uart *, unsigned int); - void (*rx_irq_handler)(struct pl011_uart *, unsigned int); - void (*error_irq_handler)(struct pl011_uart *, unsigned int); -}; - -struct pl011_uart { - const unsigned int base; - struct pl011_uart_ops ops; - unsigned int frame_errors; - unsigned int parity_errors; - unsigned int break_errors; - unsigned int overrun_errors; - unsigned int rx_timeout_errors; -}; - - - -#define PL011_UARTEN (1 << 0) -static inline void pl011_uart_enable() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTCR); - val |= PL011_UARTEN; - write(val, PL011_UARTCR); - - return; -} - -static inline void pl011_uart_disable() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTCR); - val &= ~PL011_UARTEN; - write(val, PL011_UARTCR); - - return; -} - -#define PL011_TXE (1 << 8) -static inline void pl011_tx_enable() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTCR); - val |= PL011_TXE; - write(val, PL011_UARTCR); - return; -} - -static inline void pl011_tx_disable() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTCR); - val &= ~PL011_TXE; - write(val, PL011_UARTCR); - return; -} - - -#define PL011_RXE (1 << 9) -static inline void pl011_rx_enable() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTCR); - val |= PL011_RXE; - write(val, PL011_UARTCR); - return; -} - -static inline void pl011_rx_disable() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTCR); - val &= ~PL011_RXE; - write(val, PL011_UARTCR); - return; -} - -#define PL011_TWO_STOPBITS_SELECT (1 << 3) -static inline void pl011_set_stopbits(int stopbits) -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTLCR_H); - - if(stopbits == 2) { /* Set to two bits */ - val |= PL011_TWO_STOPBITS_SELECT; - } else { /* Default is 1 */ - val &= ~PL011_TWO_STOPBITS_SELECT; - } - write(val, PL011_UARTLCR_H); - return; -} - -#define PL011_PARITY_ENABLE (1 << 1) -static inline void pl011_parity_enable() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTLCR_H); - val |= PL011_PARITY_ENABLE; - write(val, PL011_UARTLCR_H); - return; -} - -static inline void pl011_parity_disable() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTLCR_H); - val &= ~PL011_PARITY_ENABLE; - write(val, PL011_UARTLCR_H); - return; -} - -#define PL011_PARITY_EVEN (1 << 2) -static inline void pl011_set_parity_even() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTLCR_H); - val |= PL011_PARITY_EVEN; - write(val, PL011_UARTLCR_H); - return; -} - -static inline void pl011_set_parity_odd() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTLCR_H); - val &= ~PL011_PARITY_EVEN; - write(val, PL011_UARTLCR_H); - return; -} - -#define PL011_ENABLE_FIFOS (1 << 4) -static inline void pl011_enable_fifos() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTLCR_H); - val |= PL011_ENABLE_FIFOS; - write(val, PL011_UARTLCR_H); - return; -} - -static inline void pl011_disable_fifos() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTLCR_H); - val &= ~PL011_ENABLE_FIFOS; - write(val, PL011_UARTLCR_H); - return; -} - - -#define PL011_WORD_WIDTH_SHIFT (5) -/* Sets the transfer word width for the data register. */ -static inline void pl011_set_word_width(int size) -{ - unsigned int val; - val = 0; - - if(size < 5 || size > 8) /* Default is 8 */ - size = 8; - - /* Clear size field */ - read(val, PL011_UARTLCR_H); - val &= ~(0x3 << PL011_WORD_WIDTH_SHIFT); - write(val, PL011_UARTLCR_H); - - /* The formula is to write 5 less of size given: - * 11 = 8 bits - * 10 = 7 bits - * 01 = 6 bits - * 00 = 5 bits - */ - read(val, PL011_UARTLCR_H); - val |= (size - 5) << PL011_WORD_WIDTH_SHIFT; - write(val, PL011_UARTLCR_H); - - return; -} - -/* - * Defines at which level of fifo fullness an irq will be generated. - * @xfer: tx fifo = 0, rx fifo = 1 - * @level: Generate irq if: - * 0 rxfifo >= 1/8 full txfifo <= 1/8 full - * 1 rxfifo >= 1/4 full txfifo <= 1/4 full - * 2 rxfifo >= 1/2 full txfifo <= 1/2 full - * 3 rxfifo >= 3/4 full txfifo <= 3/4 full - * 4 rxfifo >= 7/8 full txfifo <= 7/8 full - * 5-7 reserved reserved - */ -static inline void pl011_set_irq_fifolevel(unsigned int xfer, unsigned int level) -{ - if(xfer != 1 && xfer != 0) /* Invalid fifo */ - return; - - if(level > 4) /* Invalid level */ - return; - - write(level << (xfer * 3), PL011_UARTIFLS); - return; -} - -/* returns which irqs are masked */ -static inline unsigned int pl011_read_irqmask(void) -{ - unsigned int flags; - read(flags, PL011_UARTIMSC); - return flags; -} - -/* returns masked irq status */ -static inline unsigned int pl011_read_irqstat(void) -{ - unsigned int irqstatus; - read(irqstatus, PL011_UARTMIS); - return irqstatus; -} -/* Clears the given asserted irqs */ -static inline void pl011_irq_clear(unsigned int flags) -{ - if(flags > 0x3FF) { /* Invalid irq clearing bitvector */ - return; - } - /* Simply write the flags since it's a write-only register */ - write(flags, PL011_UARTICR); - return; -} - -#define PL011_TXDMAEN (1 << 1) -#define PL011_RXDMAEN (1 << 0) - -/* Enables dma transfers for uart. The dma controller - * must be initialised, set-up and enabled separately. - */ -static inline void pl011_tx_dma_enable() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTDMACR); - val |= PL011_TXDMAEN; - write(val, PL011_UARTDMACR); - return; -} - -/* Disables dma transfers for uart */ -static inline void pl011_tx_dma_disable() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTDMACR); - val &= ~PL011_TXDMAEN; - write(val, PL011_UARTDMACR); - return; -} - -static inline void pl011_rx_dma_enable() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTDMACR); - val |= PL011_RXDMAEN; - write(val, PL011_UARTDMACR); - return; -} - -static inline void pl011_rx_dma_disable() -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTDMACR); - val &= ~PL011_RXDMAEN; - write(val, PL011_UARTDMACR); - return; -} - - -#endif /* __PL011__UART__ */ - diff --git a/loader/libs/c/include/sys-userspace/arch-arm/setjmp.h b/loader/libs/c/include/sys-userspace/arch-arm/setjmp.h deleted file mode 100644 index 22a17cd..0000000 --- a/loader/libs/c/include/sys-userspace/arch-arm/setjmp.h +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 National ICT Australia - * - * All rights reserved. - * - * Developed by: Embedded, Real-time and Operating Systems Program (ERTOS) - * National ICT Australia - * http://www.ertos.nicta.com.au - * - * Permission is granted by National ICT Australia, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of National ICT Australia, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on National ICT - * Australia or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of National ICT Australia or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ -/* - Author: Alex Webster -*/ - -typedef int jmp_buf[10]; diff --git a/loader/libs/c/include/sys-userspace/arch-arm/stdint.h b/loader/libs/c/include/sys-userspace/arch-arm/stdint.h deleted file mode 100644 index 6078b0a..0000000 --- a/loader/libs/c/include/sys-userspace/arch-arm/stdint.h +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 National ICT Australia - * - * All rights reserved. - * - * Developed by: Embedded, Real-time and Operating Systems Program (ERTOS) - * National ICT Australia - * http://www.ertos.nicta.com.au - * - * Permission is granted by National ICT Australia, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of National ICT Australia, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on National ICT - * Australia or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of National ICT Australia or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ -/* - Author: Ben Leslie -*/ -typedef signed char int8_t; -typedef short int16_t; -typedef int int32_t; -typedef long long int64_t; - -typedef unsigned char uint8_t; -typedef unsigned short uint16_t; -typedef unsigned int uint32_t; -typedef unsigned long long uint64_t; - -#define __PTR_SIZE 32 diff --git a/loader/libs/c/include/time.h b/loader/libs/c/include/time.h deleted file mode 100644 index 2856e23..0000000 --- a/loader/libs/c/include/time.h +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 National ICT Australia - * - * All rights reserved. - * - * Developed by: Embedded, Real-time and Operating Systems Program (ERTOS) - * National ICT Australia - * http://www.ertos.nicta.com.au - * - * Permission is granted by National ICT Australia, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of National ICT Australia, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on National ICT - * Australia or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of National ICT Australia or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ - -/* - Author: Ben Leslie - Created: Fri Sep 24 2004 - Description: time.h as per ISOC99 -*/ - -#ifndef _TIME_H_ -#define _TIME_H_ - -#include /* For NULL, size_t */ - -#define CLOCKS_PER_SEC 1 /* Arbitrary, 1s resolution */ - -typedef long clock_t; -typedef long time_t; - -struct tm { - int tm_sec; - int tm_min; - int tm_hour; - int tm_mday; - int tm_mon; - int tm_year; - int tm_wday; - int tm_yday; - int tm_isdst; -}; - - -/* 7.23.2 Time manipulation functions */ -clock_t clock(void); -double difftime(time_t time1, time_t time2); -time_t mktime(struct tm *timeptr); -time_t time(time_t *timer); - -/* 7.23.3 Time conversion functions */ -char *asctime(const struct tm *timeptr); -struct tm *gmtime(const time_t *timer); -struct tm *localtime(const time_t *timer); - -/* As per spec pg. 341 */ -static inline -char *ctime(const time_t *timer) -{ - return asctime(localtime(timer)); -} - -size_t strftime(char *s, size_t maxsize, const char *format, - const struct tm *timeptr); - -#endif /* _TIME_H_ */ diff --git a/loader/libs/c/src/arch-arm/eabi.c b/loader/libs/c/src/arch-arm/eabi.c deleted file mode 100644 index b44a913..0000000 --- a/loader/libs/c/src/arch-arm/eabi.c +++ /dev/null @@ -1,11 +0,0 @@ - - -/* Dummies to keep Codesourcery 4.1.1 libgcc division exceptions silent. */ -void raise(void) -{ -} - -void __aeabi_unwind_cpp_pr0(void) -{ -} - diff --git a/loader/libs/c/src/arch-arm/jmp.S b/loader/libs/c/src/arch-arm/jmp.S deleted file mode 100644 index bb99255..0000000 --- a/loader/libs/c/src/arch-arm/jmp.S +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 National ICT Australia - * - * All rights reserved. - * - * Developed by: Embedded, Real-time and Operating Systems Program (ERTOS) - * National ICT Australia - * http://www.ertos.nicta.com.au - * - * Permission is granted by National ICT Australia, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of National ICT Australia, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on National ICT - * Australia or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of National ICT Australia or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ - -#define BEGIN_PROC(name) \ - .global name; \ - .align; \ -name: - -#define END_PROC(name) \ - ; - -#ifdef __thumb__ -#define ret bx -#else -#define ret mov pc, -#endif - -BEGIN_PROC(setjmp) - stmia r0, {r4-r11,r13,r14} - mov r0, #0 - ret lr -END_PROC(setjmp) - -BEGIN_PROC(longjmp) - ldmia r0, {r4-r11,r13,r14} - movs r0, r1 - moveq r0, #1 // don't return zero - ret lr -END_PROC(longjmp) diff --git a/loader/libs/c/src/asctime.c b/loader/libs/c/src/asctime.c deleted file mode 100644 index 0f15b2b..0000000 --- a/loader/libs/c/src/asctime.c +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 National ICT Australia - * - * All rights reserved. - * - * Developed by: Embedded, Real-time and Operating Systems Program (ERTOS) - * National ICT Australia - * http://www.ertos.nicta.com.au - * - * Permission is granted by National ICT Australia, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of National ICT Australia, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on National ICT - * Australia or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of National ICT Australia or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ -/* - Authors: Ben Leslie - Created: Fri Sep 24 2004 - Note: Implementation taken verbatim from ISOC99 spec. page 341 -*/ -#include -#include - -/* Not required to be thread safe by posix */ -char * -asctime(const struct tm *timeptr) -{ - static const char wday_name[7][3] = { - "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" - }; - static const char mon_name[12][3] = { - "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", - "Aug", "Sep", "Oct", "Nov", "Dec" - }; - - static char result[26]; /* NOT THREAD SAFE */ - - sprintf(result, "%.3s %.3s%3d %.2d:%.2d:%.2d %d\n", - wday_name[timeptr->tm_wday], mon_name[timeptr->tm_mon], - timeptr->tm_mday, timeptr->tm_hour, - timeptr->tm_min, timeptr->tm_sec, - 1900 + timeptr->tm_year); - return result; -} diff --git a/loader/libs/c/src/assert.c b/loader/libs/c/src/assert.c deleted file mode 100644 index 99468f4..0000000 --- a/loader/libs/c/src/assert.c +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 National ICT Australia - * - * All rights reserved. - * - * Developed by: Embedded, Real-time and Operating Systems Program (ERTOS) - * National ICT Australia - * http://www.ertos.nicta.com.au - * - * Permission is granted by National ICT Australia, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of National ICT Australia, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on National ICT - * Australia or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of National ICT Australia or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ -/* - Authors: Ben Leslie -*/ - -#include /* For __assert */ -#include /* For fprintf() */ -#include /* For abort() */ - - -void -__assert(const char *expression, const char *file, - const char *function, int line) -{ - /* Formatting as per suggstion in C99 spec 7.2.1.1 */ - fprintf(stderr, "Assertion failed: %s, function %s, " - "file %s, line %d.\n", expression, function, file, line); - abort(); -} diff --git a/loader/libs/c/src/calloc.c b/loader/libs/c/src/calloc.c deleted file mode 100644 index 9ec252a..0000000 --- a/loader/libs/c/src/calloc.c +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 National ICT Australia - * - * All rights reserved. - * - * Developed by: Embedded, Real-time and Operating Systems Program (ERTOS) - * National ICT Australia - * http://www.ertos.nicta.com.au - * - * Permission is granted by National ICT Australia, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of National ICT Australia, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on National ICT - * Australia or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of National ICT Australia or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ - -/* - Author: Ben Leslie -*/ - -#include -#include - -void * -calloc(size_t nmemb, size_t size) -{ - void *ptr; - ptr = malloc(nmemb * size); - if (ptr) - memset(ptr, '\0', nmemb * size); - return ptr; -} diff --git a/loader/libs/c/src/clearerr.c b/loader/libs/c/src/clearerr.c deleted file mode 100644 index 69b5e03..0000000 --- a/loader/libs/c/src/clearerr.c +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 National ICT Australia - * - * All rights reserved. - * - * Developed by: Embedded, Real-time and Operating Systems Program (ERTOS) - * National ICT Australia - * http://www.ertos.nicta.com.au - * - * Permission is granted by National ICT Australia, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of National ICT Australia, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on National ICT - * Australia or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of National ICT Australia or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ -#include - -void -clearerr(FILE *stream) -{ - lock_stream(stream); - stream->error = 0; - stream->eof = 0; - unlock_stream(stream); -} diff --git a/loader/libs/c/src/clock.c b/loader/libs/c/src/clock.c deleted file mode 100644 index acbb285..0000000 --- a/loader/libs/c/src/clock.c +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 National ICT Australia - * - * All rights reserved. - * - * Developed by: Embedded, Real-time and Operating Systems Program (ERTOS) - * National ICT Australia - * http://www.ertos.nicta.com.au - * - * Permission is granted by National ICT Australia, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of National ICT Australia, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on National ICT - * Australia or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of National ICT Australia or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ -#include - -clock_t -clock(void) -{ - return 0; /* Don't currently do time -- will probably need to be - system dependant */ -} diff --git a/loader/libs/c/src/crt0.S b/loader/libs/c/src/crt0.S deleted file mode 100644 index 5b19314..0000000 --- a/loader/libs/c/src/crt0.S +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 National ICT Australia - * - * All rights reserved. - * - * Developed by: Embedded, Real-time and Operating Systems Program (ERTOS) - * National ICT Australia - * http://www.ertos.nicta.com.au - * - * Permission is granted by National ICT Australia, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of National ICT Australia, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on National ICT - * Australia or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of National ICT Australia or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ - -#ifdef __thumb__ -#define bl blx -#endif - - .code 32 - .global _start; - .align; -_start: - ldr sp, 1f - bl platform_init - bl main -1: .word _stack_top - - .bss - .align -_stack: - .space 1024 -_stack_top: diff --git a/loader/libs/c/src/ctype.c b/loader/libs/c/src/ctype.c deleted file mode 100644 index e69de29..0000000 diff --git a/loader/libs/c/src/difftime.c b/loader/libs/c/src/difftime.c deleted file mode 100644 index 9b145a3..0000000 --- a/loader/libs/c/src/difftime.c +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 National ICT Australia - * - * All rights reserved. - * - * Developed by: Embedded, Real-time and Operating Systems Program (ERTOS) - * National ICT Australia - * http://www.ertos.nicta.com.au - * - * Permission is granted by National ICT Australia, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of National ICT Australia, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on National ICT - * Australia or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of National ICT Australia or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ - -#include - -double -difftime(time_t time1, time_t time2) -{ - return (double) (time1 - time2); -} diff --git a/loader/libs/c/src/errno.c b/loader/libs/c/src/errno.c deleted file mode 100644 index 95790e1..0000000 --- a/loader/libs/c/src/errno.c +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 National ICT Australia - * - * All rights reserved. - * - * Developed by: Embedded, Real-time and Operating Systems Program (ERTOS) - * National ICT Australia - * http://www.ertos.nicta.com.au - * - * Permission is granted by National ICT Australia, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of National ICT Australia, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on National ICT - * Australia or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of National ICT Australia or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ - -#ifndef THREAD_SAFE -int errno; -#endif diff --git a/loader/libs/c/src/exit.c b/loader/libs/c/src/exit.c deleted file mode 100644 index fd35710..0000000 --- a/loader/libs/c/src/exit.c +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 National ICT Australia - * - * All rights reserved. - * - * Developed by: Embedded, Real-time and Operating Systems Program (ERTOS) - * National ICT Australia - * http://www.ertos.nicta.com.au - * - * Permission is granted by National ICT Australia, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of National ICT Australia, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on National ICT - * Australia or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of National ICT Australia or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ -/* - Author: Ben Leslie - Created: Wed Oct 6 2004 -*/ -#include - -void -exit(int status) -{ - /* Call registered atexit() functions */ - - /* Flush unbuffered data */ - - /* Close all streams */ - - /* Remove anything created by tmpfile() */ - - /* Call _Exit() */ - _Exit(status); -} - diff --git a/loader/libs/c/src/fclose.c b/loader/libs/c/src/fclose.c deleted file mode 100644 index 98264e8..0000000 --- a/loader/libs/c/src/fclose.c +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 National ICT Australia - * - * All rights reserved. - * - * Developed by: Embedded, Real-time and Operating Systems Program (ERTOS) - * National ICT Australia - * http://www.ertos.nicta.com.au - * - * Permission is granted by National ICT Australia, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of National ICT Australia, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on National ICT - * Australia or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of National ICT Australia or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ - -#include -#include - -int -fclose(FILE *stream) -{ - int r; - lock_stream(stream); - r = stream->close_fn(stream->handle); - /* fflush file */ - unlock_stream(stream); - return r; -} diff --git a/loader/libs/c/src/feof.c b/loader/libs/c/src/feof.c deleted file mode 100644 index caddfb0..0000000 --- a/loader/libs/c/src/feof.c +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 National ICT Australia - * - * All rights reserved. - * - * Developed by: Embedded, Real-time and Operating Systems Program (ERTOS) - * National ICT Australia - * http://www.ertos.nicta.com.au - * - * Permission is granted by National ICT Australia, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of National ICT Australia, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on National ICT - * Australia or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of National ICT Australia or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ -#include - -int -feof(FILE *f) -{ - int res; - lock_stream(f); - res = f->eof; - unlock_stream(f); - return res; -} diff --git a/loader/libs/c/src/ferror.c b/loader/libs/c/src/ferror.c deleted file mode 100644 index c94feec..0000000 --- a/loader/libs/c/src/ferror.c +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 National ICT Australia - * - * All rights reserved. - * - * Developed by: Embedded, Real-time and Operating Systems Program (ERTOS) - * National ICT Australia - * http://www.ertos.nicta.com.au - * - * Permission is granted by National ICT Australia, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of National ICT Australia, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on National ICT - * Australia or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of National ICT Australia or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ -#include - -int -ferror(FILE *stream) -{ - int res; - lock_stream(stream); - res = stream->error; - unlock_stream(stream); - return res; -} diff --git a/loader/libs/c/src/fflush.c b/loader/libs/c/src/fflush.c deleted file mode 100644 index 9784b9b..0000000 --- a/loader/libs/c/src/fflush.c +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 National ICT Australia - * - * All rights reserved. - * - * Developed by: Embedded, Real-time and Operating Systems Program (ERTOS) - * National ICT Australia - * http://www.ertos.nicta.com.au - * - * Permission is granted by National ICT Australia, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of National ICT Australia, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on National ICT - * Australia or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of National ICT Australia or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ - -#include - -int -fflush(FILE *file) -{ - lock_stream(file); - /* FIXME: printf("WARNING: fflush not implemented\n"); */ - unlock_stream(file); - return 0; -} diff --git a/loader/libs/c/src/fgetc.c b/loader/libs/c/src/fgetc.c deleted file mode 100644 index d6c2ddf..0000000 --- a/loader/libs/c/src/fgetc.c +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 National ICT Australia - * - * All rights reserved. - * - * Developed by: Embedded, Real-time and Operating Systems Program (ERTOS) - * National ICT Australia - * http://www.ertos.nicta.com.au - * - * Permission is granted by National ICT Australia, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of National ICT Australia, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on National ICT - * Australia or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of National ICT Australia or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ - -#include - -int -fgetc(FILE *stream) -{ - unsigned char ch; - - lock_stream(stream); - if (stream->unget_pos) { - ch = stream->unget_stack[--stream->unget_pos]; - unlock_stream(stream); - return (int) ch; - } - - /* This is where we should do input buffering */ - if (stream->read_fn(&ch, stream->current_pos, 1, stream->handle) == 1) { - /* Success */ - stream->current_pos++; - unlock_stream(stream); - return (int) ch; - } else { - stream->eof = 1; - unlock_stream(stream); - return EOF; - } -} diff --git a/loader/libs/c/src/fgets.c b/loader/libs/c/src/fgets.c deleted file mode 100644 index 7642040..0000000 --- a/loader/libs/c/src/fgets.c +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 National ICT Australia - * - * All rights reserved. - * - * Developed by: Embedded, Real-time and Operating Systems Program (ERTOS) - * National ICT Australia - * http://www.ertos.nicta.com.au - * - * Permission is granted by National ICT Australia, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of National ICT Australia, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on National ICT - * Australia or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of National ICT Australia or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ - -#include -#include - -char * -fgets(char *s, int n, FILE *stream) -{ - int i; - int c = EOF; - - lock_stream(stream); - for (i = 0; i < n-1; i++) { - c = fgetc(stream); - if (c == EOF) { - break; - } - s[i] = (char) c; - if (c == '\n') { - break; - } - } - unlock_stream(stream); - - s[i+1] = '\0'; - if (c == EOF && i == 0) { - return NULL; - } else { - return s; - } -} diff --git a/loader/libs/c/src/fputs.c b/loader/libs/c/src/fputs.c deleted file mode 100644 index b6d24cb..0000000 --- a/loader/libs/c/src/fputs.c +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 National ICT Australia - * - * All rights reserved. - * - * Developed by: Embedded, Real-time and Operating Systems Program (ERTOS) - * National ICT Australia - * http://www.ertos.nicta.com.au - * - * Permission is granted by National ICT Australia, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of National ICT Australia, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on National ICT - * Australia or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of National ICT Australia or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ - -#include -#include - -int -fputs(const char *s, FILE *stream) -{ - int c, len = strlen(s); - /* This function does not need to lock the stream as fwrite will - * handle the locking. */ - c = fwrite(s, 1, len, stream); - if (c < len) { - return EOF; - } else { - return 1; - } -} diff --git a/loader/libs/c/src/fread.c b/loader/libs/c/src/fread.c deleted file mode 100644 index f3b13dd..0000000 --- a/loader/libs/c/src/fread.c +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 National ICT Australia - * - * All rights reserved. - * - * Developed by: Embedded, Real-time and Operating Systems Program (ERTOS) - * National ICT Australia - * http://www.ertos.nicta.com.au - * - * Permission is granted by National ICT Australia, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of National ICT Australia, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on National ICT - * Australia or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of National ICT Australia or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ - -#include - -size_t -fread(void *ptr, size_t size, size_t nmemb, FILE *stream) -{ - size_t elems, sz; - unsigned char *p = ptr; - - lock_stream(stream); - for(elems = 0; elems < nmemb; elems++) { - for(sz = 0; sz < size; sz++, p++) { - int ch; - if ((ch = fgetc(stream)) == EOF) { - goto out; - } - *p = (unsigned char) ch; - } - } -out: - unlock_stream(stream); - return elems; -} diff --git a/loader/libs/c/src/fscanf.c b/loader/libs/c/src/fscanf.c deleted file mode 100644 index 3d45a27..0000000 --- a/loader/libs/c/src/fscanf.c +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 National ICT Australia - * - * All rights reserved. - * - * Developed by: Embedded, Real-time and Operating Systems Program (ERTOS) - * National ICT Australia - * http://www.ertos.nicta.com.au - * - * Permission is granted by National ICT Australia, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of National ICT Australia, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on National ICT - * Australia or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of National ICT Australia or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ - -#include - -int -fscanf(FILE *stream, const char *fmt, ...) -{ - return 0; -} - diff --git a/loader/libs/c/src/fseek.c b/loader/libs/c/src/fseek.c deleted file mode 100644 index 7a7f04d..0000000 --- a/loader/libs/c/src/fseek.c +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 National ICT Australia - * - * All rights reserved. - * - * Developed by: Embedded, Real-time and Operating Systems Program (ERTOS) - * National ICT Australia - * http://www.ertos.nicta.com.au - * - * Permission is granted by National ICT Australia, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of National ICT Australia, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on National ICT - * Australia or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of National ICT Australia or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ - -#include -#include - -int -fseek(FILE *stream, long int offset, int whence) -{ - int res = 0; - lock_stream(stream); - switch(whence) { - case SEEK_SET: - stream->current_pos = offset; - break; - case SEEK_CUR: - stream->current_pos += offset; - break; - case SEEK_END: - stream->current_pos = stream->eof_fn(stream->handle) + offset; - break; - default: - res = -1; - } - unlock_stream(stream); - return res; -} diff --git a/loader/libs/c/src/ftell.c b/loader/libs/c/src/ftell.c deleted file mode 100644 index 017fa3b..0000000 --- a/loader/libs/c/src/ftell.c +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 National ICT Australia - * - * All rights reserved. - * - * Developed by: Embedded, Real-time and Operating Systems Program (ERTOS) - * National ICT Australia - * http://www.ertos.nicta.com.au - * - * Permission is granted by National ICT Australia, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of National ICT Australia, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on National ICT - * Australia or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of National ICT Australia or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ - -#include - -long int -ftell(FILE *stream) -{ - int res; - lock_stream(stream); - res = stream->current_pos; - unlock_stream(stream); - return res; -} diff --git a/loader/libs/c/src/fwrite.c b/loader/libs/c/src/fwrite.c deleted file mode 100644 index 0f2b35c..0000000 --- a/loader/libs/c/src/fwrite.c +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 National ICT Australia - * - * All rights reserved. - * - * Developed by: Embedded, Real-time and Operating Systems Program (ERTOS) - * National ICT Australia - * http://www.ertos.nicta.com.au - * - * Permission is granted by National ICT Australia, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of National ICT Australia, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on National ICT - * Australia or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of National ICT Australia or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ -/* -Author: Ben Leslie -*/ - -#include - -size_t -fwrite(const void * ptr, size_t size, size_t nmemb, FILE * stream) -{ - size_t elems, sz; - const unsigned char *p = ptr; - - lock_stream(stream); - for(elems = 0; elems < nmemb; elems++) { - for(sz = 0; sz < size; sz++, p++) { - if (fputc(*p, stream) == EOF) { - goto out; - } - } - } -out: - unlock_stream(stream); - return elems; -} diff --git a/loader/libs/c/src/getchar.c b/loader/libs/c/src/getchar.c deleted file mode 100644 index 1760344..0000000 --- a/loader/libs/c/src/getchar.c +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 National ICT Australia - * - * All rights reserved. - * - * Developed by: Embedded, Real-time and Operating Systems Program (ERTOS) - * National ICT Australia - * http://www.ertos.nicta.com.au - * - * Permission is granted by National ICT Australia, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of National ICT Australia, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on National ICT - * Australia or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of National ICT Australia or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ -/* -Authors: Ben Leslie -*/ - -#include - -int -getchar(void) -{ - return fgetc(stdin); -} diff --git a/loader/libs/c/src/getenv.c b/loader/libs/c/src/getenv.c deleted file mode 100644 index 7a0c37e..0000000 --- a/loader/libs/c/src/getenv.c +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 National ICT Australia - * - * All rights reserved. - * - * Developed by: Embedded, Real-time and Operating Systems Program (ERTOS) - * National ICT Australia - * http://www.ertos.nicta.com.au - * - * Permission is granted by National ICT Australia, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of National ICT Australia, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on National ICT - * Australia or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of National ICT Australia or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ - -#include -#include - -char * -getenv(const char *name) -{ - printf("WARNING: getenv not implemented\n"); - return NULL; -} diff --git a/loader/libs/c/src/gmtime.c b/loader/libs/c/src/gmtime.c deleted file mode 100644 index 43b1e22..0000000 --- a/loader/libs/c/src/gmtime.c +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 National ICT Australia - * - * All rights reserved. - * - * Developed by: Embedded, Real-time and Operating Systems Program (ERTOS) - * National ICT Australia - * http://www.ertos.nicta.com.au - * - * Permission is granted by National ICT Australia, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of National ICT Australia, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on National ICT - * Australia or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of National ICT Australia or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ - -#include - -struct tm * -gmtime(const time_t *timer) -{ - return NULL; -} diff --git a/loader/libs/c/src/k_r_malloc.h b/loader/libs/c/src/k_r_malloc.h deleted file mode 100644 index a291d05..0000000 --- a/loader/libs/c/src/k_r_malloc.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef _LIBC_K_R_MALLOC_H_ -#define _LIBC_K_R_MALLOC_H_ - -#define NALLOC 0x10000 /* minimum #units to request */ - -typedef long long Align; /* for alignment to long long boundary */ - -union header { /* block header */ - struct { - union header *ptr; /* next block if on free list */ - unsigned size; /* size of this block */ - } s; - Align x; /* force alignment of blocks */ -}; - -typedef union header Header; - -Header *morecore(unsigned nu); -void __malloc_init(void*, void*); -#endif /* _LIBC_K_R_MALLOC_H_ */ diff --git a/loader/libs/c/src/locale.c b/loader/libs/c/src/locale.c deleted file mode 100644 index 7d48b64..0000000 --- a/loader/libs/c/src/locale.c +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 National ICT Australia - * - * All rights reserved. - * - * Developed by: Embedded, Real-time and Operating Systems Program (ERTOS) - * National ICT Australia - * http://www.ertos.nicta.com.au - * - * Permission is granted by National ICT Australia, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of National ICT Australia, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on National ICT - * Australia or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of National ICT Australia or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ - -#include -#include - -#define CHAR_MAX 0 -struct lconv current_locale = { - ".", //decimal_point - "", //thousands_sep - "", //grouping - "", //mon_deciaml_point - "", //mon_thouasands_sep - "", //mon_grouping - "", //positive_sign - "", //negative_sign - "", //currency_symbol - CHAR_MAX, //frac_digits - CHAR_MAX, //p_cs_precedes - CHAR_MAX, //n_cs_precedes - CHAR_MAX, //p_sep_by_space - CHAR_MAX, //n_sep_by_space - CHAR_MAX, //p_sign_posn - CHAR_MAX, //n_sign_posn - "", //int_curr_symbol - CHAR_MAX, //int_frac_digits - CHAR_MAX, //int_p_cs_precedes - CHAR_MAX, //int_n_cs_precedes - CHAR_MAX, //int_p_sep_by_space - CHAR_MAX, //int_n_sep_by_space - CHAR_MAX, //int_p_sign_posn - CHAR_MAX //int_n_sign_posn -}; - -char * -setlocale(int category, const char *locale) -{ - if (strcmp(locale, "C") == 0) { - return "C"; - } - if (strcmp(locale, "") == 0) { - return "C"; - } - - return NULL; -} - -struct lconv * -localeconv(void) -{ - return ¤t_locale; -} diff --git a/loader/libs/c/src/localtime.c b/loader/libs/c/src/localtime.c deleted file mode 100644 index 7e7dd78..0000000 --- a/loader/libs/c/src/localtime.c +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 National ICT Australia - * - * All rights reserved. - * - * Developed by: Embedded, Real-time and Operating Systems Program (ERTOS) - * National ICT Australia - * http://www.ertos.nicta.com.au - * - * Permission is granted by National ICT Australia, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of National ICT Australia, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on National ICT - * Australia or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of National ICT Australia or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ - -#include - -struct tm * -localtime(const time_t *timer) -{ - return NULL; -} diff --git a/loader/libs/c/src/malloc.c b/loader/libs/c/src/malloc.c deleted file mode 100644 index be3a654..0000000 --- a/loader/libs/c/src/malloc.c +++ /dev/null @@ -1,206 +0,0 @@ - -/* - * K&R Malloc - * - * System specifc code should implement `more_core' - */ -#include "k_r_malloc.h" -#include /* For NULL */ -#include -#include /* For memcpy */ - -#ifdef THREAD_SAFE -#include -extern struct mutex malloc_mutex; -struct mutex malloc_mutex; - -#define MALLOC_LOCK mutex_count_lock(&malloc_mutex) -#define MALLOC_UNLOCK mutex_count_unlock(&malloc_mutex) -#else -#define MALLOC_LOCK -#define MALLOC_UNLOCK -#endif - -static Header base; /* empty list to get started */ -Header *_kr_malloc_freep = NULL; /* start of free list */ -#define freep _kr_malloc_freep - -#ifdef CONFIG_MALLOC_INSTRUMENT -size_t __malloc_instrumented_allocated; -#endif - -#ifdef CONFIG_MALLOC_DEBUG_INTERNAL -#include -#include -int __malloc_check(void); -void __malloc_dump(void); -#endif - -/* - * malloc: general-purpose storage allocator - */ -void * -malloc(size_t nbytes) -{ - Header *p, *prevp; - unsigned nunits; - nunits = (nbytes + sizeof(Header) - 1) / sizeof(Header) + 1; - - MALLOC_LOCK; - if ((prevp = freep) == NULL) { /* no free list yet */ - base.s.ptr = freep = prevp = &base; - base.s.size = 0; - } - for (p = prevp->s.ptr;; prevp = p, p = p->s.ptr) { - if (p->s.size >= nunits) { /* big enough */ - if (p->s.size == nunits) /* exactly */ - prevp->s.ptr = p->s.ptr; - else { /* allocate tail end */ - p->s.size -= nunits; - p += p->s.size; - p->s.size = nunits; - } - freep = prevp; -#ifdef CONFIG_MALLOC_DEBUG - { - /* Write bit pattern over data */ - char *x = (char *) (p + 1); - int i; - for (i = 0; i < nbytes; i++) - x[i] = 0xd0; - } -#endif - -#ifdef CONFIG_MALLOC_INSTRUMENT - __malloc_instrumented_allocated += nunits; -#endif -#ifdef CONFIG_MALLOC_DEBUG_INTERNAL - if (__malloc_check() != 0) { - printf("malloc %d %p\n", nbytes, (void *) (p + 1)); - __malloc_dump(); - assert(__malloc_check() == 0); - } -#endif - MALLOC_UNLOCK; - return (void *) (p + 1); - } - if (p == freep) { /* wrapped around free list */ - if ((p = (Header *) morecore(nunits)) == NULL) { - MALLOC_UNLOCK; - return NULL; /* none left */ - } else { - - } - } - } - MALLOC_UNLOCK; -} - -/* - * free: put block ap in free list - */ -void -free(void *ap) -{ - Header *bp, *p; - - if (ap == NULL) - return; - - MALLOC_LOCK; - bp = (Header *) ap - 1; /* point to block header */ - for (p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr) - if (p >= p->s.ptr && (bp > p || bp < p->s.ptr)) - break; /* freed block at start or end of arena */ - -#ifdef CONFIG_MALLOC_INSTRUMENT - __malloc_instrumented_allocated -= bp->s.size; -#endif - - if (bp + bp->s.size == p->s.ptr) { /* join to upper nbr */ - bp->s.size += p->s.ptr->s.size; - bp->s.ptr = p->s.ptr->s.ptr; - } else { - bp->s.ptr = p->s.ptr; - } - - if (p + p->s.size == bp) { /* join to lower nbr */ - p->s.size += bp->s.size; - p->s.ptr = bp->s.ptr; - } else { - p->s.ptr = bp; - } - - freep = p; - -#ifdef CONFIG_MALLOC_DEBUG_INTERNAL - if (__malloc_check() != 0) { - printf("free %p\n", ap); - __malloc_dump(); - assert(__malloc_check() == 0); - } -#endif - MALLOC_UNLOCK; -} - -#ifdef CONFIG_MALLOC_DEBUG_INTERNAL - -int -__malloc_check(void) -{ - Header *p, *prevp; - if ((prevp = freep) == NULL) { /* no free list yet */ - return 0; - } - for (p = prevp->s.ptr;; prevp = p, p = p->s.ptr) { - if ((void*) p == NULL) { - return 1; - } - /* Free bits should be in order */ - if (p > p->s.ptr && p != &base) { - return 1; - } - if ((uintptr_t) p + (p->s.size * sizeof(Header)) > (uintptr_t) p->s.ptr && p != &base) { - return 1; - } - /* shouldn't have zero sized free bits */ - if (p->s.size == 0 && p != &base) { - return 1; - } - if (p == freep) { /* wrapped around free list */ - break; - } - } - return 0; -} - -void -__malloc_dump(void) -{ - Header *p, *prevp; - if ((prevp = freep) == NULL) { /* no free list yet */ - return; - } - printf("Malloc dump\n"); - for (p = prevp->s.ptr;; prevp = p, p = p->s.ptr) { - if (p > p->s.ptr && p != &base) { - printf("* "); - } - if (p->s.size == 0 && p != &base) { - printf("# "); - } - if ((uintptr_t) p + (p->s.size * sizeof(Header)) > (uintptr_t) p->s.ptr && p != &base) { - printf("$ "); - } - if (p == &base) { - printf(" p: \n"); - } else { - printf(" p: %p (%d) -> %p\n", p, p->s.size, p->s.ptr); - } - assert(p != NULL); - if (p == freep) { /* wrapped around free list */ - return; - } - } -} -#endif diff --git a/loader/libs/c/src/memchr.c b/loader/libs/c/src/memchr.c deleted file mode 100644 index 921114e..0000000 --- a/loader/libs/c/src/memchr.c +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 National ICT Australia - * - * All rights reserved. - * - * Developed by: Embedded, Real-time and Operating Systems Program (ERTOS) - * National ICT Australia - * http://www.ertos.nicta.com.au - * - * Permission is granted by National ICT Australia, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of National ICT Australia, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on National ICT - * Australia or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of National ICT Australia or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ -/* - Authors: Ben Leslie - Created: Wed Aug 4 13:37:35 EST 2004 -*/ - -#include - -/* - * return pointer to first occurrence of c in s - */ -/* THREAD SAFE */ -void * -memchr(const void *s, int c, size_t n) -{ - const char *p = (const char *) s; - - while (n--) { - if (*p == c) { - return (void *) p; - } - p++; - } - - return NULL; -} diff --git a/loader/libs/c/src/memcmp.c b/loader/libs/c/src/memcmp.c deleted file mode 100644 index f26db10..0000000 --- a/loader/libs/c/src/memcmp.c +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 University of New South Wales - * - * All rights reserved. - * - * Developed by: Operating Systems and Distributed Systems Group (DiSy) - * University of New South Wales - * http://www.disy.cse.unsw.edu.au - * - * Permission is granted by University of New South Wales, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of University of New South Wales, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on University of New South - * Wales or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of University of New South Wales or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ -/* - Author: Cristan Szmadja -*/ -#include - -/* THREAD SAFE */ -int -memcmp(const void *s1, const void *s2, size_t n) -{ - size_t i; - int diff; - - for (i = 0; i < n; i++) { - diff = - ((unsigned char *) s1)[i] - ((unsigned char *) s2)[i]; - if (diff != 0) - return diff; - } - return 0; -} diff --git a/loader/libs/c/src/memmove.c b/loader/libs/c/src/memmove.c deleted file mode 100644 index ea3002b..0000000 --- a/loader/libs/c/src/memmove.c +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 University of New South Wales - * - * All rights reserved. - * - * Developed by: Operating Systems and Distributed Systems Group (DiSy) - * University of New South Wales - * http://www.disy.cse.unsw.edu.au - * - * Permission is granted by University of New South Wales, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of University of New South Wales, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on University of New South - * Wales or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of University of New South Wales or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ -/* - Author: Cristan Szmadja -*/ -#include - -/* - * copy n bytes from s to d, even if the regions overlap - */ -/* THREAD SAFE */ -void * -memmove(void *d, const void *s, size_t n) -{ - size_t i; - - if (s >= d || (void*) ((char *) s + n) <= d) { - return memcpy(d, s, n); /* memcpy is ascending */ - } else { - /* - * XXX copy 1 byte at a time - */ - for (i = n ; i > 0; i--) { - ((char *) d)[i-1] = ((const char *) s)[i-1]; - } - return d; - } -} diff --git a/loader/libs/c/src/mktime.c b/loader/libs/c/src/mktime.c deleted file mode 100644 index 83fb7dd..0000000 --- a/loader/libs/c/src/mktime.c +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 National ICT Australia - * - * All rights reserved. - * - * Developed by: Embedded, Real-time and Operating Systems Program (ERTOS) - * National ICT Australia - * http://www.ertos.nicta.com.au - * - * Permission is granted by National ICT Australia, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of National ICT Australia, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on National ICT - * Australia or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of National ICT Australia or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ -#include - -time_t -mktime(struct tm *timeptr) -{ - /* Not currently implemented */ - return (time_t)(-1); -} diff --git a/loader/libs/c/src/perror.c b/loader/libs/c/src/perror.c deleted file mode 100644 index 16c8ba3..0000000 --- a/loader/libs/c/src/perror.c +++ /dev/null @@ -1,10 +0,0 @@ -/* - * A temporary mock-up perror implementation just - * for quick testing purposes. When a proper C library is - * ported, its implementation should be used. - * - * Copyright (C) 2008 Bahadir Balban - */ -#include - - diff --git a/loader/libs/c/src/putchar.c b/loader/libs/c/src/putchar.c deleted file mode 100644 index 25572e0..0000000 --- a/loader/libs/c/src/putchar.c +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 National ICT Australia - * - * All rights reserved. - * - * Developed by: Embedded, Real-time and Operating Systems Program (ERTOS) - * National ICT Australia - * http://www.ertos.nicta.com.au - * - * Permission is granted by National ICT Australia, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of National ICT Australia, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on National ICT - * Australia or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of National ICT Australia or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ -/* -Authors: Ben Leslie -*/ - -#include - -int -putchar(int c) -{ - return fputc(c, stdout); -} diff --git a/loader/libs/c/src/puts.c b/loader/libs/c/src/puts.c deleted file mode 100644 index 4c8f317..0000000 --- a/loader/libs/c/src/puts.c +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 National ICT Australia - * - * All rights reserved. - * - * Developed by: Embedded, Real-time and Operating Systems Program (ERTOS) - * National ICT Australia - * http://www.ertos.nicta.com.au - * - * Permission is granted by National ICT Australia, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of National ICT Australia, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on National ICT - * Australia or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of National ICT Australia or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ -#include - -int -puts(const char *s) -{ - while(*s != '\0') - fputc(*s++, stdout); - fputc('\n', stdout); - return 0; -} diff --git a/loader/libs/c/src/qsort.c b/loader/libs/c/src/qsort.c deleted file mode 100644 index 47a5a62..0000000 --- a/loader/libs/c/src/qsort.c +++ /dev/null @@ -1,40 +0,0 @@ -#include -#include -#include -#include - -static -void swap(void *base, size_t i, size_t j, size_t size) -{ - void *tmp = malloc(size); - - assert(tmp); - - memcpy(tmp, (char*) base + i * size, size); - memmove((char*) base + i * size, (char*) base + j * size, size); - memcpy((char*) base + j * size, tmp, size); - free(tmp); -} - -/* qsort: sort v[left]...v[right] into increasing order */ -void -qsort(void *base, size_t nmemb, size_t size, - int(*compar)(const void *, const void *)) -{ - int i, last; - - if (nmemb <= 1) - return; - - swap(base, 0, nmemb / 2, size); - - last = 0; - for (i = 1; i < nmemb; i++) - if (compar((char*) base + (i * size), base) < 0) - swap(base, i, ++last, size); - - swap(base, 0, last, size); - - qsort(base, last, size, compar); - qsort((char*) base + (last + 1) * size, nmemb - last - 1, size, compar); -} diff --git a/loader/libs/c/src/rand.c b/loader/libs/c/src/rand.c deleted file mode 100644 index 25688b7..0000000 --- a/loader/libs/c/src/rand.c +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 National ICT Australia - * - * All rights reserved. - * - * Developed by: Embedded, Real-time and Operating Systems Program (ERTOS) - * National ICT Australia - * http://www.ertos.nicta.com.au - * - * Permission is granted by National ICT Australia, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of National ICT Australia, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on National ICT - * Australia or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of National ICT Australia or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ -/* - Author: Ben Leslie - Description: Implementation of Pseudo-random numbers for libc (7.20.2) - Note: These are *NOT* good ranndom numbers. The algorithm used is - straight from the ISOC99 specification. -*/ -#include - -unsigned long int _rand_next = 1; - -/* not required to be thread safe by posix */ -int -rand(void) -{ - _rand_next = _rand_next * 1103515245 + 12345; - return (unsigned int) (_rand_next/65536) % 32768; -} diff --git a/loader/libs/c/src/realloc.c b/loader/libs/c/src/realloc.c deleted file mode 100644 index 22c07f4..0000000 --- a/loader/libs/c/src/realloc.c +++ /dev/null @@ -1,33 +0,0 @@ -/* - * K&R Malloc - * - * System specifc code should implement `more_core' - */ - -#include "k_r_malloc.h" -#include -#include - -void * -realloc(void *ptr, size_t size) -{ - Header *bp; - void *new_ptr; - size_t old_size; - - if (ptr == NULL) - return malloc(size); - bp = (Header *) ptr - 1; /* point to block header */ - old_size = sizeof(Header) * bp->s.size; - new_ptr = malloc(size); - if (new_ptr == NULL) { - return NULL; - } - if (old_size <= size) { - memcpy(new_ptr, ptr, old_size); - } else { - memcpy(new_ptr, ptr, size); - } - free(ptr); - return new_ptr; -} diff --git a/loader/libs/c/src/remove.c b/loader/libs/c/src/remove.c deleted file mode 100644 index c4a7b22..0000000 --- a/loader/libs/c/src/remove.c +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 National ICT Australia - * - * All rights reserved. - * - * Developed by: Embedded, Real-time and Operating Systems Program (ERTOS) - * National ICT Australia - * http://www.ertos.nicta.com.au - * - * Permission is granted by National ICT Australia, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of National ICT Australia, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on National ICT - * Australia or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of National ICT Australia or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ -#include - -int -remove(const char *filename) -{ - return 1; /* Always return failure */ -} diff --git a/loader/libs/c/src/rename.c b/loader/libs/c/src/rename.c deleted file mode 100644 index d1fd0e7..0000000 --- a/loader/libs/c/src/rename.c +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 National ICT Australia - * - * All rights reserved. - * - * Developed by: Embedded, Real-time and Operating Systems Program (ERTOS) - * National ICT Australia - * http://www.ertos.nicta.com.au - * - * Permission is granted by National ICT Australia, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of National ICT Australia, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on National ICT - * Australia or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of National ICT Australia or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ -#include - -int -rename(const char *old, const char *new) -{ - return 1; /* Always return failure */ -} diff --git a/loader/libs/c/src/rewind.c b/loader/libs/c/src/rewind.c deleted file mode 100644 index 151159c..0000000 --- a/loader/libs/c/src/rewind.c +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 National ICT Australia - * - * All rights reserved. - * - * Developed by: Embedded, Real-time and Operating Systems Program (ERTOS) - * National ICT Australia - * http://www.ertos.nicta.com.au - * - * Permission is granted by National ICT Australia, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of National ICT Australia, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on National ICT - * Australia or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of National ICT Australia or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ - -#include - -void -rewind(FILE *stream) -{ - /* This function is not locked as fseek will handle the locking. */ - (void) fseek(stream, 0L, SEEK_SET); -} diff --git a/loader/libs/c/src/snprintf.c b/loader/libs/c/src/snprintf.c deleted file mode 100644 index 849fe4d..0000000 --- a/loader/libs/c/src/snprintf.c +++ /dev/null @@ -1,20 +0,0 @@ -/* -Author: Ben Leslie -*/ - -#include -#include "format.h" - -#include - -int -snprintf(char *s, size_t size, const char *format, ...) -{ - int ret; - va_list ap; - - va_start(ap, format); - ret = vsnprintf(s, size, format, ap); - va_end(ap); - return ret; -} diff --git a/loader/libs/c/src/sprintf.c b/loader/libs/c/src/sprintf.c deleted file mode 100644 index 210e2fb..0000000 --- a/loader/libs/c/src/sprintf.c +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 National ICT Australia - * - * All rights reserved. - * - * Developed by: Embedded, Real-time and Operating Systems Program (ERTOS) - * National ICT Australia - * http://www.ertos.nicta.com.au - * - * Permission is granted by National ICT Australia, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of National ICT Australia, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on National ICT - * Australia or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of National ICT Australia or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ -/* -Author: Ben Leslie -*/ - -#include -#include "format.h" - -#include - -int -sprintf(char *s, const char *format, ...) -{ - int ret; - va_list ap; - - va_start(ap, format); - ret = vsprintf(s, format, ap); - va_end(ap); - return ret; -} - -int -vsprintf(char *s, const char *format, va_list arg) -{ - return format_string(s, NULL, 0, -1, format, arg); -} diff --git a/loader/libs/c/src/srand.c b/loader/libs/c/src/srand.c deleted file mode 100644 index 16a9cbb..0000000 --- a/loader/libs/c/src/srand.c +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2005 National ICT Australia - * - * All rights reserved. - * - * Developed by: Embedded, Real-time and Operating Systems Program (ERTOS) - * National ICT Australia - * http://www.ertos.nicta.com.au - * - * Permission is granted by National ICT Australia, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of National ICT Australia, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on National ICT - * Australia or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of National ICT Australia or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ -/* - Author: Ben Leslie -*/ -#include - -extern unsigned long int _rand_next; - -void -srand(unsigned int seed) -{ - _rand_next = seed; -} diff --git a/loader/libs/c/src/strcat.c b/loader/libs/c/src/strcat.c deleted file mode 100644 index 94c43d9..0000000 --- a/loader/libs/c/src/strcat.c +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 University of New South Wales - * - * All rights reserved. - * - * Developed by: Operating Systems and Distributed Systems Group (DiSy) - * University of New South Wales - * http://www.disy.cse.unsw.edu.au - * - * Permission is granted by University of New South Wales, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of University of New South Wales, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on University of New South - * Wales or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of University of New South Wales or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ -/* - Authors: Cristan Szmadja -*/ -#include - -char * -strcat(char *s, const char *t) -{ - strcpy(s + strlen(s), t); - return s; -} diff --git a/loader/libs/c/src/strchr.c b/loader/libs/c/src/strchr.c deleted file mode 100644 index 75fbad3..0000000 --- a/loader/libs/c/src/strchr.c +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 University of New South Wales - * - * All rights reserved. - * - * Developed by: Operating Systems and Distributed Systems Group (DiSy) - * University of New South Wales - * http://www.disy.cse.unsw.edu.au - * - * Permission is granted by University of New South Wales, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of University of New South Wales, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on University of New South - * Wales or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of University of New South Wales or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ -/* - Author: Cristan Szmadja -*/ - -#include - -char * -strchr(const char *s, int c) -{ - for (; *s != '\0'; s++) - if (*s == c) - return (char *) s; - if (c == '\0') - return (char *) s; - return NULL; -} diff --git a/loader/libs/c/src/strcoll.c b/loader/libs/c/src/strcoll.c deleted file mode 100644 index c41d615..0000000 --- a/loader/libs/c/src/strcoll.c +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 National ICT Australia - * - * All rights reserved. - * - * Developed by: Embedded, Real-time and Operating Systems Program (ERTOS) - * National ICT Australia - * http://www.ertos.nicta.com.au - * - * Permission is granted by National ICT Australia, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of National ICT Australia, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on National ICT - * Australia or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of National ICT Australia or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ -#include -#include - -int -strcoll(const char *s1, const char *s2) -{ - assert(!"strcoll"); - return 0; -} diff --git a/loader/libs/c/src/strcpy.c b/loader/libs/c/src/strcpy.c deleted file mode 100644 index 0c1e5f2..0000000 --- a/loader/libs/c/src/strcpy.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 University of New South Wales - * - * All rights reserved. - * - * Developed by: Operating Systems and Distributed Systems Group (DiSy) - * University of New South Wales - * http://www.disy.cse.unsw.edu.au - * - * Permission is granted by University of New South Wales, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of University of New South Wales, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on University of New South - * Wales or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of University of New South Wales or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ -/* - Author: Cristan Szmadja -*/ -#include - -char * -strcpy(char *d, const char *s) -{ - size_t i; - - for (i = 0; (d[i] = s[i]) != '\0'; i++); - return d; -} diff --git a/loader/libs/c/src/strcspn.c b/loader/libs/c/src/strcspn.c deleted file mode 100644 index ce90eb1..0000000 --- a/loader/libs/c/src/strcspn.c +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 University of New South Wales - * - * All rights reserved. - * - * Developed by: Operating Systems and Distributed Systems Group (DiSy) - * University of New South Wales - * http://www.disy.cse.unsw.edu.au - * - * Permission is granted by University of New South Wales, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of University of New South Wales, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on University of New South - * Wales or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of University of New South Wales or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ -/* - Author: Cristan Szmadja -*/ -#include - -size_t -strcspn(const char *s, const char *charset) -{ - size_t i; - size_t len = strlen(s); - - for (i = 0; strchr(charset, s[i]) == NULL && i < len; i++); - - return i; -} diff --git a/loader/libs/c/src/strdup.c b/loader/libs/c/src/strdup.c deleted file mode 100644 index d2d4fda..0000000 --- a/loader/libs/c/src/strdup.c +++ /dev/null @@ -1,15 +0,0 @@ -#define _USE_XOPEN -#include -#include - -char * -strdup(const char *s) -{ - int len = strlen(s); - char *d; - d = malloc(len); - if (d == NULL) - return NULL; - strcpy(d, s); - return d; -} diff --git a/loader/libs/c/src/strerror.c b/loader/libs/c/src/strerror.c deleted file mode 100644 index 31b450a..0000000 --- a/loader/libs/c/src/strerror.c +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 National ICT Australia - * - * All rights reserved. - * - * Developed by: Embedded, Real-time and Operating Systems Program (ERTOS) - * National ICT Australia - * http://www.ertos.nicta.com.au - * - * Permission is granted by National ICT Australia, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of National ICT Australia, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on National ICT - * Australia or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of National ICT Australia or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ - -#include - -char * -strerror(int errnum) -{ - return "No Error"; -} diff --git a/loader/libs/c/src/strftime.c b/loader/libs/c/src/strftime.c deleted file mode 100644 index 429f3b5..0000000 --- a/loader/libs/c/src/strftime.c +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 National ICT Australia - * - * All rights reserved. - * - * Developed by: Embedded, Real-time and Operating Systems Program (ERTOS) - * National ICT Australia - * http://www.ertos.nicta.com.au - * - * Permission is granted by National ICT Australia, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of National ICT Australia, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on National ICT - * Australia or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of National ICT Australia or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ - -#include - -size_t strftime(char *s, size_t maxsize, const char *format, - const struct tm *timeptr) -{ - return 0; -} diff --git a/loader/libs/c/src/strncat.c b/loader/libs/c/src/strncat.c deleted file mode 100644 index 4a6cfa5..0000000 --- a/loader/libs/c/src/strncat.c +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 University of New South Wales - * - * All rights reserved. - * - * Developed by: Operating Systems and Distributed Systems Group (DiSy) - * University of New South Wales - * http://www.disy.cse.unsw.edu.au - * - * Permission is granted by University of New South Wales, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of University of New South Wales, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on University of New South - * Wales or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of University of New South Wales or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ -/* - Authors: Cristan Szmadja, Ben Leslie -*/ - -#include - -char * -strncat(char *d, const char *s, size_t n) -{ - if (strlen(s) < n) { - n = strlen(s); - } - strncpy(d + strlen(d), s, n); - *(d + strlen(d) + n + 1) = '\0'; - return d; -} diff --git a/loader/libs/c/src/strncpy.c b/loader/libs/c/src/strncpy.c deleted file mode 100644 index 8a14f40..0000000 --- a/loader/libs/c/src/strncpy.c +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 University of New South Wales - * - * All rights reserved. - * - * Developed by: Operating Systems and Distributed Systems Group (DiSy) - * University of New South Wales - * http://www.disy.cse.unsw.edu.au - * - * Permission is granted by University of New South Wales, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of University of New South Wales, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on University of New South - * Wales or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of University of New South Wales or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ -/* - Author: Cristan Szmadja -*/ -#include - -/* - * copy n bytes from s to d; pads with '\0' and may not '\0'-terminate - */ -char * -strncpy(char *d, const char *s, size_t n) -{ - size_t i; - - for (i = 0; i < n; i++) { - if ((d[i] = s[i]) == '\0') { - /* pad with NUL */ - for (i++; i < n; i++) { - d[i] = '\0'; - } - } - } - - return d; -} diff --git a/loader/libs/c/src/strpbrk.c b/loader/libs/c/src/strpbrk.c deleted file mode 100644 index decef9e..0000000 --- a/loader/libs/c/src/strpbrk.c +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 University of New South Wales - * - * All rights reserved. - * - * Developed by: Operating Systems and Distributed Systems Group (DiSy) - * University of New South Wales - * http://www.disy.cse.unsw.edu.au - * - * Permission is granted by University of New South Wales, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of University of New South Wales, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on University of New South - * Wales or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of University of New South Wales or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ - -/* - Author: Cristan Szmadja -*/ -#include - -/* - * search for first occurrence of any character in charset in s - */ -char * -strpbrk(const char *s, const char *charset) -{ - for (; *s != '\0'; s++) - if (strchr(charset, *s) != NULL) - return (char *) s; - return NULL; -} diff --git a/loader/libs/c/src/strrchr.c b/loader/libs/c/src/strrchr.c deleted file mode 100644 index b410170..0000000 --- a/loader/libs/c/src/strrchr.c +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 National ICT Australia - * - * All rights reserved. - * - * Developed by: Embedded, Real-time and Operating Systems Program (ERTOS) - * National ICT Australia - * http://www.ertos.nicta.com.au - * - * Permission is granted by National ICT Australia, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of National ICT Australia, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on National ICT - * Australia or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of National ICT Australia or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ - -/* - Authors: Carl van Schaik, National ICT Australia -*/ - -#include - -/* - * search for last occurrence of c in s - */ -char * -strrchr(const char *s, int c) -{ - char *r = NULL; - - if( c != '\0') { - while (*s != '\0') { - if (*s++ == c) - r = (char *)s - 1; - } - } else { - r = (char *)s + strlen(s); - } - - return r; -} diff --git a/loader/libs/c/src/strspn.c b/loader/libs/c/src/strspn.c deleted file mode 100644 index 4a7f91d..0000000 --- a/loader/libs/c/src/strspn.c +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 University of New South Wales - * - * All rights reserved. - * - * Developed by: Operating Systems and Distributed Systems Group (DiSy) - * University of New South Wales - * http://www.disy.cse.unsw.edu.au - * - * Permission is granted by University of New South Wales, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of University of New South Wales, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on University of New South - * Wales or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of University of New South Wales or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ - -/* - Author: Cristan Szmadja, Ben Leslie -*/ -#include - -size_t -strspn(const char *s, const char *charset) -{ - size_t i; - - for (i = 0; strchr(charset, s[i]) != NULL && s[i] != '\0'; i++); - return i; -} diff --git a/loader/libs/c/src/strstr.c b/loader/libs/c/src/strstr.c deleted file mode 100644 index 2919fca..0000000 --- a/loader/libs/c/src/strstr.c +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 University of New South Wales - * - * All rights reserved. - * - * Developed by: Operating Systems and Distributed Systems Group (DiSy) - * University of New South Wales - * http://www.disy.cse.unsw.edu.au - * - * Permission is granted by University of New South Wales, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of University of New South Wales, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on University of New South - * Wales or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of University of New South Wales or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ -/* - Author: Cristan Szmajda -*/ -#include -#include -/* - * search for first occurrence of substring in s - */ -char * -strstr(const char *s, const char *substring) -{ - int n = strlen(substring); - - for (; *s != '\0'; s++) - if (strncmp(s, substring, n) == 0) - return (char *) s; - - return NULL; -} diff --git a/loader/libs/c/src/strtod.c b/loader/libs/c/src/strtod.c deleted file mode 100644 index 63da782..0000000 --- a/loader/libs/c/src/strtod.c +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 National ICT Australia - * - * All rights reserved. - * - * Developed by: Embedded, Real-time and Operating Systems Program (ERTOS) - * National ICT Australia - * http://www.ertos.nicta.com.au - * - * Permission is granted by National ICT Australia, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of National ICT Australia, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on National ICT - * Australia or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of National ICT Australia or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ -#include -#include - -double -strtod(const char * nptr, - char ** endptr) -{ - assert(!"strtod called\n"); - return 0.0; -} diff --git a/loader/libs/c/src/strtok.c b/loader/libs/c/src/strtok.c deleted file mode 100644 index fecdb35..0000000 --- a/loader/libs/c/src/strtok.c +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 University of New South Wales - * - * All rights reserved. - * - * Developed by: Operating Systems and Distributed Systems Group (DiSy) - * University of New South Wales - * http://www.disy.cse.unsw.edu.au - * - * Permission is granted by University of New South Wales, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of University of New South Wales, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on University of New South - * Wales or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of University of New South Wales or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ -/* - Author: Cristan Szmadja -*/ -#include - -/* - * tokenize a string - */ -char * -strtok(char *s, const char *delim) -{ - static char *tok; - - if (s == NULL) - s = tok; /* recommence just after last token */ - s += strspn(s, delim); /* skip leading delimeters */ - if (*s == '\0') - return NULL; - tok = s + strcspn(s, delim); /* remember end of token string */ - if (*tok != '\0') - *(tok)++ = '\0'; /* terminate token string */ - return s; -} diff --git a/loader/libs/c/src/strtol.c b/loader/libs/c/src/strtol.c deleted file mode 100644 index bc5630a..0000000 --- a/loader/libs/c/src/strtol.c +++ /dev/null @@ -1,218 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 National ICT Australia - * - * All rights reserved. - * - * Developed by: Embedded, Real-time and Operating Systems Program (ERTOS) - * National ICT Australia - * http://www.ertos.nicta.com.au - * - * Permission is granted by National ICT Australia, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of National ICT Australia, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on National ICT - * Australia or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of National ICT Australia or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ -/* - Author: Ben Leslie - Created: Fri Oct 8 2004 -*/ - -#include -#include -#include -#include -#include - -/** - * Work out the numeric value of a char, assuming up to base 36 - * - * @param ch The character to decode - * - * \return Numeric value of character, or 37 on failure - */ -static inline unsigned short -char_value(char ch) -{ - if (ch >= '0' && ch <= '9') { - return ch - '0'; - } - if (ch >= 'a' && ch <= 'z') { - return ch - 'a' + 10; - } - if (ch >= 'A' && ch <= 'Z') { - return ch - 'A' + 10; - } - - return 37; -} - - -long int -strtol(const char *nptr, char **endptr, int base) -{ - /* - Decompose input info thread parts: - - inital list of whitespace (as per isspace) - - subject sequence - - final string one or more unrecognized - */ - const char *ptr = nptr; - bool negative = false; - unsigned int value; - long int return_value = 0; - /* Remove spaces */ - while(*ptr != '\0') { - if (! isspace(*ptr)) { - break; - } - ptr++; - } - - if (*ptr == '\0') - goto fail; - - /* check [+|-] */ - if (*ptr == '+') { - ptr++; - } else if (*ptr == '-') { - negative = true; - ptr++; - } - - if (*ptr == '\0') - goto fail; - - if (base == 16) { - /* _May_ have 0x prefix */ - if (*ptr == '0') { - ptr++; - if (*ptr == 'x' || *ptr == 'X') { - ptr++; - } - } - } - - /* [0(x|X)+] */ - if (base == 0) { - /* Could be hex or octal or decimal */ - if (*ptr != '0') { - base = 10; - } else { - ptr++; - if (ptr == '\0') - goto fail; - if (*ptr == 'x' || *ptr == 'X') { - base = 16; - ptr++; - } else { - base = 8; - } - } - } - - if (*ptr == '\0') - goto fail; - - /* Ok, here we have a base, and we might have a valid number */ - value = char_value(*ptr); - if (value >= base) { - goto fail; - } else { - return_value = value; - ptr++; - } - - while (*ptr != '\0' && (value = char_value(*ptr)) < base) { - return_value = return_value * base + value; - ptr++; - } - - if (endptr != NULL) - *endptr = (char*) ptr; - - if (negative) { - return_value *= -1; - } - - return return_value; - - /* - if base is 0, then we work it out based on a couple - of things - */ - /* - [+|-][0(x|X)+][0-9A-Za-z] not LL * - */ - - /* endptr == final string */ - - fail: - if (endptr != NULL) - *endptr = (char*) nptr; - return 0; - -} diff --git a/loader/libs/c/src/strtoul.c b/loader/libs/c/src/strtoul.c deleted file mode 100644 index 6c78fc2..0000000 --- a/loader/libs/c/src/strtoul.c +++ /dev/null @@ -1,218 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 National ICT Australia - * - * All rights reserved. - * - * Developed by: Embedded, Real-time and Operating Systems Program (ERTOS) - * National ICT Australia - * http://www.ertos.nicta.com.au - * - * Permission is granted by National ICT Australia, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of National ICT Australia, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on National ICT - * Australia or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of National ICT Australia or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ -/* - Author: Ben Leslie - Created: Fri Oct 8 2004 -*/ - -#include -#include -#include -#include -#include - -/** - * Work out the numeric value of a char, assuming up to base 36 - * - * @param ch The character to decode - * - * \return Numeric value of character, or 37 on failure - */ -static inline unsigned short -char_value(char ch) -{ - if (ch >= '0' && ch <= '9') { - return ch - '0'; - } - if (ch >= 'a' && ch <= 'z') { - return ch - 'a' + 10; - } - if (ch >= 'A' && ch <= 'Z') { - return ch - 'A' + 10; - } - - return 37; -} - - -unsigned long int -strtoul(const char *nptr, char **endptr, int base) -{ - /* - Decompose input info thread parts: - - inital list of whitespace (as per isspace) - - subject sequence - - final string one or more unrecognized - */ - const char *ptr = nptr; - bool negative = false; - unsigned int value; - long int return_value = 0; - /* Remove spaces */ - while(*ptr != '\0') { - if (! isspace(*ptr)) { - break; - } - ptr++; - } - - if (*ptr == '\0') - goto fail; - - /* check [+|-] */ - if (*ptr == '+') { - ptr++; - } else if (*ptr == '-') { - negative = true; - ptr++; - } - - if (*ptr == '\0') - goto fail; - - if (base == 16) { - /* _May_ have 0x prefix */ - if (*ptr == '0') { - ptr++; - if (*ptr == 'x' || *ptr == 'X') { - ptr++; - } - } - } - - /* [0(x|X)+] */ - if (base == 0) { - /* Could be hex or octal or decimal */ - if (*ptr != '0') { - base = 10; - } else { - ptr++; - if (ptr == '\0') - goto fail; - if (*ptr == 'x' || *ptr == 'X') { - base = 16; - ptr++; - } else { - base = 8; - } - } - } - - if (*ptr == '\0') - goto fail; - - /* Ok, here we have a base, and we might have a valid number */ - value = char_value(*ptr); - if (value >= base) { - goto fail; - } else { - return_value = value; - ptr++; - } - - while (*ptr != '\0' && (value = char_value(*ptr)) < base) { - return_value = return_value * base + value; - ptr++; - } - - if (endptr != NULL) - *endptr = (char*) ptr; - - if (negative) { - return_value *= -1; - } - - return return_value; - - /* - if base is 0, then we work it out based on a couple - of things - */ - /* - [+|-][0(x|X)+][0-9A-Za-z] not LL * - */ - - /* endptr == final string */ - - fail: - if (endptr != NULL) - *endptr = (char*) nptr; - return 0; - -} diff --git a/loader/libs/c/src/sys-baremetal/arch-arm/plat-pb926/platform_init.c b/loader/libs/c/src/sys-baremetal/arch-arm/plat-pb926/platform_init.c index b732a58..eb4775c 100644 --- a/loader/libs/c/src/sys-baremetal/arch-arm/plat-pb926/platform_init.c +++ b/loader/libs/c/src/sys-baremetal/arch-arm/plat-pb926/platform_init.c @@ -6,45 +6,47 @@ void platform_init(void); void platform_init(void) { + uart.base = PL011_BASE; pl011_initialise(&uart); } -/* Initialises the uart class data structures, and the device. - * Terminal-like operation is assumed for default settings. +/* + * Initialises the uart class data structures, and the device. + * Terminal-like operation is assumed for default settings. */ int pl011_initialise(struct pl011_uart * uart) { - uart->frame_errors = 0; uart->parity_errors = 0; uart->break_errors = 0; uart->overrun_errors = 0; - + /* Initialise data register for 8 bit data read/writes */ - pl011_set_word_width(8); - - /* Fifos are disabled because by default it is assumed the port - * will be used as a user terminal, and in that case the typed + pl011_set_word_width(uart->base, 8); + + /* + * Fifos are disabled because by default it is assumed the port + * will be used as a user terminal, and in that case the typed * characters will only show up when fifos are flushed, rather than * when each character is typed. We avoid this by not using fifos. */ - pl011_disable_fifos(); - + pl011_disable_fifos(uart->base); + /* Set default baud rate of 38400 */ - pl011_set_baudrate(38400, 24000000); - + pl011_set_baudrate(uart->base, 38400, 24000000); + /* Set default settings of 1 stop bit, no parity, no hw flow ctrl */ - pl011_set_stopbits(1); - pl011_parity_disable(); + pl011_set_stopbits(uart->base, 1); + pl011_parity_disable(uart->base); /* Disable all irqs */ - pl011_set_irq_mask(0x3FF); - + pl011_set_irq_mask(uart->base, 0x3FF); + /* Enable rx, tx, and uart chip */ - pl011_tx_enable(); - pl011_rx_enable(); - pl011_uart_enable(); - + pl011_tx_enable(uart->base); + pl011_rx_enable(uart->base); + pl011_uart_enable(uart->base); + return 0; } diff --git a/loader/libs/c/src/sys-baremetal/arch-arm/plat-pb926/sys_fputc.c b/loader/libs/c/src/sys-baremetal/arch-arm/plat-pb926/sys_fputc.c index 20017af..a3be510 100644 --- a/loader/libs/c/src/sys-baremetal/arch-arm/plat-pb926/sys_fputc.c +++ b/loader/libs/c/src/sys-baremetal/arch-arm/plat-pb926/sys_fputc.c @@ -1,16 +1,16 @@ /* * Australian Public Licence B (OZPLB) - * + * * Version 1-0 - * + * * Copyright (c) 2004 National ICT Australia - * - * All rights reserved. - * + * + * All rights reserved. + * * Developed by: Embedded, Real-time and Operating Systems Program (ERTOS) * National ICT Australia * http://www.ertos.nicta.com.au - * + * * Permission is granted by National ICT Australia, free of charge, to * any person obtaining a copy of this software and any associated * documentation files (the "Software") to deal with the Software without @@ -19,19 +19,19 @@ * sublicense, and/or sell, lend or rent out copies of the Software, and * to permit persons to whom the Software is furnished to do so, subject * to the following conditions: - * + * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimers. - * + * * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimers in the documentation and/or other materials provided * with the distribution. - * + * * * Neither the name of National ICT Australia, nor the names of its * contributors, may be used to endorse or promote products derived * from this Software without specific prior written permission. - * + * * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, @@ -41,7 +41,7 @@ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF * ERRORS, WHETHER OR NOT DISCOVERABLE. - * + * * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, @@ -55,7 +55,7 @@ * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, * DAMAGES OR OTHER LIABILITY. - * + * * If applicable legislation implies representations, warranties, or * conditions, or imposes obligations or liability on National ICT * Australia or one of its contributors in respect of the Software that @@ -72,90 +72,14 @@ * b. in the case of services: * i. the supplying of the services again; or * ii. the payment of the cost of having the services supplied again. - * + * * The construction, validity and performance of this licence is governed * by the laws in force in New South Wales, Australia. */ -#define MACHINE_PB926 - #include #include #include -//#define iPAQ /* FIXME: this is ugly */ -//#undef XSCALE -//#define XSCALE -// #undef iPAQ -// #define XSCALE - -extern int __fputc(int c, FILE *stream); -/* Put character for elf-loader */ -int -__fputc(int c, FILE *stream) -{ - -/* ---------------------------------- iPAQ & PLEB1 (SA-1100)--------------------------- */ -#ifdef MACHINE_IPAQ_H3800 //iPAQ // SA-1100 - volatile char *base = (char *)0x80050000; // base serial interface address - /* volatile int *base2 = (int *)0x80030000; // the other serial Arm serial i/f */ - -/* -UTSR1 32 @ 0x20: - tby <0> # Transmitter busy - rne <1> # Refeive FIFO not empty - tnf <2> # Transmitter not full - pre <3> # Parity error - fre <4> # Framing error - ror <5> # Receive FIFO overrun -*/ - -#define UTDR 0x14 // data register -#define UTSR1 0x20 // status register 1 offset -#define UTSR1_TNF (1 << 2) // tx FIFO not full (status bit) - - while ( ! ( * ( (volatile long *) (base + UTSR1)) & UTSR1_TNF )) - ; // busy wait while TX FIFO is full - *(volatile unsigned char *) (base + UTDR) = c; - // *base2 = c; -#endif - -/* ---------------------------------- PLEB2 (XSCALE PXA-255) --------------------------- */ -#ifdef MACHINE_PLEB2 //XSCALE /* PXA 255 on PLEB2 */ - -/* Console port -- taken from kernel/include/platform/pleb2/console.h */ -#define CONSOLE_OFFSET 0x100000 - -/* IO Base -- taken from kernel/include/arch/arm/xscale/cpu.h */ -#define XSCALE_PXA255_IO_BASE 0x40000000 - -#define DATAR 0x00000000 -#define STATUSR 0x00000014 - -/* TX empty bit -- uboot/include/asm/arch/hardware.h */ -#define LSR_TEMT (1 << 6) /* Transmitter Empty */ - -volatile char *base = (char *) (XSCALE_PXA255_IO_BASE + CONSOLE_OFFSET); - - /* wait for room in the tx FIFO on FFUART */ - while ( ! ( * ( (volatile long *) (base + STATUSR)) & LSR_TEMT )) - ; // busy wait while TX FIFO is full - *(volatile unsigned char *) (base + DATAR) = c; - -#endif /* XSCALE */ -#ifdef MACHINE_PB926 - { - int res; - do { - res = pl011_tx_char(c); - } while( res < 0); - } -#endif /* MACHINE_PB926 */ - return(0); -} - -/* --------------------------------- PB926 UART Driver -------------------------------- */ -#ifdef MACHINE_PB926 - extern struct pl011_uart uart; /* UART-specific internal error codes */ @@ -178,31 +102,29 @@ extern struct pl011_uart uart; #define PL011_DSR (1 << 1) #define PL011_CTS (1 << 0) -int pl011_tx_char(char c) +int pl011_tx_char(unsigned int base, char c) { - unsigned int val; - val = 0; + unsigned int val = 0; - read(val, PL011_UARTFR); + read(val, (base + PL011_UARTFR)); if(val & PL011_TXFF) { /* TX FIFO Full */ return -PL011_EAGAIN; } - write(c, PL011_UARTDR); + write(c, (base + PL011_UARTDR)); return 0; } -int pl011_rx_char(char * c) +int pl011_rx_char(unsigned int base, char * c) { unsigned int data; - unsigned int val; - val = 0; + unsigned int val = 0; - read(val, PL011_UARTFR); + read(val, (base + PL011_UARTFR)); if(val & PL011_RXFE) { /* RX FIFO Empty */ return -PL011_EAGAIN; } - read(data, PL011_UARTDR); + read(data, (base + PL011_UARTDR)); *c = (char) data; if((data >> 8) & 0xF) { /* There were errors */ @@ -211,23 +133,17 @@ int pl011_rx_char(char * c) return 0; /* No error return */ } - /* * Sets the baud rate in kbps. It is recommended to use * standard rates such as: 1200, 2400, 3600, 4800, 7200, * 9600, 14400, 19200, 28800, 38400, 57600 76800, 115200. */ -void pl011_set_baudrate(unsigned int baud, unsigned int clkrate) +void pl011_set_baudrate(unsigned int base, unsigned int baud, + unsigned int clkrate) { const unsigned int uartclk = 24000000; /* 24Mhz clock fixed on pb926 */ - unsigned int val; - unsigned int ipart, fpart; - unsigned int remainder; - - remainder = 0; - ipart = 0; - fpart = 0; - val = 0; + unsigned int val = 0; + unsigned int ipart = 0, fpart = 0; /* Use default pb926 rate if no rate is supplied */ if(clkrate == 0) { @@ -239,52 +155,60 @@ void pl011_set_baudrate(unsigned int baud, unsigned int clkrate) ipart = 39; /* clkrate / (16 * baud) */ - write(ipart, PL011_UARTIBRD); - write(fpart, PL011_UARTFBRD); + write(ipart, (base + PL011_UARTIBRD)); + write(fpart, (base + PL011_UARTFBRD)); - /* For the IBAUD and FBAUD to update, we need to + /* + * For the IBAUD and FBAUD to update, we need to * write to UARTLCR_H because the 3 registers are * actually part of a single register in hardware - * which only updates by a write to UARTLCR_H */ - read(val, PL011_UARTLCR_H); - write(val, PL011_UARTLCR_H); + * which only updates by a write to UARTLCR_H + */ + read(val, (base + PL011_UARTLCR_H)); + write(val, (base + PL011_UARTLCR_H)); return; } - /* Masks the irqs given in the flags bitvector. */ -void pl011_set_irq_mask(unsigned int flags) +void pl011_set_irq_mask(unsigned int base, unsigned int flags) { - unsigned int val; - val = 0; + unsigned int val = 0; - if(flags > 0x3FF) { /* Invalid irqmask bitvector */ + if(flags > 0x3FF) { + /* Invalid irqmask bitvector */ return; } - read(val, PL011_UARTIMSC); + read(val, (base + PL011_UARTIMSC)); val |= flags; - write(val, PL011_UARTIMSC); + write(val, (base + PL011_UARTIMSC)); return; } - /* Clears the irqs given in flags from masking */ -void pl011_clr_irq_mask(unsigned int flags) +void pl011_clr_irq_mask(unsigned int base, unsigned int flags) { - unsigned int val; - val = 0; + unsigned int val = 0; - if(flags > 0x3FF) { /* Invalid irqmask bitvector */ + if(flags > 0x3FF) { + /* Invalid irqmask bitvector */ return; } - read(val, PL011_UARTIMSC); + read(val, (base + PL011_UARTIMSC)); val &= ~flags; - write(val, PL011_UARTIMSC); + write(val, (base + PL011_UARTIMSC)); return; } +int __fputc(int c, FILE *stream) +{ + int res; + do { + res = pl011_tx_char(uart.base, c); + } while( res < 0); + + return(0); +} -#endif diff --git a/loader/libs/c/src/sys-userspace/arch-arm/plat-pb926/platform_init.c b/loader/libs/c/src/sys-userspace/arch-arm/plat-pb926/platform_init.c deleted file mode 100644 index b732a58..0000000 --- a/loader/libs/c/src/sys-userspace/arch-arm/plat-pb926/platform_init.c +++ /dev/null @@ -1,50 +0,0 @@ -#include - -struct pl011_uart uart; - -void platform_init(void); - -void platform_init(void) -{ - pl011_initialise(&uart); -} - -/* Initialises the uart class data structures, and the device. - * Terminal-like operation is assumed for default settings. - */ -int pl011_initialise(struct pl011_uart * uart) -{ - - uart->frame_errors = 0; - uart->parity_errors = 0; - uart->break_errors = 0; - uart->overrun_errors = 0; - - /* Initialise data register for 8 bit data read/writes */ - pl011_set_word_width(8); - - /* Fifos are disabled because by default it is assumed the port - * will be used as a user terminal, and in that case the typed - * characters will only show up when fifos are flushed, rather than - * when each character is typed. We avoid this by not using fifos. - */ - pl011_disable_fifos(); - - /* Set default baud rate of 38400 */ - pl011_set_baudrate(38400, 24000000); - - /* Set default settings of 1 stop bit, no parity, no hw flow ctrl */ - pl011_set_stopbits(1); - pl011_parity_disable(); - - /* Disable all irqs */ - pl011_set_irq_mask(0x3FF); - - /* Enable rx, tx, and uart chip */ - pl011_tx_enable(); - pl011_rx_enable(); - pl011_uart_enable(); - - return 0; -} - diff --git a/loader/libs/c/src/sys-userspace/arch-arm/plat-pb926/sys_fputc.c b/loader/libs/c/src/sys-userspace/arch-arm/plat-pb926/sys_fputc.c deleted file mode 100644 index ab9e008..0000000 --- a/loader/libs/c/src/sys-userspace/arch-arm/plat-pb926/sys_fputc.c +++ /dev/null @@ -1,290 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 National ICT Australia - * - * All rights reserved. - * - * Developed by: Embedded, Real-time and Operating Systems Program (ERTOS) - * National ICT Australia - * http://www.ertos.nicta.com.au - * - * Permission is granted by National ICT Australia, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of National ICT Australia, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on National ICT - * Australia or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of National ICT Australia or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ -#define MACHINE_PB926 - -#include -#include -#include - -//#define iPAQ /* FIXME: this is ugly */ -//#undef XSCALE -//#define XSCALE -// #undef iPAQ -// #define XSCALE - -extern int __fputc(int c, FILE *stream); -/* Put character for elf-loader */ -int -__fputc(int c, FILE *stream) -{ - -/* ---------------------------------- iPAQ & PLEB1 (SA-1100)--------------------------- */ -#ifdef MACHINE_IPAQ_H3800 //iPAQ // SA-1100 - volatile char *base = (char *)0x80050000; // base serial interface address - /* volatile int *base2 = (int *)0x80030000; // the other serial Arm serial i/f */ - -/* -UTSR1 32 @ 0x20: - tby <0> # Transmitter busy - rne <1> # Refeive FIFO not empty - tnf <2> # Transmitter not full - pre <3> # Parity error - fre <4> # Framing error - ror <5> # Receive FIFO overrun -*/ - -#define UTDR 0x14 // data register -#define UTSR1 0x20 // status register 1 offset -#define UTSR1_TNF (1 << 2) // tx FIFO not full (status bit) - - while ( ! ( * ( (volatile long *) (base + UTSR1)) & UTSR1_TNF )) - ; // busy wait while TX FIFO is full - *(volatile unsigned char *) (base + UTDR) = c; - // *base2 = c; -#endif - -/* ---------------------------------- PLEB2 (XSCALE PXA-255) --------------------------- */ -#ifdef MACHINE_PLEB2 //XSCALE /* PXA 255 on PLEB2 */ - -/* Console port -- taken from kernel/include/platform/pleb2/console.h */ -#define CONSOLE_OFFSET 0x100000 - -/* IO Base -- taken from kernel/include/arch/arm/xscale/cpu.h */ -#define XSCALE_PXA255_IO_BASE 0x40000000 - -#define DATAR 0x00000000 -#define STATUSR 0x00000014 - -/* TX empty bit -- uboot/include/asm/arch/hardware.h */ -#define LSR_TEMT (1 << 6) /* Transmitter Empty */ - -volatile char *base = (char *) (XSCALE_PXA255_IO_BASE + CONSOLE_OFFSET); - - /* wait for room in the tx FIFO on FFUART */ - while ( ! ( * ( (volatile long *) (base + STATUSR)) & LSR_TEMT )) - ; // busy wait while TX FIFO is full - *(volatile unsigned char *) (base + DATAR) = c; - -#endif /* XSCALE */ -#ifdef MACHINE_PB926 - { - int res; - do { - res = pl011_tx_char(c); - } while( res < 0); - } -#endif /* MACHINE_PB926 */ - return(0); -} - -/* --------------------------------- PB926 UART Driver -------------------------------- */ -#ifdef MACHINE_PB926 - -extern struct pl011_uart uart; - -/* UART-specific internal error codes */ -#define PL011_ERROR 1 -#define PL011_EAGAIN 2 - -/* Error status bits in receive status register */ -#define PL011_FE (1 << 0) -#define PL011_PE (1 << 1) -#define PL011_BE (1 << 2) -#define PL011_OE (1 << 3) - -/* Status bits in flag register */ -#define PL011_TXFE (1 << 7) -#define PL011_RXFF (1 << 6) -#define PL011_TXFF (1 << 5) -#define PL011_RXFE (1 << 4) -#define PL011_BUSY (1 << 3) -#define PL011_DCD (1 << 2) -#define PL011_DSR (1 << 1) -#define PL011_CTS (1 << 0) - -int pl011_tx_char(char c) -{ - unsigned int val; - val = 0; - - read(val, PL011_UARTFR); - if(val & PL011_TXFF) { /* TX FIFO Full */ - return -PL011_EAGAIN; - } - write(c, PL011_UARTDR); - return 0; -} - -int pl011_rx_char(char * c) -{ - unsigned int data; - unsigned int val; - val = 0; - - read(val, PL011_UARTFR); - if(val & PL011_RXFE) { /* RX FIFO Empty */ - return -PL011_EAGAIN; - } - - read(data, PL011_UARTDR); - *c = (char) data; - - if((data >> 8) & 0xF) { /* There were errors */ - return -1; /* Signal error in xfer */ - } - return 0; /* No error return */ -} - - -/* - * Sets the baud rate in kbps. It is recommended to use - * standard rates such as: 1200, 2400, 3600, 4800, 7200, - * 9600, 14400, 19200, 28800, 38400, 57600 76800, 115200. - */ -void pl011_set_baudrate(unsigned int baud, unsigned int clkrate) -{ - const unsigned int uartclk = 24000000; /* 24Mhz clock fixed on pb926 */ - unsigned int val; - unsigned int ipart, fpart; - unsigned int remainder; - - remainder = 0; - ipart = 0; - fpart = 0; - val = 0; - - /* Use default pb926 rate if no rate is supplied */ - if(clkrate == 0) { - clkrate = uartclk; - } - if(baud > 115200 || baud < 1200) { - baud = 38400; /* Default rate. */ - } - /* 24000000 / (38400 * 16) */ - ipart = 39; - - write(ipart, PL011_UARTIBRD); - write(fpart, PL011_UARTFBRD); - - /* For the IBAUD and FBAUD to update, we need to - * write to UARTLCR_H because the 3 registers are - * actually part of a single register in hardware - * which only updates by a write to UARTLCR_H */ - read(val, PL011_UARTLCR_H); - write(val, PL011_UARTLCR_H); - return; - -} - - -/* Masks the irqs given in the flags bitvector. */ -void pl011_set_irq_mask(unsigned int flags) -{ - unsigned int val; - val = 0; - - if(flags > 0x3FF) { /* Invalid irqmask bitvector */ - return; - } - - read(val, PL011_UARTIMSC); - val |= flags; - write(val, PL011_UARTIMSC); - return; -} - - -/* Clears the irqs given in flags from masking */ -void pl011_clr_irq_mask(unsigned int flags) -{ - unsigned int val; - val = 0; - - if(flags > 0x3FF) { /* Invalid irqmask bitvector */ - return; - } - - read(val, PL011_UARTIMSC); - val &= ~flags; - write(val, PL011_UARTIMSC); - return; -} - - -#endif diff --git a/loader/libs/c/src/sys-userspace/arch-arm/sys_stdio.c b/loader/libs/c/src/sys-userspace/arch-arm/sys_stdio.c deleted file mode 100644 index 75b7fea..0000000 --- a/loader/libs/c/src/sys-userspace/arch-arm/sys_stdio.c +++ /dev/null @@ -1,68 +0,0 @@ -#include -#include - -int __fputc(int c, FILE *stream); - -static int -ser_out(int c) -{ - __fputc(c, 0); - if (c == '\n') - ser_out('\r'); - return 0; -} - -static size_t -l4kdb_write(void *data, long int position, size_t count, void *handle /*unused*/) -{ - size_t i; - char *real_data = data; - for (i = 0; i < count; i++) - ser_out(real_data[i]); - return count; -} - -struct __file __stdin = { - .handle = NULL, - .read_fn = NULL, - .write_fn = NULL, - .close_fn = NULL, - .eof_fn = NULL, - .buffering_mode = _IONBF, - .buffer = NULL, - .unget_pos = 0, - .current_pos = 0, - .eof = 0 -}; - - -struct __file __stdout = { - .handle = NULL, - .read_fn = NULL, - .write_fn = l4kdb_write, - .close_fn = NULL, - .eof_fn = NULL, - .buffering_mode = _IONBF, - .buffer = NULL, - .unget_pos = 0, - .current_pos = 0, - .eof = 0 -}; - - -struct __file __stderr = { - .handle = NULL, - .read_fn = NULL, - .write_fn = l4kdb_write, - .close_fn = NULL, - .eof_fn = NULL, - .buffering_mode = _IONBF, - .buffer = NULL, - .unget_pos = 0, - .current_pos = 0, - .eof = 0 -}; - -FILE *stdin = &__stdin; -FILE *stdout = &__stdout; -FILE *stderr = &__stderr; diff --git a/loader/libs/c/src/system.c b/loader/libs/c/src/system.c deleted file mode 100644 index a4c443b..0000000 --- a/loader/libs/c/src/system.c +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 National ICT Australia - * - * All rights reserved. - * - * Developed by: Embedded, Real-time and Operating Systems Program (ERTOS) - * National ICT Australia - * http://www.ertos.nicta.com.au - * - * Permission is granted by National ICT Australia, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of National ICT Australia, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on National ICT - * Australia or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of National ICT Australia or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ - -#include - -int -system(const char *string) -{ - /* Don't suppport a command interpreter at the moment */ - return 0; -} diff --git a/loader/libs/c/src/time.c b/loader/libs/c/src/time.c deleted file mode 100644 index da44dfe..0000000 --- a/loader/libs/c/src/time.c +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 National ICT Australia - * - * All rights reserved. - * - * Developed by: Embedded, Real-time and Operating Systems Program (ERTOS) - * National ICT Australia - * http://www.ertos.nicta.com.au - * - * Permission is granted by National ICT Australia, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of National ICT Australia, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on National ICT - * Australia or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of National ICT Australia or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ -#include - -time_t -time(time_t *timer) -{ - time_t val = 0; - if (timer) - *timer = val; - return val; -} diff --git a/loader/libs/c/src/tmpfile.c b/loader/libs/c/src/tmpfile.c deleted file mode 100644 index c18cda2..0000000 --- a/loader/libs/c/src/tmpfile.c +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 National ICT Australia - * - * All rights reserved. - * - * Developed by: Embedded, Real-time and Operating Systems Program (ERTOS) - * National ICT Australia - * http://www.ertos.nicta.com.au - * - * Permission is granted by National ICT Australia, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of National ICT Australia, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on National ICT - * Australia or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of National ICT Australia or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ - -#include - -extern FILE * sys_tmpfile(void); - -FILE * -tmpfile(void) -{ - FILE *tmp = sys_tmpfile(); - if (tmp != NULL) { - /* Here we need to do additional tests - and setup */ - } - return tmp; -} diff --git a/loader/libs/c/src/ungetc.c b/loader/libs/c/src/ungetc.c deleted file mode 100644 index 60d9588..0000000 --- a/loader/libs/c/src/ungetc.c +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 National ICT Australia - * - * All rights reserved. - * - * Developed by: Embedded, Real-time and Operating Systems Program (ERTOS) - * National ICT Australia - * http://www.ertos.nicta.com.au - * - * Permission is granted by National ICT Australia, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of National ICT Australia, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on National ICT - * Australia or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of National ICT Australia or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ - -#include - -int -ungetc(int c, FILE *stream) -{ - /* - XXX: Note this isn't a full implementation of ungetc, and in particular - doesn't have the correct semantics for binary streams - */ - if (c == EOF) { - return c; - } - if (stream->unget_pos < __UNGET_SIZE) { - stream->eof = 0; - stream->unget_stack[stream->unget_pos++] = c; - return c; - } else { - return EOF; - } -} diff --git a/loader/libs/c/src/vprintf.c b/loader/libs/c/src/vprintf.c deleted file mode 100644 index 93b8cab..0000000 --- a/loader/libs/c/src/vprintf.c +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2005 National ICT Australia - * - * All rights reserved. - * - * Developed by: Embedded, Real-time and Operating Systems Program (ERTOS) - * National ICT Australia - * http://www.ertos.nicta.com.au - * - * Permission is granted by National ICT Australia, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of National ICT Australia, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on National ICT - * Australia or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of National ICT Australia or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ - -/* -Author: Ben Leslie -*/ - -#include -#include "format.h" - -int -vprintf(const char *format, va_list arg) -{ - return vfprintf(stdout, format, arg); -} - diff --git a/loader/libs/c/src/vsnprintf.c b/loader/libs/c/src/vsnprintf.c deleted file mode 100644 index d7d579b..0000000 --- a/loader/libs/c/src/vsnprintf.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Australian Public Licence B (OZPLB) - * - * Version 1-0 - * - * Copyright (c) 2004 National ICT Australia - * - * All rights reserved. - * - * Developed by: Embedded, Real-time and Operating Systems Program (ERTOS) - * National ICT Australia - * http://www.ertos.nicta.com.au - * - * Permission is granted by National ICT Australia, free of charge, to - * any person obtaining a copy of this software and any associated - * documentation files (the "Software") to deal with the Software without - * restriction, including (without limitation) the rights to use, copy, - * modify, adapt, merge, publish, distribute, communicate to the public, - * sublicense, and/or sell, lend or rent out copies of the Software, and - * to permit persons to whom the Software is furnished to do so, subject - * to the following conditions: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimers. - * - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimers in the documentation and/or other materials provided - * with the distribution. - * - * * Neither the name of National ICT Australia, nor the names of its - * contributors, may be used to endorse or promote products derived - * from this Software without specific prior written permission. - * - * EXCEPT AS EXPRESSLY STATED IN THIS LICENCE AND TO THE FULL EXTENT - * PERMITTED BY APPLICABLE LAW, THE SOFTWARE IS PROVIDED "AS-IS", AND - * NATIONAL ICT AUSTRALIA AND ITS CONTRIBUTORS MAKE NO REPRESENTATIONS, - * WARRANTIES OR CONDITIONS OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING - * BUT NOT LIMITED TO ANY REPRESENTATIONS, WARRANTIES OR CONDITIONS - * REGARDING THE CONTENTS OR ACCURACY OF THE SOFTWARE, OR OF TITLE, - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, - * THE ABSENCE OF LATENT OR OTHER DEFECTS, OR THE PRESENCE OR ABSENCE OF - * ERRORS, WHETHER OR NOT DISCOVERABLE. - * - * TO THE FULL EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL - * NATIONAL ICT AUSTRALIA OR ITS CONTRIBUTORS BE LIABLE ON ANY LEGAL - * THEORY (INCLUDING, WITHOUT LIMITATION, IN AN ACTION OF CONTRACT, - * NEGLIGENCE OR OTHERWISE) FOR ANY CLAIM, LOSS, DAMAGES OR OTHER - * LIABILITY, INCLUDING (WITHOUT LIMITATION) LOSS OF PRODUCTION OR - * OPERATION TIME, LOSS, DAMAGE OR CORRUPTION OF DATA OR RECORDS; OR LOSS - * OF ANTICIPATED SAVINGS, OPPORTUNITY, REVENUE, PROFIT OR GOODWILL, OR - * OTHER ECONOMIC LOSS; OR ANY SPECIAL, INCIDENTAL, INDIRECT, - * CONSEQUENTIAL, PUNITIVE OR EXEMPLARY DAMAGES, ARISING OUT OF OR IN - * CONNECTION WITH THIS LICENCE, THE SOFTWARE OR THE USE OF OR OTHER - * DEALINGS WITH THE SOFTWARE, EVEN IF NATIONAL ICT AUSTRALIA OR ITS - * CONTRIBUTORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH CLAIM, LOSS, - * DAMAGES OR OTHER LIABILITY. - * - * If applicable legislation implies representations, warranties, or - * conditions, or imposes obligations or liability on National ICT - * Australia or one of its contributors in respect of the Software that - * cannot be wholly or partly excluded, restricted or modified, the - * liability of National ICT Australia or the contributor is limited, to - * the full extent permitted by the applicable legislation, at its - * option, to: - * a. in the case of goods, any one or more of the following: - * i. the replacement of the goods or the supply of equivalent goods; - * ii. the repair of the goods; - * iii. the payment of the cost of replacing the goods or of acquiring - * equivalent goods; - * iv. the payment of the cost of having the goods repaired; or - * b. in the case of services: - * i. the supplying of the services again; or - * ii. the payment of the cost of having the services supplied again. - * - * The construction, validity and performance of this licence is governed - * by the laws in force in New South Wales, Australia. - */ - -#include -#include -#include "format.h" - -int -vsnprintf(char *str, size_t size, const char *format, va_list arg) -{ - if (size == 0) { - return 0; - } - return format_string(str, NULL, 0, size - 1, format, arg); -}