Changeset cc6f688 in mainline
- Timestamp:
- 2005-11-22T17:07:38Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3a6d6656
- Parents:
- 25b0e6a
- Files:
-
- 5 added
- 2 deleted
- 5 edited
- 5 moved
Legend:
- Unmodified
- Added
- Removed
-
init/init.c
r25b0e6a rcc6f688 28 28 29 29 #include <unistd.h> 30 #include <stdio.h> 30 31 31 32 int main(int argc, char *argv[]) 32 33 { 34 puts("Hello world\n"); 33 35 return 0; 34 36 } -
libc/Makefile
r25b0e6a rcc6f688 31 31 32 32 LIBC_PREFIX = . 33 DEFS = -DARCH=$(ARCH)34 CFLAGS = -fno-builtin -fomit-frame-pointer -Werror-implicit-function-declaration -Wmissing-prototypes -Werror -O3 -nostdlib -nostdinc -I$(LIBC_PREFIX)/include35 LFLAGS = -M36 AFLAGS =37 33 38 34 ## Setup toolchain … … 45 41 46 42 GENERIC_SOURCES = \ 47 generic/libc.c 43 generic/libc.c \ 44 generic/io.c 48 45 49 46 ARCH_SOURCES = \ 50 arch/$(ARCH)/ entry.s \51 arch/$(ARCH)/s yscall.c47 arch/$(ARCH)/src/entry.s \ 48 arch/$(ARCH)/src/syscall.c 52 49 53 50 GENERIC_OBJECTS := $(addsuffix .o,$(basename $(GENERIC_SOURCES))) -
libc/Makefile.toolchain
r25b0e6a rcc6f688 28 28 29 29 DEFS = -DARCH=$(ARCH) 30 CFLAGS = -fno-builtin -fomit-frame-pointer -Werror-implicit-function-declaration -Wmissing-prototypes -Werror -O3 -nostdlib -nostdinc -I$(LIBC_PREFIX)/include 30 CFLAGS = -fno-builtin -fomit-frame-pointer -Werror-implicit-function-declaration -Wmissing-prototypes -Werror -O3 -nostdlib -nostdinc -I$(LIBC_PREFIX)/include -I$(LIBC_PREFIX)/arch/$(ARCH)/include 31 31 LFLAGS = -M 32 32 AFLAGS = -
libc/_link.ld.in
r25b0e6a rcc6f688 1 1 OUTPUT_FORMAT(binary) 2 STARTUP(../libc/arch/ARCH/ entry.o)2 STARTUP(../libc/arch/ARCH/src/entry.o) 3 3 ENTRY(__entry) 4 4 -
libc/arch/ia32/include/types.h
r25b0e6a rcc6f688 27 27 */ 28 28 29 #include <libc.h> 29 #ifndef __LIBC__TYPES_H__ 30 #define __LIBC__TYPES_H__ 30 31 31 void __syscall(const unsigned int id, const unsigned int p1, const unsigned int p2, const unsigned int p3) 32 { 32 typedef unsigned int sysarg_t; 33 typedef unsigned int size_t; 34 typedef signed int ssize_t; 33 35 34 } 36 #endif -
libc/arch/mips32el/src/syscall.c
r25b0e6a rcc6f688 29 29 #include <libc.h> 30 30 31 void __syscall(const unsigned int id, const unsigned int p1, const unsigned int p2, const unsigned int p3)31 unsigned int __syscall(const syscall_t id, const unsigned int p1, const unsigned int p2, const unsigned int p3) 32 32 { 33 33 register unsigned int __mips_reg_a0 asm("$4") = p1; … … 35 35 register unsigned int __mips_reg_a2 asm("$6") = p3; 36 36 register unsigned int __mips_reg_a3 asm("$7") = id; 37 register unsigned int __mips_reg_v0 asm("$2"); 37 38 38 39 asm volatile ( 39 40 "syscall\n" 40 : 41 : "=r" (__mips_reg_v0) 41 42 : "r" (__mips_reg_a0), 42 43 "r" (__mips_reg_a1), 43 44 "r" (__mips_reg_a2), 44 45 "r" (__mips_reg_a3) 45 : "v0"46 46 ); 47 48 return __mips_reg_v0; 47 49 } -
libc/include/libc.h
r25b0e6a rcc6f688 30 30 #define __LIBC__LIBC_H__ 31 31 32 #include <types.h> 33 34 35 typedef enum { 36 SYS_CTL = 0, 37 SYS_IO = 1 38 } syscall_t; 39 32 40 33 41 extern void __main(void); 34 42 extern void __exit(void); 35 extern void __syscall(const unsigned int id, const unsigned int p1, const unsigned int p2, const unsigned int p3);43 extern unsigned int __syscall(const syscall_t id, const sysarg_t p1, const sysarg_t p2, const sysarg_t p3); 36 44 37 45 -
libc/include/stdio.h
r25b0e6a rcc6f688 27 27 */ 28 28 29 #ifndef __LIBC__ UNISTD_H__30 #define __LIBC__ UNISTD_H__29 #ifndef __LIBC__STDIO_H__ 30 #define __LIBC__STDIO_H__ 31 31 32 # define NULL 032 #include <types.h> 33 33 34 extern void puts(const char *str); 34 #define EOF -1 35 36 extern int puts(const char * str); 35 37 36 38 #endif
Note:
See TracChangeset
for help on using the changeset viewer.