[LinksOS CVS Commit]kernel/hal/prototypes io.h,1.1,1.2
Status: Inactive
Brought to you by:
terencevs
|
From: <ke...@to...> - 2003-01-12 18:51:12
|
Update of /cvsroot/linksos/kernel/hal/prototypes In directory router-internal.tossell.net:/tmp/cvs-serv31339/hal/prototypes Modified Files: io.h Log Message: Title: C++ Support Changes: Changed symbol names, command lines, definitions to support c++ building. All g++ calls now include arguments not to include stdlib symbols. Calls to c++ routines in asm call the mangled c++ names, such as _Z7kprintfPc instead of kprintf. io.c's contents are moved into io.h, as inlines are not exported by g++. (Why should they be?) This change breaks portability, which I'll fix next. Effects: LinksOS can now be compiled as c++ code, with the g++ compiler and the gnu as assembler. a=kennyt b=19 Index: io.h =================================================================== RCS file: /cvsroot/linksos/kernel/hal/prototypes/io.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** io.h 4 Jan 2003 08:28:57 -0000 1.1 --- io.h 12 Jan 2003 18:51:06 -0000 1.2 *************** *** 2,8 **** #define _IO_H ! inline unsigned char inportb(unsigned int port); ! inline void outportb(unsigned int port, unsigned char value); ! #endif --- 2,19 ---- #define _IO_H ! inline unsigned char inportb(unsigned int port) ! { ! /* Input a byte from a port */ ! unsigned char ret; ! ! asm volatile ("inb %%dx,%%al":"=a" (ret):"d" (port)); ! return ret; ! } + inline void outportb(unsigned int port,unsigned char value) + { + /* Output a byte to a port */ + asm volatile ("outb %%al,%%dx"::"d" (port), "a" (value)); + } ! #endif /* ! _IO_H */ |