Changeset cc6f688 in mainline


Ignore:
Timestamp:
2005-11-22T17:07:38Z (19 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
3a6d6656
Parents:
25b0e6a
Message:

uspace work

Files:
5 added
2 deleted
5 edited
5 moved

Legend:

Unmodified
Added
Removed
  • init/init.c

    r25b0e6a rcc6f688  
    2828
    2929#include <unistd.h>
     30#include <stdio.h>
    3031
    3132int main(int argc, char *argv[])
    3233{
     34        puts("Hello world\n");
    3335        return 0;
    3436}
  • libc/Makefile

    r25b0e6a rcc6f688  
    3131
    3232LIBC_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)/include
    35 LFLAGS = -M
    36 AFLAGS =
    3733
    3834## Setup toolchain
     
    4541
    4642GENERIC_SOURCES = \
    47         generic/libc.c
     43        generic/libc.c \
     44        generic/io.c
    4845
    4946ARCH_SOURCES = \
    50         arch/$(ARCH)/entry.s \
    51         arch/$(ARCH)/syscall.c
     47        arch/$(ARCH)/src/entry.s \
     48        arch/$(ARCH)/src/syscall.c
    5249
    5350GENERIC_OBJECTS := $(addsuffix .o,$(basename $(GENERIC_SOURCES)))
  • libc/Makefile.toolchain

    r25b0e6a rcc6f688  
    2828
    2929DEFS = -DARCH=$(ARCH)
    30 CFLAGS = -fno-builtin -fomit-frame-pointer -Werror-implicit-function-declaration -Wmissing-prototypes -Werror -O3 -nostdlib -nostdinc -I$(LIBC_PREFIX)/include
     30CFLAGS = -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
    3131LFLAGS = -M
    3232AFLAGS =
  • libc/_link.ld.in

    r25b0e6a rcc6f688  
    11OUTPUT_FORMAT(binary)
    2 STARTUP(../libc/arch/ARCH/entry.o)
     2STARTUP(../libc/arch/ARCH/src/entry.o)
    33ENTRY(__entry)
    44
  • libc/arch/ia32/include/types.h

    r25b0e6a rcc6f688  
    2727 */
    2828
    29 #include <libc.h>
     29#ifndef __LIBC__TYPES_H__
     30#define __LIBC__TYPES_H__
    3031
    31 void __syscall(const unsigned int id, const unsigned int p1, const unsigned int p2, const unsigned int p3)
    32 {
     32typedef unsigned int sysarg_t;
     33typedef unsigned int size_t;
     34typedef signed int ssize_t;
    3335
    34 }
     36#endif
  • libc/arch/mips32el/src/syscall.c

    r25b0e6a rcc6f688  
    2929#include <libc.h>
    3030
    31 void __syscall(const unsigned int id, const unsigned int p1, const unsigned int p2, const unsigned int p3)
     31unsigned int __syscall(const syscall_t id, const unsigned int p1, const unsigned int p2, const unsigned int p3)
    3232{
    3333        register unsigned int __mips_reg_a0 asm("$4") = p1;
     
    3535        register unsigned int __mips_reg_a2 asm("$6") = p3;
    3636        register unsigned int __mips_reg_a3 asm("$7") = id;
     37        register unsigned int __mips_reg_v0 asm("$2");
    3738       
    3839        asm volatile (
    3940                "syscall\n"
    40                 :
     41                : "=r" (__mips_reg_v0)
    4142                : "r" (__mips_reg_a0),
    4243                  "r" (__mips_reg_a1),
    4344                  "r" (__mips_reg_a2),
    4445                  "r" (__mips_reg_a3)
    45                 : "v0"
    4646        );
     47       
     48        return __mips_reg_v0;
    4749}
  • libc/include/libc.h

    r25b0e6a rcc6f688  
    3030#define __LIBC__LIBC_H__
    3131
     32#include <types.h>
     33
     34
     35typedef enum {
     36        SYS_CTL = 0,
     37        SYS_IO  = 1
     38} syscall_t;
     39
    3240
    3341extern void __main(void);
    3442extern void __exit(void);
    35 extern void __syscall(const unsigned int id, const unsigned int p1, const unsigned int p2, const unsigned int p3);
     43extern unsigned int __syscall(const syscall_t id, const sysarg_t p1, const sysarg_t p2, const sysarg_t p3);
    3644
    3745
  • libc/include/stdio.h

    r25b0e6a rcc6f688  
    2727 */
    2828
    29 #ifndef __LIBC__UNISTD_H__
    30 #define __LIBC__UNISTD_H__
     29#ifndef __LIBC__STDIO_H__
     30#define __LIBC__STDIO_H__
    3131
    32 #define NULL 0
     32#include <types.h>
    3333
    34 extern void puts(const char *str);
     34#define EOF -1
     35
     36extern int puts(const char * str);
    3537
    3638#endif
Note: See TracChangeset for help on using the changeset viewer.