Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 351 → Rev 352

/SPARTAN/trunk/arch/ia32/include/asm.h
42,7 → 42,6
extern __u16 inw(int port);
extern __u32 inl(int port);
 
extern void outb(int port, __u8 b);
extern void outw(int port, __u16 w);
extern void outl(int port, __u32 l);
 
84,6 → 83,16
*/
static inline __u32 read_cr3(void) { __u32 v; __asm__ volatile ("movl %%cr3,%0\n" : "=r" (v)); return v; }
 
/** Byte to port
*
* Output byte to port
*
* @param port Port to write to
* @param val Value to write
*/
static inline void outb(__u16 port, __u8 val) { __asm__ volatile ("outb %b0, %w1\n" : : "a" (val), "d" (port) ); }
 
 
/** Set priority level low
*
* Enable interrupts and return previous
166,4 → 175,5
return v;
}
 
 
#endif
/SPARTAN/trunk/arch/ia32/src/asm.S
40,7 → 40,6
.global inb
.global inw
.global inl
.global outb
.global outw
.global outl
.global memcpy
193,21 → 192,6
ret
 
 
## I/O output (byte)
#
# Send a byte to I/O port.
#
outb:
push %eax
 
movl 8(%esp),%edx
movl 12(%esp),%eax
outb %al,%dx
 
pop %eax
ret
 
 
## I/O output (word)
#
# Send a word to I/O port.