Skip to content

Commit

Permalink
ACPICA: Add support for DMAR table
Browse files Browse the repository at this point in the history
Implement support for ACPI DMAR table (DMA
Remapping Table) in header files and disassembler.

Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
  • Loading branch information
Bob Moore authored and Len Brown committed Feb 3, 2007
1 parent ad71860 commit 2502fff
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 3 deletions.
14 changes: 11 additions & 3 deletions include/acpi/acdisasm.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,10 @@ typedef const struct acpi_dmtable_info {
#define ACPI_DMT_CHKSUM 20
#define ACPI_DMT_SPACEID 21
#define ACPI_DMT_GAS 22
#define ACPI_DMT_MADT 23
#define ACPI_DMT_SRAT 24
#define ACPI_DMT_EXIT 25
#define ACPI_DMT_DMAR 23
#define ACPI_DMT_MADT 24
#define ACPI_DMT_SRAT 25
#define ACPI_DMT_EXIT 26

typedef
void (*ACPI_TABLE_HANDLER) (struct acpi_table_header * table);
Expand Down Expand Up @@ -147,6 +148,11 @@ extern struct acpi_dmtable_info acpi_dm_table_info_boot[];
extern struct acpi_dmtable_info acpi_dm_table_info_cpep[];
extern struct acpi_dmtable_info acpi_dm_table_info_cpep0[];
extern struct acpi_dmtable_info acpi_dm_table_info_dbgp[];
extern struct acpi_dmtable_info acpi_dm_table_info_dmar[];
extern struct acpi_dmtable_info acpi_dm_table_info_dmar_hdr[];
extern struct acpi_dmtable_info acpi_dm_table_info_dmar_scope[];
extern struct acpi_dmtable_info acpi_dm_table_info_dmar0[];
extern struct acpi_dmtable_info acpi_dm_table_info_dmar1[];
extern struct acpi_dmtable_info acpi_dm_table_info_ecdt[];
extern struct acpi_dmtable_info acpi_dm_table_info_facs[];
extern struct acpi_dmtable_info acpi_dm_table_info_fadt1[];
Expand Down Expand Up @@ -201,6 +207,8 @@ void acpi_dm_dump_asf(struct acpi_table_header *table);

void acpi_dm_dump_cpep(struct acpi_table_header *table);

void acpi_dm_dump_dmar(struct acpi_table_header *table);

void acpi_dm_dump_fadt(struct acpi_table_header *table);

void acpi_dm_dump_srat(struct acpi_table_header *table);
Expand Down
73 changes: 73 additions & 0 deletions include/acpi/actbl1.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
#define ACPI_SIG_BOOT "BOOT" /* Simple Boot Flag Table */
#define ACPI_SIG_CPEP "CPEP" /* Corrected Platform Error Polling table */
#define ACPI_SIG_DBGP "DBGP" /* Debug Port table */
#define ACPI_SIG_DMAR "DMAR" /* DMA Remapping table */
#define ACPI_SIG_ECDT "ECDT" /* Embedded Controller Boot Resources Table */
#define ACPI_SIG_HPET "HPET" /* High Precision Event Timer table */
#define ACPI_SIG_MADT "APIC" /* Multiple APIC Description Table */
Expand Down Expand Up @@ -226,6 +227,78 @@ struct acpi_table_dbgp {
struct acpi_generic_address debug_port;
};

/*******************************************************************************
*
* DMAR - DMA Remapping table
*
******************************************************************************/

struct acpi_table_dmar {
struct acpi_table_header header; /* Common ACPI table header */
u8 width; /* Host Address Width */
u8 reserved[11];
};

/* DMAR subtable header */

struct acpi_dmar_header {
u16 type;
u16 length;
u8 flags;
u8 reserved[3];
};

/* Values for subtable type in struct acpi_dmar_header */

enum acpi_dmar_type {
ACPI_DMAR_TYPE_HARDWARE_UNIT = 0,
ACPI_DMAR_TYPE_RESERVED_MEMORY = 1,
ACPI_DMAR_TYPE_RESERVED = 2 /* 2 and greater are reserved */
};

struct acpi_dmar_device_scope {
u8 entry_type;
u8 length;
u8 segment;
u8 bus;
};

/* Values for entry_type in struct acpi_dmar_device_scope */

enum acpi_dmar_scope_type {
ACPI_DMAR_SCOPE_TYPE_NOT_USED = 0,
ACPI_DMAR_SCOPE_TYPE_ENDPOINT = 1,
ACPI_DMAR_SCOPE_TYPE_BRIDGE = 2,
ACPI_DMAR_SCOPE_TYPE_RESERVED = 3 /* 3 and greater are reserved */
};

/*
* DMAR Sub-tables, correspond to Type in struct acpi_dmar_header
*/

/* 0: Hardware Unit Definition */

struct acpi_dmar_hardware_unit {
struct acpi_dmar_header header;
u64 address; /* Register Base Address */
};

/* Flags */

#define ACPI_DMAR_INCLUDE_ALL (1)

/* 1: Reserved Memory Defininition */

struct acpi_dmar_reserved_memory {
struct acpi_dmar_header header;
u64 address; /* 4_k aligned base address */
u64 end_address; /* 4_k aligned limit address */
};

/* Flags */

#define ACPI_DMAR_ALLOW_ALL (1)

/*******************************************************************************
*
* ECDT - Embedded Controller Boot Resources Table
Expand Down

0 comments on commit 2502fff

Please sign in to comment.