Subversion Repositories HelenOS-historic

Compare Revisions

Ignore whitespace Rev 352 → Rev 349

/SPARTAN/trunk/arch/ia32/src/asm.S
40,6 → 40,7
.global inb
.global inw
.global inl
.global outb
.global outw
.global outl
.global memcpy
192,6 → 193,21
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.
/SPARTAN/trunk/arch/ia32/include/asm.h
42,6 → 42,7
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);
 
83,16 → 84,6
*/
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
175,5 → 166,4
return v;
}
 
 
#endif