Subversion Repositories HelenOS-historic

Compare Revisions

Ignore whitespace Rev 953 → Rev 954

/uspace/trunk/libc/include/libc.h
31,21 → 31,17
 
#include <types.h>
 
#include <kernel/syscall/syscall.h>
 
#define __SYSCALL0(id) __syscall(id, 0, 0, 0)
#define __SYSCALL1(id, p1) __syscall(id, p1, 0, 0)
#define __SYSCALL2(id, p1, p2) __syscall(id, p1, p2, 0)
#define __SYSCALL0(id) __syscall(0, 0, 0, id)
#define __SYSCALL1(id, p1) __syscall(p1, 0, 0, id)
#define __SYSCALL2(id, p1, p2) __syscall(p1, p2, 0, id)
#define __SYSCALL3(id, p1, p2, p3) __syscall(p1,p2,p3,id)
 
 
typedef enum {
SYS_CTL = 0,
SYS_IO = 1
} syscall_t;
 
 
extern void __main(void);
extern void __exit(void);
extern sysarg_t __syscall(const syscall_t id, const sysarg_t p1, const sysarg_t p2, const sysarg_t p3);
extern sysarg_t __syscall(const sysarg_t p1, const sysarg_t p2,
const sysarg_t p3, const syscall_t id);
 
 
#endif
/uspace/trunk/libc/generic/io.c
47,5 → 47,5
 
ssize_t write(int fd, const void * buf, size_t count)
{
return (ssize_t) __syscall(SYS_IO, (sysarg_t) fd, (sysarg_t) buf, (sysarg_t) count);
return (ssize_t) __SYSCALL3(SYS_IO, (sysarg_t) fd, (sysarg_t) buf, (sysarg_t) count);
}
/uspace/trunk/libc/Makefile
49,14 → 49,17
GENERIC_OBJECTS := $(addsuffix .o,$(basename $(GENERIC_SOURCES)))
ARCH_OBJECTS := $(addsuffix .o,$(basename $(ARCH_SOURCES)))
 
.PHONY: all clean depend
.PHONY: all clean depend kerninc
 
all: libc.a arch/$(ARCH)/_link.ld
all: kerninc libc.a arch/$(ARCH)/_link.ld
 
kerninc:
ln -sf ../../../kernel/generic/include include/kernel
 
-include Makefile.depend
 
clean:
-rm -f libc.a arch/$(ARCH)/_link.ld Makefile.depend
-rm -f include/kernel libc.a arch/$(ARCH)/_link.ld Makefile.depend
find generic/ arch/$(ARCH)/ -name '*.o' -follow -exec rm \{\} \;
 
depend:
/uspace/trunk/libc/arch/mips32/src/syscall.c
28,7 → 28,8
 
#include <libc.h>
 
sysarg_t __syscall(const syscall_t id, const sysarg_t p1, const sysarg_t p2, const sysarg_t p3)
sysarg_t __syscall(const sysarg_t p1, const sysarg_t p2,
const sysarg_t p3, const syscall_t id)
{
register sysarg_t __mips_reg_a0 asm("$4") = p1;
register sysarg_t __mips_reg_a1 asm("$5") = p2;