Subversion Repositories HelenOS

Compare Revisions

Regard whitespace Rev 1365 → Rev 1366

/uspace/trunk/ns/ns.c
45,8 → 45,6
 
#define NS_HASH_TABLE_CHAINS 20
 
extern int __DONT_OPEN_STDIO__=1;
 
static int register_service(ipcarg_t service, ipcarg_t phone, ipc_call_t *call);
static int connect_to_service(ipcarg_t service, ipc_call_t *call, ipc_callid_t callid);
 
/uspace/trunk/fb/fb.c
54,8 → 54,6
 
#define EFB (-1)
 
extern int __DONT_OPEN_STDIO__=1;
 
#define DEFAULT_BGCOLOR 0x000080
#define DEFAULT_FGCOLOR 0xffff00
#define DEFAULT_LOGOCOLOR 0x0000ff
/uspace/trunk/libc/include/io/stream.h
10,7 → 10,3
typedef ssize_t (*preadfn_t)(void);
 
fd_t open(const char *fname,int flags);
 
 
 
 
/uspace/trunk/libc/include/ipc/fb.h
14,25 → 14,20
#define COUNT_WIDTH 16 /*Should be 8 times integer*/
 
 
struct _fb_method
{
struct _fb_method {
unsigned m : METHOD_WIDTH;
unsigned item : ITEM_WIDTH;
} __attribute__ ((packed));
 
union fb_method
{
union fb_method {
struct _fb_method m;
__native fill;
}__attribute__ ((packed));
 
struct fb_call_args
{
struct fb_call_args {
union fb_method method;
union
{
struct
{
union {
struct {
unsigned count :COUNT_WIDTH;
char chars[3*sizeof(__native)-(COUNT_WIDTH>>3)];
}putchar __attribute__ ((packed));
39,8 → 34,7
}data ; //__attribute__ ((packed));
}__attribute__ ((packed));
 
struct fb_ipc_args
{
struct fb_ipc_args {
__native method;
__native arg1;
__native arg2;
47,8 → 41,7
__native arg3;
} __attribute__ ((packed));
 
union fb_args
{
union fb_args {
struct fb_call_args fb_args;
struct fb_ipc_args ipc_args;
}__attribute__ ((packed));
56,5 → 49,3
typedef union fb_args fb_args_t;
 
#endif
 
 
/uspace/trunk/libc/generic/io/io.c
92,12 → 92,3
return EOF;
}
/*
ssize_t write(int fd, const void * buf, size_t count)
{
return (ssize_t) __SYSCALL3(SYS_IO, (sysarg_t) fd, (sysarg_t) buf, (sysarg_t) count);
}*/
 
 
 
 
/uspace/trunk/libc/generic/io/stream.c
10,8 → 10,7
 
#define FDS 32
 
typedef struct stream_t
{
typedef struct stream_t {
pwritefn_t w;
preadfn_t r;
void * param;
18,8 → 17,7
}stream_t;
 
 
typedef struct vfb_descriptor_t
{
typedef struct vfb_descriptor_t {
int phone;
int vfb;
}vfb_descriptor_t;
43,7 → 41,8
static ssize_t write_vfb(void *param, const void * buf, size_t count)
{
int i;
for(i=0;i<count;i++) vfb_send_char((vfb_descriptor_t *)param,((char*)buf)[i]);
for (i = 0; i < count; i++)
vfb_send_char((vfb_descriptor_t *) param, ((char *) buf)[i]);
return count;
//return (ssize_t) __SYSCALL3(SYS_IO, 1, (sysarg_t) buf, (sysarg_t) count);
57,7 → 56,6
}
 
 
stream_t open_vfb(void);
stream_t open_vfb(void)
{
stream_t stream;
66,9 → 64,9
int res;
ipcarg_t vfb_no;
while((phoneid=ipc_connect_me_to(PHONE_NS,SERVICE_VIDEO,0))<0)
{
while ((phoneid = ipc_connect_me_to(PHONE_NS, SERVICE_VIDEO, 0)) < 0) {
volatile int a;
for(a=0;a<1048576;a++);
}
78,7 → 76,6
vfb->phone=phoneid;
vfb->vfb=vfb_no;
stream.w=write_vfb;
stream.param=vfb;
return stream;
88,18 → 85,18
fd_t open(const char *fname,int flags)
{
int c=0;
while(((streams[c].w)||(streams[c].r))&&(c<FDS))c++;
if(c==FDS) return EMFILE;
 
while (((streams[c].w) || (streams[c].r)) && (c < FDS))
c++;
if (c == FDS)
return EMFILE;
 
if(!strcmp(fname,"stdin"))
{
if (!strcmp(fname, "stdin")) {
streams[c].r=(preadfn_t)1;
return c;
}
if(!strcmp(fname,"stdout"))
{
if (!strcmp(fname, "stdout")) {
//streams[c].w=write_stdout;
//return c;
streams[c]=open_vfb();
106,8 → 103,7
return c;
}
if(!strcmp(fname,"stderr"))
{
if (!strcmp(fname, "stderr")) {
streams[c].w=write_stderr;
return c;
}
116,8 → 112,8
 
ssize_t write(int fd, const void * buf, size_t count)
{
if(fd<FDS) return streams[fd].w(streams[fd].param,buf,count);
if (fd < FDS)
return streams[fd].w(streams[fd].param, buf, count);
return 0;
}
 
 
/uspace/trunk/libc/generic/libc.c
32,12 → 32,8
#include <malloc.h>
#include <psthread.h>
#include <io/stream.h>
#include <ipc/ipc.h>
 
int __DONT_OPEN_STDIO__;
 
/* We should probably merge libc and libipc together */
extern void _ipc_init(void);
 
void _exit(int status) {
thread_exit(status);
}
45,17 → 41,14
void __main(void) {
tcb_t *tcb;
if(!__DONT_OPEN_STDIO__)
{
open("stdin",0);
open("stdout",0);
open("stderr",0);
}
tcb = __make_tls();
__tcb_set(tcb);
psthread_setup(tcb);
_ipc_init();
open("stdin", 0);
open("stdout", 0);
open("stderr", 0);
}
 
void __exit(void) {
/uspace/trunk/libc/Makefile
79,13 → 79,12
ln -sfn ../../../kernel/generic/include include/kernel
ln -sfn kernel/arch include/arch
ln -sfn ../arch/$(ARCH)/include include/libarch
ln -sfn ../../libipc/include include/libipc
ln -sfn ../../libadt/include include/libadt
 
-include Makefile.depend
 
clean:
-rm -f include/kernel include/arch include/libarch include/libipc include/libadt libc.a arch/$(ARCH)/_link.ld Makefile.depend
-rm -f include/kernel include/arch include/libarch include/libadt libc.a arch/$(ARCH)/_link.ld Makefile.depend
find generic/ arch/$(ARCH)/ -name '*.o' -follow -exec rm \{\} \;
 
depend: kerninc