Create NDIS_BUS_SPACE_{IO,MEM} to abstract MD BUS_SPACE macros.
Provide appropriate definitions for i386 and AMD64.
This commit is contained in:
parent
9cd3244809
commit
32b034d034
@ -417,9 +417,13 @@ typedef struct image_patch_table image_patch_table;
|
||||
*/
|
||||
|
||||
#ifdef __amd64__
|
||||
#define __stdcall
|
||||
#define __stdcall
|
||||
#define NDIS_BUS_SPACE_IO AMD64_BUS_SPACE_IO
|
||||
#define NDIS_BUS_SPACE_MEM AMD64_BUS_SPACE_MEM
|
||||
#else
|
||||
#define __stdcall __attribute__((__stdcall__))
|
||||
#define __stdcall __attribute__((__stdcall__))
|
||||
#define NDIS_BUS_SPACE_IO I386_BUS_SPACE_IO
|
||||
#define NDIS_BUS_SPACE_MEM I386_BUS_SPACE_MEM
|
||||
#endif
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
@ -96,7 +96,7 @@ hal_writeport_ulong(port, val)
|
||||
uint32_t *port;
|
||||
uint32_t val;
|
||||
{
|
||||
bus_space_write_4(I386_BUS_SPACE_IO, 0x0, (uint32_t)port, val);
|
||||
bus_space_write_4(NDIS_BUS_SPACE_IO, 0x0, (bus_size_t)port, val);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -105,7 +105,7 @@ hal_writeport_ushort(port, val)
|
||||
uint16_t *port;
|
||||
uint16_t val;
|
||||
{
|
||||
bus_space_write_2(I386_BUS_SPACE_IO, 0x0, (uint32_t)port, val);
|
||||
bus_space_write_2(NDIS_BUS_SPACE_IO, 0x0, (bus_size_t)port, val);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -114,7 +114,7 @@ hal_writeport_uchar(port, val)
|
||||
uint8_t *port;
|
||||
uint8_t val;
|
||||
{
|
||||
bus_space_write_1(I386_BUS_SPACE_IO, 0x0, (uint32_t)port, val);
|
||||
bus_space_write_1(NDIS_BUS_SPACE_IO, 0x0, (bus_size_t)port, val);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -124,7 +124,7 @@ hal_writeport_buf_ulong(port, val, cnt)
|
||||
uint32_t *val;
|
||||
uint32_t cnt;
|
||||
{
|
||||
bus_space_write_multi_4(I386_BUS_SPACE_IO, 0x0,
|
||||
bus_space_write_multi_4(NDIS_BUS_SPACE_IO, 0x0,
|
||||
(bus_size_t)port, val, cnt);
|
||||
return;
|
||||
}
|
||||
@ -135,7 +135,7 @@ hal_writeport_buf_ushort(port, val, cnt)
|
||||
uint16_t *val;
|
||||
uint32_t cnt;
|
||||
{
|
||||
bus_space_write_multi_2(I386_BUS_SPACE_IO, 0x0,
|
||||
bus_space_write_multi_2(NDIS_BUS_SPACE_IO, 0x0,
|
||||
(bus_size_t)port, val, cnt);
|
||||
return;
|
||||
}
|
||||
@ -146,7 +146,7 @@ hal_writeport_buf_uchar(port, val, cnt)
|
||||
uint8_t *val;
|
||||
uint32_t cnt;
|
||||
{
|
||||
bus_space_write_multi_1(I386_BUS_SPACE_IO, 0x0,
|
||||
bus_space_write_multi_1(NDIS_BUS_SPACE_IO, 0x0,
|
||||
(bus_size_t)port, val, cnt);
|
||||
return;
|
||||
}
|
||||
@ -155,21 +155,21 @@ __stdcall static uint16_t
|
||||
hal_readport_ushort(port)
|
||||
uint16_t *port;
|
||||
{
|
||||
return(bus_space_read_2(I386_BUS_SPACE_IO, 0x0, (uint32_t)port));
|
||||
return(bus_space_read_2(NDIS_BUS_SPACE_IO, 0x0, (bus_size_t)port));
|
||||
}
|
||||
|
||||
__stdcall static uint32_t
|
||||
hal_readport_ulong(port)
|
||||
uint32_t *port;
|
||||
{
|
||||
return(bus_space_read_4(I386_BUS_SPACE_IO, 0x0, (uint32_t)port));
|
||||
return(bus_space_read_4(NDIS_BUS_SPACE_IO, 0x0, (bus_size_t)port));
|
||||
}
|
||||
|
||||
__stdcall static uint8_t
|
||||
hal_readport_uchar(port)
|
||||
uint8_t *port;
|
||||
{
|
||||
return(bus_space_read_1(I386_BUS_SPACE_IO, 0x0, (uint32_t)port));
|
||||
return(bus_space_read_1(NDIS_BUS_SPACE_IO, 0x0, (bus_size_t)port));
|
||||
}
|
||||
|
||||
__stdcall static void
|
||||
@ -178,7 +178,7 @@ hal_readport_buf_ulong(port, val, cnt)
|
||||
uint32_t *val;
|
||||
uint32_t cnt;
|
||||
{
|
||||
bus_space_read_multi_4(I386_BUS_SPACE_IO, 0x0,
|
||||
bus_space_read_multi_4(NDIS_BUS_SPACE_IO, 0x0,
|
||||
(bus_size_t)port, val, cnt);
|
||||
return;
|
||||
}
|
||||
@ -189,7 +189,7 @@ hal_readport_buf_ushort(port, val, cnt)
|
||||
uint16_t *val;
|
||||
uint32_t cnt;
|
||||
{
|
||||
bus_space_read_multi_2(I386_BUS_SPACE_IO, 0x0,
|
||||
bus_space_read_multi_2(NDIS_BUS_SPACE_IO, 0x0,
|
||||
(bus_size_t)port, val, cnt);
|
||||
return;
|
||||
}
|
||||
@ -200,7 +200,7 @@ hal_readport_buf_uchar(port, val, cnt)
|
||||
uint8_t *val;
|
||||
uint32_t cnt;
|
||||
{
|
||||
bus_space_read_multi_1(I386_BUS_SPACE_IO, 0x0,
|
||||
bus_space_read_multi_1(NDIS_BUS_SPACE_IO, 0x0,
|
||||
(bus_size_t)port, val, cnt);
|
||||
return;
|
||||
}
|
||||
|
@ -282,7 +282,7 @@ ntoskrnl_writereg_ushort(reg, val)
|
||||
uint16_t *reg;
|
||||
uint16_t val;
|
||||
{
|
||||
bus_space_write_2(I386_BUS_SPACE_MEM, 0x0, (uint32_t)reg, val);
|
||||
bus_space_write_2(NDIS_BUS_SPACE_MEM, 0x0, (bus_size_t)reg, val);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -290,7 +290,7 @@ __stdcall static uint16_t
|
||||
ntoskrnl_readreg_ushort(reg)
|
||||
uint16_t *reg;
|
||||
{
|
||||
return(bus_space_read_2(I386_BUS_SPACE_MEM, 0x0, (uint32_t)reg));
|
||||
return(bus_space_read_2(NDIS_BUS_SPACE_MEM, 0x0, (bus_size_t)reg));
|
||||
}
|
||||
|
||||
__stdcall static void
|
||||
@ -298,7 +298,7 @@ ntoskrnl_writereg_ulong(reg, val)
|
||||
uint32_t *reg;
|
||||
uint32_t val;
|
||||
{
|
||||
bus_space_write_4(I386_BUS_SPACE_MEM, 0x0, (uint32_t)reg, val);
|
||||
bus_space_write_4(NDIS_BUS_SPACE_MEM, 0x0, (bus_size_t)reg, val);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -306,14 +306,14 @@ __stdcall static uint32_t
|
||||
ntoskrnl_readreg_ulong(reg)
|
||||
uint32_t *reg;
|
||||
{
|
||||
return(bus_space_read_4(I386_BUS_SPACE_MEM, 0x0, (uint32_t)reg));
|
||||
return(bus_space_read_4(NDIS_BUS_SPACE_MEM, 0x0, (bus_size_t)reg));
|
||||
}
|
||||
|
||||
__stdcall static uint8_t
|
||||
ntoskrnl_readreg_uchar(reg)
|
||||
uint8_t *reg;
|
||||
{
|
||||
return(bus_space_read_1(I386_BUS_SPACE_MEM, 0x0, (uint32_t)reg));
|
||||
return(bus_space_read_1(NDIS_BUS_SPACE_MEM, 0x0, (bus_size_t)reg));
|
||||
}
|
||||
|
||||
__stdcall static void
|
||||
@ -321,7 +321,7 @@ ntoskrnl_writereg_uchar(reg, val)
|
||||
uint8_t *reg;
|
||||
uint8_t val;
|
||||
{
|
||||
bus_space_write_1(I386_BUS_SPACE_MEM, 0x0, (uint32_t)reg, val);
|
||||
bus_space_write_1(NDIS_BUS_SPACE_MEM, 0x0, (bus_size_t)reg, val);
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user