X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=blobdiff_plain;f=palacios%2Fsrc%2Fgeekos%2Fio.c;h=1310cdc752cb3aa35b71ec368a5cfff6b72c2baf;hp=313273305b367b7951310edc34c57fec7eb8f1a6;hb=3b49b57d1f3b8bccdf7390c26ea9cda1f8dac8c3;hpb=59bbb50ff3ce4074abc907914e8ae70cb16a22d8 diff --git a/palacios/src/geekos/io.c b/palacios/src/geekos/io.c index 3132733..1310cdc 100644 --- a/palacios/src/geekos/io.c +++ b/palacios/src/geekos/io.c @@ -1,7 +1,7 @@ /* * x86 port IO routines * Copyright (c) 2001, David H. Hovemeyer - * $Revision: 1.1 $ + * $Revision: 1.2 $ * * This is free software. You are permitted to use, * redistribute, and modify it as specified in the file "COPYING". @@ -50,7 +50,7 @@ void Out_Word(ushort_t port, ushort_t value) } /* - * Read a byte from an I/O port. + * Read a word from an I/O port. */ ushort_t In_Word(ushort_t port) { @@ -66,6 +66,34 @@ ushort_t In_Word(ushort_t port) } /* + * Write a double word to an I/O port. + */ +void Out_DWord(ushort_t port, uint_t value) +{ + __asm__ __volatile__ ( + "outl %0, %1" + : + : "a" (value), "Nd" (port) + ); +} + +/* + * Read a double word from an I/O port. + */ +uint_t In_DWord(ushort_t port) +{ + uint_t value; + + __asm__ __volatile__ ( + "inl %1, %0" + : "=a" (value) + : "Nd" (port) + ); + + return value; +} + +/* * Short delay. May be needed when talking to some * (slow) I/O devices. */