-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
https://github.com/zavg/linux-0.01/ I got the URL finally.
- Loading branch information
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#define outb(value,port) \ | ||
__asm__ ("outb %%al,%%dx"::"a" (value),"d" (port)) | ||
|
||
|
||
#define inb(port) ({ \ | ||
unsigned char _v; \ | ||
__asm__ volatile ("inb %%dx,%%al":"=a" (_v):"d" (port)); \ | ||
_v; \ | ||
}) | ||
|
||
#define outb_p(value,port) \ | ||
__asm__ ("outb %%al,%%dx\n" \ | ||
"\tjmp 1f\n" \ | ||
"1:\tjmp 1f\n" \ | ||
"1:"::"a" (value),"d" (port)) | ||
|
||
#define inb_p(port) ({ \ | ||
unsigned char _v; \ | ||
__asm__ volatile ("inb %%dx,%%al\n" \ | ||
"\tjmp 1f\n" \ | ||
"1:\tjmp 1f\n" \ | ||
"1:":"=a" (_v):"d" (port)); \ | ||
_v; \ | ||
}) |