first version of ide controller
This commit is contained in:
@@ -40,3 +40,17 @@ unsigned int port_double_word_in(unsigned int port) {
|
||||
void port_double_word_out(unsigned short port, unsigned int data) {
|
||||
__asm__("out %%eax, %%dx" : : "a" (data), "d" (port));
|
||||
}
|
||||
|
||||
void port_word_in_repeat(unsigned short port, unsigned short *data, int buffer_size) {
|
||||
asm("rep insw"
|
||||
: "+D"(data), "+c"(buffer_size)
|
||||
: "d"(port)
|
||||
: "memory");
|
||||
}
|
||||
|
||||
void port_double_word_in_repeat(unsigned short port, unsigned int *data, int buffer_size) {
|
||||
asm("rep insl"
|
||||
: "+D"(data), "+c"(buffer_size)
|
||||
: "d"(port)
|
||||
: "memory");
|
||||
}
|
||||
Reference in New Issue
Block a user