]>
Commit | Line | Data |
---|---|---|
ca162103 | 1 | title CpuIoAccess.asm\r |
2 | ;------------------------------------------------------------------------------\r | |
3 | ;\r | |
4 | ; Copyright (c) 2006, Intel Corporation \r | |
5 | ; All rights reserved. This program and the accompanying materials \r | |
6 | ; are licensed and made available under the terms and conditions of the BSD License \r | |
7 | ; which accompanies this distribution. The full text of the license may be found at \r | |
8 | ; http://opensource.org/licenses/bsd-license.php \r | |
9 | ; \r | |
10 | ; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
11 | ; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
12 | ; \r | |
13 | ; Module Name:\r | |
14 | ; CpuIoAccess.asm\r | |
15 | ; \r | |
16 | ; Abstract:\r | |
17 | ; CPU IO Abstraction\r | |
18 | ;\r | |
19 | ;------------------------------------------------------------------------------\r | |
20 | \r | |
21 | .686\r | |
22 | .MODEL FLAT,C\r | |
23 | .CODE\r | |
24 | \r | |
25 | \r | |
26 | UINT8 TYPEDEF BYTE\r | |
27 | UINT16 TYPEDEF WORD\r | |
28 | UINT32 TYPEDEF DWORD\r | |
29 | UINT64 TYPEDEF QWORD\r | |
30 | UINTN TYPEDEF UINT32\r | |
31 | \r | |
32 | \r | |
33 | \r | |
34 | ;------------------------------------------------------------------------------\r | |
35 | ; UINT8\r | |
36 | ; CpuIoRead8 (\r | |
37 | ; IN UINT16 Port\r | |
38 | ; )\r | |
39 | ;------------------------------------------------------------------------------\r | |
40 | CpuIoRead8 PROC PUBLIC Port:UINT16\r | |
41 | mov dx, Port\r | |
42 | in al, dx\r | |
43 | ret\r | |
44 | CpuIoRead8 ENDP\r | |
45 | \r | |
46 | \r | |
47 | ;------------------------------------------------------------------------------\r | |
48 | ; VOID\r | |
49 | ; CpuIoWrite8 (\r | |
50 | ; IN UINT16 Port,\r | |
51 | ; IN UINT32 Data\r | |
52 | ; )\r | |
53 | ;------------------------------------------------------------------------------\r | |
54 | CpuIoWrite8 PROC PUBLIC Port:UINT16, Data:UINT32\r | |
55 | mov eax, Data\r | |
56 | mov dx, Port\r | |
57 | out dx, al\r | |
58 | ret\r | |
59 | CpuIoWrite8 ENDP\r | |
60 | \r | |
61 | \r | |
62 | END |