qemu-fwcfg: use pread/pwrite for port access
This commit is contained in:
parent
2eb7d97464
commit
1e6316122a
@ -31,14 +31,12 @@ static int port_fd = -1;
|
||||
|
||||
/* outw / inb helper functions */
|
||||
static void outports(unsigned short _port, unsigned short _data) {
|
||||
lseek(port_fd, _port, SEEK_SET);
|
||||
write(port_fd, &_data, 2);
|
||||
pwrite(port_fd, &_data, 2, _port);
|
||||
}
|
||||
|
||||
static unsigned char inportb(unsigned short _port) {
|
||||
unsigned char out;
|
||||
lseek(port_fd, _port, SEEK_SET);
|
||||
read(port_fd, &out, 1);
|
||||
pread(port_fd, &out, 1, _port);
|
||||
return out;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user