PatchworkOS  966e257
A non-POSIX operating system.
Loading...
Searching...
No Matches
field_unit.c File Reference
Include dependency graph for field_unit.c:

Go to the source code of this file.

Data Structures

struct  aml_region_handler_t
 

Macros

#define AML_REGION_MAX   (sizeof(regionHandlers) / sizeof(regionHandlers[0]))
 

Enumerations

enum  aml_access_direction_t { AML_ACCESS_READ , AML_ACCESS_WRITE }
 

Functions

static void * aml_ensure_mem_is_mapped (uint64_t address, aml_bit_size_t accessSize)
 
static uint64_t aml_system_mem_read (aml_state_t *state, aml_opregion_t *opregion, uintptr_t address, aml_bit_size_t accessSize, uint64_t *out)
 
static uint64_t aml_system_mem_write (aml_state_t *state, aml_opregion_t *opregion, uint64_t address, aml_bit_size_t accessSize, uint64_t value)
 
static uint64_t aml_system_io_read (aml_state_t *state, aml_opregion_t *opregion, uint64_t address, aml_bit_size_t accessSize, uint64_t *out)
 
static uint64_t aml_system_io_write (aml_state_t *state, aml_opregion_t *opregion, uint64_t address, aml_bit_size_t accessSize, uint64_t value)
 
static uint64_t aml_pci_get_params (aml_state_t *state, aml_opregion_t *opregion, pci_segment_group_t *segmentGroup, pci_bus_t *bus, pci_slot_t *slot, pci_function_t *function)
 
static uint64_t aml_pci_config_read (aml_state_t *state, aml_opregion_t *opregion, uint64_t address, aml_bit_size_t accessSize, uint64_t *out)
 
static uint64_t aml_pci_config_write (aml_state_t *state, aml_opregion_t *opregion, uint64_t address, aml_bit_size_t accessSize, uint64_t value)
 
static uint64_t aml_opregion_read (aml_state_t *state, aml_opregion_t *opregion, uint64_t address, aml_bit_size_t accessSize, uint64_t *out)
 
static uint64_t aml_opregion_write (aml_state_t *state, aml_opregion_t *opregion, uint64_t address, aml_bit_size_t accessSize, uint64_t value)
 
static uint64_t aml_get_aligned_byte_offset (aml_bit_size_t bitOffset, aml_bit_size_t accessSize)
 
static uint64_t aml_generic_field_read_at (aml_state_t *state, aml_field_unit_t *fieldUnit, aml_bit_size_t accessSize, uint64_t byteOffset, uint64_t *out)
 
static uint64_t aml_generic_field_write_at (aml_state_t *state, aml_field_unit_t *fieldUnit, aml_bit_size_t accessSize, uint64_t byteOffset, uint64_t value)
 
static uint64_t aml_field_unit_access (aml_state_t *state, aml_field_unit_t *fieldUnit, aml_object_t *data, aml_access_direction_t direction)
 
uint64_t aml_field_unit_load (aml_state_t *state, aml_field_unit_t *fieldUnit, aml_object_t *out)
 Read the value stored in a FieldUnit. FieldUnits include Fields, IndexFields and BankFields.
 
uint64_t aml_field_unit_store (aml_state_t *state, aml_field_unit_t *fieldUnit, aml_object_t *in)
 Write a value to a FieldUnit. FieldUnits include Fields, IndexFields and BankFields.
 

Variables

static aml_region_handler_t regionHandlers []
 

Macro Definition Documentation

◆ AML_REGION_MAX

#define AML_REGION_MAX   (sizeof(regionHandlers) / sizeof(regionHandlers[0]))

Definition at line 324 of file field_unit.c.

Enumeration Type Documentation

◆ aml_access_direction_t

Enumerator
AML_ACCESS_READ 
AML_ACCESS_WRITE 

Definition at line 362 of file field_unit.c.

Function Documentation

◆ aml_ensure_mem_is_mapped()

static void * aml_ensure_mem_is_mapped ( uint64_t  address,
aml_bit_size_t  accessSize 
)
static

Definition at line 25 of file field_unit.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ aml_system_mem_read()

static uint64_t aml_system_mem_read ( aml_state_t state,
aml_opregion_t opregion,
uintptr_t  address,
aml_bit_size_t  accessSize,
uint64_t out 
)
static

Definition at line 46 of file field_unit.c.

Here is the call graph for this function:

◆ aml_system_mem_write()

static uint64_t aml_system_mem_write ( aml_state_t state,
aml_opregion_t opregion,
uint64_t  address,
aml_bit_size_t  accessSize,
uint64_t  value 
)
static

Definition at line 88 of file field_unit.c.

Here is the call graph for this function:

◆ aml_system_io_read()

static uint64_t aml_system_io_read ( aml_state_t state,
aml_opregion_t opregion,
uint64_t  address,
aml_bit_size_t  accessSize,
uint64_t out 
)
static

Definition at line 130 of file field_unit.c.

Here is the call graph for this function:

◆ aml_system_io_write()

static uint64_t aml_system_io_write ( aml_state_t state,
aml_opregion_t opregion,
uint64_t  address,
aml_bit_size_t  accessSize,
uint64_t  value 
)
static

Definition at line 155 of file field_unit.c.

Here is the call graph for this function:

◆ aml_pci_get_params()

static uint64_t aml_pci_get_params ( aml_state_t state,
aml_opregion_t opregion,
pci_segment_group_t segmentGroup,
pci_bus_t bus,
pci_slot_t slot,
pci_function_t function 
)
static

Definition at line 180 of file field_unit.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ aml_pci_config_read()

static uint64_t aml_pci_config_read ( aml_state_t state,
aml_opregion_t opregion,
uint64_t  address,
aml_bit_size_t  accessSize,
uint64_t out 
)
static

Definition at line 254 of file field_unit.c.

Here is the call graph for this function:

◆ aml_pci_config_write()

static uint64_t aml_pci_config_write ( aml_state_t state,
aml_opregion_t opregion,
uint64_t  address,
aml_bit_size_t  accessSize,
uint64_t  value 
)
static

Definition at line 287 of file field_unit.c.

Here is the call graph for this function:

◆ aml_opregion_read()

static uint64_t aml_opregion_read ( aml_state_t state,
aml_opregion_t opregion,
uint64_t  address,
aml_bit_size_t  accessSize,
uint64_t out 
)
inlinestatic

Definition at line 326 of file field_unit.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ aml_opregion_write()

static uint64_t aml_opregion_write ( aml_state_t state,
aml_opregion_t opregion,
uint64_t  address,
aml_bit_size_t  accessSize,
uint64_t  value 
)
inlinestatic

Definition at line 344 of file field_unit.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ aml_get_aligned_byte_offset()

static uint64_t aml_get_aligned_byte_offset ( aml_bit_size_t  bitOffset,
aml_bit_size_t  accessSize 
)
inlinestatic

Definition at line 356 of file field_unit.c.

Here is the caller graph for this function:

◆ aml_generic_field_read_at()

static uint64_t aml_generic_field_read_at ( aml_state_t state,
aml_field_unit_t fieldUnit,
aml_bit_size_t  accessSize,
uint64_t  byteOffset,
uint64_t out 
)
static

Definition at line 368 of file field_unit.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ aml_generic_field_write_at()

static uint64_t aml_generic_field_write_at ( aml_state_t state,
aml_field_unit_t fieldUnit,
aml_bit_size_t  accessSize,
uint64_t  byteOffset,
uint64_t  value 
)
static

Definition at line 418 of file field_unit.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ aml_field_unit_access()

static uint64_t aml_field_unit_access ( aml_state_t state,
aml_field_unit_t fieldUnit,
aml_object_t data,
aml_access_direction_t  direction 
)
static
Todo:
"An Operation Region object implicitly supports Mutex synchronization. Updates to the object, or a Field data object for the region, will automatically synchronize on the Operation Region object;" - Section 19.6.100

Definition at line 469 of file field_unit.c.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ regionHandlers

aml_region_handler_t regionHandlers[]
static
Initial value:
= {
}
static uint64_t aml_system_io_write(aml_state_t *state, aml_opregion_t *opregion, uint64_t address, aml_bit_size_t accessSize, uint64_t value)
Definition field_unit.c:155
static uint64_t aml_system_mem_read(aml_state_t *state, aml_opregion_t *opregion, uintptr_t address, aml_bit_size_t accessSize, uint64_t *out)
Definition field_unit.c:46
static uint64_t aml_pci_config_write(aml_state_t *state, aml_opregion_t *opregion, uint64_t address, aml_bit_size_t accessSize, uint64_t value)
Definition field_unit.c:287
static uint64_t aml_system_io_read(aml_state_t *state, aml_opregion_t *opregion, uint64_t address, aml_bit_size_t accessSize, uint64_t *out)
Definition field_unit.c:130
static uint64_t aml_system_mem_write(aml_state_t *state, aml_opregion_t *opregion, uint64_t address, aml_bit_size_t accessSize, uint64_t value)
Definition field_unit.c:88
static uint64_t aml_pci_config_read(aml_state_t *state, aml_opregion_t *opregion, uint64_t address, aml_bit_size_t accessSize, uint64_t *out)
Definition field_unit.c:254
@ AML_REGION_PCI_CONFIG
Definition named.h:33
@ AML_REGION_SYSTEM_IO
Definition named.h:32
@ AML_REGION_SYSTEM_MEMORY
Definition named.h:31

Definition at line 318 of file field_unit.c.