ReactOS 0.4.16-dev-2293-g4d8327b
regfuncs.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define HDA_RATE(base, mult, div)
 
#define hda_read8(ctx, reg)   read8((ctx)->m_BAR0.Base.baseptr + HDA_REG_##reg)
 
#define hda_write8(ctx, reg, data)   write8((ctx)->m_BAR0.Base.baseptr + HDA_REG_##reg, data)
 
#define hda_update8(ctx, reg, mask, val)   hda_write8(ctx, reg, (hda_read8(ctx, reg) & ~(mask)) | (val))
 
#define hda_read16(ctx, reg)   read16((ctx)->m_BAR0.Base.baseptr + HDA_REG_##reg)
 
#define hda_write16(ctx, reg, data)   write16((ctx)->m_BAR0.Base.baseptr + HDA_REG_##reg, data)
 
#define hda_update16(ctx, reg, mask, val)   hda_write16(ctx, reg, (hda_read16(ctx, reg) & ~(mask)) | (val))
 
#define hda_read32(ctx, reg)   read32((ctx)->m_BAR0.Base.baseptr + HDA_REG_##reg)
 
#define hda_write32(ctx, reg, data)   write32((ctx)->m_BAR0.Base.baseptr + HDA_REG_##reg, data)
 
#define hda_update32(ctx, reg, mask, val)   hda_write32(ctx, reg, (hda_read32(ctx, reg) & ~(mask)) | (val))
 
#define stream_read8(ctx, reg)   read8((ctx)->sdAddr + HDA_REG_##reg)
 
#define stream_write8(ctx, reg, data)   write8((ctx)->sdAddr + HDA_REG_##reg, data)
 
#define stream_update8(ctx, reg, mask, val)   stream_write8(ctx, reg, (stream_read8(ctx, reg) & ~(mask)) | (val))
 
#define stream_read16(ctx, reg)   read16((ctx)->sdAddr + HDA_REG_##reg)
 
#define stream_write16(ctx, reg, data)   write16((ctx)->sdAddr + HDA_REG_##reg, data)
 
#define stream_update16(ctx, reg, mask, val)   stream_write16(ctx, reg, (stream_read16(ctx, reg) & ~(mask)) | (val))
 
#define stream_read32(ctx, reg)   read32((ctx)->sdAddr + HDA_REG_##reg)
 
#define stream_write32(ctx, reg, data)   write32((ctx)->sdAddr + HDA_REG_##reg, data)
 
#define stream_update32(ctx, reg, mask, val)   stream_write32(ctx, reg, (stream_read32(ctx, reg) & ~(mask)) | (val))
 
#define hdac_update32(addr, reg, mask, val)    write32(addr + reg, ((read32(addr + reg) & ~(mask)) | (val)))
 
#define hdac_update16(addr, reg, mask, val)    write16(addr + reg,((read16(addr + reg) & ~(mask)) | (val)))
 

Functions

static UINT8 read8 (PVOID addr)
 
static void write8 (PVOID addr, UINT8 data)
 
static UINT16 read16 (PVOID addr)
 
static void write16 (PVOID addr, UINT16 data)
 
static UINT32 read32 (PVOID addr)
 
static void write32 (PVOID addr, UINT32 data)
 
static void pci_read_cfg_byte (PBUS_INTERFACE_STANDARD pciInterface, UINT reg, BYTE *data)
 
static void pci_read_cfg_dword (PBUS_INTERFACE_STANDARD pciInterface, UINT reg, UINT32 *data)
 
static void pci_write_cfg_byte (PBUS_INTERFACE_STANDARD pciInterface, UINT reg, BYTE data)
 
static void pci_write_cfg_dword (PBUS_INTERFACE_STANDARD pciInterface, UINT reg, UINT32 data)
 
static void update_pci_byte (PBUS_INTERFACE_STANDARD pciInterface, UINT reg, BYTE mask, BYTE val)
 

Macro Definition Documentation

◆ HDA_RATE

#define HDA_RATE (   base,
  mult,
  div 
)
Value:
(AC_FMT_BASE_##base##K | (((mult) - 1) << AC_FMT_MULT_SHIFT) | \
(((div) - 1) << AC_FMT_DIV_SHIFT))
_ACRTIMP div_t __cdecl div(int, int)
Definition: math.c:2081
#define AC_FMT_MULT_SHIFT
Definition: hda_verbs.h:199
#define AC_FMT_DIV_SHIFT
Definition: hda_verbs.h:197

Definition at line 49 of file regfuncs.h.

◆ hda_read16

#define hda_read16 (   ctx,
  reg 
)    read16((ctx)->m_BAR0.Base.baseptr + HDA_REG_##reg)

Definition at line 56 of file regfuncs.h.

◆ hda_read32

#define hda_read32 (   ctx,
  reg 
)    read32((ctx)->m_BAR0.Base.baseptr + HDA_REG_##reg)

Definition at line 59 of file regfuncs.h.

◆ hda_read8

#define hda_read8 (   ctx,
  reg 
)    read8((ctx)->m_BAR0.Base.baseptr + HDA_REG_##reg)

Definition at line 53 of file regfuncs.h.

◆ hda_update16

#define hda_update16 (   ctx,
  reg,
  mask,
  val 
)    hda_write16(ctx, reg, (hda_read16(ctx, reg) & ~(mask)) | (val))

Definition at line 58 of file regfuncs.h.

◆ hda_update32

#define hda_update32 (   ctx,
  reg,
  mask,
  val 
)    hda_write32(ctx, reg, (hda_read32(ctx, reg) & ~(mask)) | (val))

Definition at line 61 of file regfuncs.h.

◆ hda_update8

#define hda_update8 (   ctx,
  reg,
  mask,
  val 
)    hda_write8(ctx, reg, (hda_read8(ctx, reg) & ~(mask)) | (val))

Definition at line 55 of file regfuncs.h.

◆ hda_write16

#define hda_write16 (   ctx,
  reg,
  data 
)    write16((ctx)->m_BAR0.Base.baseptr + HDA_REG_##reg, data)

Definition at line 57 of file regfuncs.h.

◆ hda_write32

#define hda_write32 (   ctx,
  reg,
  data 
)    write32((ctx)->m_BAR0.Base.baseptr + HDA_REG_##reg, data)

Definition at line 60 of file regfuncs.h.

◆ hda_write8

#define hda_write8 (   ctx,
  reg,
  data 
)    write8((ctx)->m_BAR0.Base.baseptr + HDA_REG_##reg, data)

Definition at line 54 of file regfuncs.h.

◆ hdac_update16

#define hdac_update16 (   addr,
  reg,
  mask,
  val 
)     write16(addr + reg,((read16(addr + reg) & ~(mask)) | (val)))

Definition at line 77 of file regfuncs.h.

◆ hdac_update32

#define hdac_update32 (   addr,
  reg,
  mask,
  val 
)     write32(addr + reg, ((read32(addr + reg) & ~(mask)) | (val)))

Definition at line 74 of file regfuncs.h.

◆ stream_read16

#define stream_read16 (   ctx,
  reg 
)    read16((ctx)->sdAddr + HDA_REG_##reg)

Definition at line 66 of file regfuncs.h.

◆ stream_read32

#define stream_read32 (   ctx,
  reg 
)    read32((ctx)->sdAddr + HDA_REG_##reg)

Definition at line 69 of file regfuncs.h.

◆ stream_read8

#define stream_read8 (   ctx,
  reg 
)    read8((ctx)->sdAddr + HDA_REG_##reg)

Definition at line 63 of file regfuncs.h.

◆ stream_update16

#define stream_update16 (   ctx,
  reg,
  mask,
  val 
)    stream_write16(ctx, reg, (stream_read16(ctx, reg) & ~(mask)) | (val))

Definition at line 68 of file regfuncs.h.

◆ stream_update32

#define stream_update32 (   ctx,
  reg,
  mask,
  val 
)    stream_write32(ctx, reg, (stream_read32(ctx, reg) & ~(mask)) | (val))

Definition at line 71 of file regfuncs.h.

◆ stream_update8

#define stream_update8 (   ctx,
  reg,
  mask,
  val 
)    stream_write8(ctx, reg, (stream_read8(ctx, reg) & ~(mask)) | (val))

Definition at line 65 of file regfuncs.h.

◆ stream_write16

#define stream_write16 (   ctx,
  reg,
  data 
)    write16((ctx)->sdAddr + HDA_REG_##reg, data)

Definition at line 67 of file regfuncs.h.

◆ stream_write32

#define stream_write32 (   ctx,
  reg,
  data 
)    write32((ctx)->sdAddr + HDA_REG_##reg, data)

Definition at line 70 of file regfuncs.h.

◆ stream_write8

#define stream_write8 (   ctx,
  reg,
  data 
)    write8((ctx)->sdAddr + HDA_REG_##reg, data)

Definition at line 64 of file regfuncs.h.

Function Documentation

◆ pci_read_cfg_byte()

static void pci_read_cfg_byte ( PBUS_INTERFACE_STANDARD  pciInterface,
UINT  reg,
BYTE data 
)
inlinestatic

Definition at line 25 of file regfuncs.h.

25 {
26 pciInterface->GetBusData(pciInterface->Context, PCI_WHICHSPACE_CONFIG, data, reg, sizeof(BYTE));
27}
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
static int reg
Definition: i386-dis.c:1290
PGET_SET_DEVICE_DATA GetBusData
Definition: iotypes.h:916
#define PCI_WHICHSPACE_CONFIG
Definition: iotypes.h:3646
unsigned char BYTE
Definition: xxhash.c:193

Referenced by update_pci_byte().

◆ pci_read_cfg_dword()

static void pci_read_cfg_dword ( PBUS_INTERFACE_STANDARD  pciInterface,
UINT  reg,
UINT32 data 
)
inlinestatic

Definition at line 29 of file regfuncs.h.

29 {
30 pciInterface->GetBusData(pciInterface->Context, PCI_WHICHSPACE_CONFIG, data, reg, sizeof(UINT32));
31}
uint32_t UINT32
Definition: typedefs.h:59

Referenced by Fdo_EvtDeviceD0Entry().

◆ pci_write_cfg_byte()

static void pci_write_cfg_byte ( PBUS_INTERFACE_STANDARD  pciInterface,
UINT  reg,
BYTE  data 
)
inlinestatic

Definition at line 33 of file regfuncs.h.

33 {
34 pciInterface->SetBusData(pciInterface->Context, PCI_WHICHSPACE_CONFIG, &data, reg, sizeof(BYTE));
35}
PGET_SET_DEVICE_DATA SetBusData
Definition: iotypes.h:915

Referenced by update_pci_byte().

◆ pci_write_cfg_dword()

static void pci_write_cfg_dword ( PBUS_INTERFACE_STANDARD  pciInterface,
UINT  reg,
UINT32  data 
)
inlinestatic

Definition at line 37 of file regfuncs.h.

37 {
38 pciInterface->GetBusData(pciInterface->Context, PCI_WHICHSPACE_CONFIG, &data, reg, sizeof(UINT32));
39}

Referenced by Fdo_EvtDeviceD0Entry().

◆ read16()

static UINT16 read16 ( PVOID  addr)
inlinestatic

Definition at line 9 of file regfuncs.h.

9 {
11}
#define READ_REGISTER_USHORT(r)
Definition: arm.h:13
GLenum const GLvoid * addr
Definition: glext.h:9621
uint16_t * PUSHORT
Definition: typedefs.h:56

Referenced by ADSPFreeStream(), ADSPGetCaptureStream(), and ADSPGetRenderStream().

◆ read32()

static UINT32 read32 ( PVOID  addr)
inlinestatic

Definition at line 17 of file regfuncs.h.

17 {
19}
#define READ_REGISTER_ULONG(r)
Definition: arm.h:10
uint32_t * PULONG
Definition: typedefs.h:59

Referenced by Fdo_EvtDevicePrepareHardware().

◆ read8()

static UINT8 read8 ( PVOID  addr)
inlinestatic

Definition at line 1 of file regfuncs.h.

1 {
3}
unsigned char * PUCHAR
Definition: typedefs.h:53
NTKERNELAPI UCHAR NTAPI READ_REGISTER_UCHAR(IN PUCHAR Register)

◆ update_pci_byte()

static void update_pci_byte ( PBUS_INTERFACE_STANDARD  pciInterface,
UINT  reg,
BYTE  mask,
BYTE  val 
)
inlinestatic

Definition at line 41 of file regfuncs.h.

41 {
42 BYTE data;
43 pci_read_cfg_byte(pciInterface, reg, &data);
44 data &= ~mask;
45 data |= (val & mask);
46 pci_write_cfg_byte(pciInterface, reg, data);
47}
GLenum GLint GLuint mask
Definition: glext.h:6028
GLuint GLfloat * val
Definition: glext.h:7180
static void pci_read_cfg_byte(PBUS_INTERFACE_STANDARD pciInterface, UINT reg, BYTE *data)
Definition: regfuncs.h:25
static void pci_write_cfg_byte(PBUS_INTERFACE_STANDARD pciInterface, UINT reg, BYTE data)
Definition: regfuncs.h:33

Referenced by Fdo_EvtDeviceD0Entry().

◆ write16()

static void write16 ( PVOID  addr,
UINT16  data 
)
inlinestatic

Definition at line 13 of file regfuncs.h.

13 {
15}
#define WRITE_REGISTER_USHORT(r, v)
Definition: arm.h:14
unsigned short USHORT
Definition: pedump.c:61

◆ write32()

static void write32 ( PVOID  addr,
UINT32  data 
)
inlinestatic

Definition at line 21 of file regfuncs.h.

21 {
23}
#define WRITE_REGISTER_ULONG(r, v)
Definition: arm.h:11
uint32_t ULONG
Definition: typedefs.h:59

Referenced by ADSPDisableSPIB(), and ADSPEnableSPIB().

◆ write8()

static void write8 ( PVOID  addr,
UINT8  data 
)
inlinestatic

Definition at line 5 of file regfuncs.h.

5 {
7}
NTKERNELAPI VOID NTAPI WRITE_REGISTER_UCHAR(IN PUCHAR Register, IN UCHAR Value)
unsigned char UCHAR
Definition: xmlstorage.h:181