ReactOS  0.4.14-dev-583-g2a1ba2c
rsaddr.c File Reference
#include "acpi.h"
#include "accommon.h"
#include "acresrc.h"
Include dependency graph for rsaddr.c:

Go to the source code of this file.

Macros

#define _COMPONENT   ACPI_RESOURCES
 

Functions

BOOLEAN AcpiRsGetAddressCommon (ACPI_RESOURCE *Resource, AML_RESOURCE *Aml)
 
void AcpiRsSetAddressCommon (AML_RESOURCE *Aml, ACPI_RESOURCE *Resource)
 

Variables

ACPI_RSCONVERT_INFO AcpiRsConvertAddress16 [5]
 
ACPI_RSCONVERT_INFO AcpiRsConvertAddress32 [5]
 
ACPI_RSCONVERT_INFO AcpiRsConvertAddress64 [5]
 
ACPI_RSCONVERT_INFO AcpiRsConvertExtAddress64 [5]
 
static ACPI_RSCONVERT_INFO AcpiRsConvertGeneralFlags [6]
 
static ACPI_RSCONVERT_INFO AcpiRsConvertMemFlags [5]
 
static ACPI_RSCONVERT_INFO AcpiRsConvertIoFlags [4]
 

Macro Definition Documentation

◆ _COMPONENT

#define _COMPONENT   ACPI_RESOURCES

Definition at line 48 of file rsaddr.c.

Function Documentation

◆ AcpiRsGetAddressCommon()

BOOLEAN AcpiRsGetAddressCommon ( ACPI_RESOURCE Resource,
AML_RESOURCE Aml 
)

Definition at line 322 of file rsaddr.c.

325 {
327 
328 
329  /* Validate the Resource Type */
330 
331  if ((Aml->Address.ResourceType > 2) &&
332  (Aml->Address.ResourceType < 0xC0))
333  {
334  return (FALSE);
335  }
336 
337  /* Get the Resource Type and General Flags */
338 
341 
342  /* Get the Type-Specific Flags (Memory and I/O descriptors only) */
343 
344  if (Resource->Data.Address.ResourceType == ACPI_MEMORY_RANGE)
345  {
348  }
349  else if (Resource->Data.Address.ResourceType == ACPI_IO_RANGE)
350  {
353  }
354  else
355  {
356  /* Generic resource type, just grab the TypeSpecific byte */
357 
358  Resource->Data.Address.Info.TypeSpecific =
359  Aml->Address.SpecificFlags;
360  }
361 
362  return (TRUE);
363 }
#define TRUE
Definition: types.h:120
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
static ACPI_RSCONVERT_INFO AcpiRsConvertIoFlags[4]
Definition: rsaddr.c:286
static ACPI_RSCONVERT_INFO AcpiRsConvertMemFlags[5]
Definition: rsaddr.c:255
_Acquires_exclusive_lock_ Resource _Acquires_shared_lock_ Resource _Inout_ PERESOURCE Resource
Definition: cdprocs.h:848
#define ACPI_FUNCTION_ENTRY()
Definition: acoutput.h:484
#define ACPI_IO_RANGE
Definition: acrestyp.h:138
static ACPI_RSCONVERT_INFO AcpiRsConvertGeneralFlags[6]
Definition: rsaddr.c:218
#define ACPI_MEMORY_RANGE
Definition: acrestyp.h:137
ACPI_STATUS AcpiRsConvertAmlToResource(ACPI_RESOURCE *Resource, AML_RESOURCE *Aml, ACPI_RSCONVERT_INFO *Info)
Definition: rsmisc.c:77
ACPI_BUFFER *RetBuffer ACPI_BUFFER *RetBuffer char ACPI_WALK_RESOURCE_CALLBACK void *Context ACPI_BUFFER *RetBuffer UINT16 ACPI_RESOURCE **ResourcePtr ACPI_GENERIC_ADDRESS *Reg UINT32 *ReturnValue UINT8 UINT8 *Slp_TypB ACPI_PHYSICAL_ADDRESS PhysicalAddress64 UINT32 UINT32 *TimeElapsed UINT32 ACPI_STATUS const char UINT32 ACPI_STATUS const char UINT32 const char const char UINT32 const char BOOLEAN UINT8 * Aml
Definition: acpixf.h:1293

Referenced by AcpiRsConvertAmlToResource().

◆ AcpiRsSetAddressCommon()

void AcpiRsSetAddressCommon ( AML_RESOURCE Aml,
ACPI_RESOURCE Resource 
)

Definition at line 381 of file rsaddr.c.

384 {
386 
387 
388  /* Set the Resource Type and General Flags */
389 
392 
393  /* Set the Type-Specific Flags (Memory and I/O descriptors only) */
394 
395  if (Resource->Data.Address.ResourceType == ACPI_MEMORY_RANGE)
396  {
399  }
400  else if (Resource->Data.Address.ResourceType == ACPI_IO_RANGE)
401  {
404  }
405  else
406  {
407  /* Generic resource type, just copy the TypeSpecific byte */
408 
409  Aml->Address.SpecificFlags =
410  Resource->Data.Address.Info.TypeSpecific;
411  }
412 }
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
static ACPI_RSCONVERT_INFO AcpiRsConvertIoFlags[4]
Definition: rsaddr.c:286
static ACPI_RSCONVERT_INFO AcpiRsConvertMemFlags[5]
Definition: rsaddr.c:255
_Acquires_exclusive_lock_ Resource _Acquires_shared_lock_ Resource _Inout_ PERESOURCE Resource
Definition: cdprocs.h:848
#define ACPI_FUNCTION_ENTRY()
Definition: acoutput.h:484
#define ACPI_IO_RANGE
Definition: acrestyp.h:138
static ACPI_RSCONVERT_INFO AcpiRsConvertGeneralFlags[6]
Definition: rsaddr.c:218
#define ACPI_MEMORY_RANGE
Definition: acrestyp.h:137
ACPI_STATUS AcpiRsConvertResourceToAml(ACPI_RESOURCE *Resource, AML_RESOURCE *Aml, ACPI_RSCONVERT_INFO *Info)
Definition: rsmisc.c:468
ACPI_BUFFER *RetBuffer ACPI_BUFFER *RetBuffer char ACPI_WALK_RESOURCE_CALLBACK void *Context ACPI_BUFFER *RetBuffer UINT16 ACPI_RESOURCE **ResourcePtr ACPI_GENERIC_ADDRESS *Reg UINT32 *ReturnValue UINT8 UINT8 *Slp_TypB ACPI_PHYSICAL_ADDRESS PhysicalAddress64 UINT32 UINT32 *TimeElapsed UINT32 ACPI_STATUS const char UINT32 ACPI_STATUS const char UINT32 const char const char UINT32 const char BOOLEAN UINT8 * Aml
Definition: acpixf.h:1293

Referenced by AcpiRsConvertResourceToAml().

Variable Documentation

◆ AcpiRsConvertAddress16

ACPI_RSCONVERT_INFO AcpiRsConvertAddress16[5]
Initial value:
=
{
0},
{ACPI_RSC_ADDRESS, 0, 0, 0},
{ACPI_RSC_MOVE16, ACPI_RS_OFFSET (Data.Address16.Address.Granularity),
AML_OFFSET (Address16.Granularity),
5},
{ACPI_RSC_SOURCE, ACPI_RS_OFFSET (Data.Address16.ResourceSource),
0,
}
ACPI_RSCONVERT_INFO AcpiRsConvertAddress16[5]
Definition: rsaddr.c:58
#define ACPI_RS_SIZE(Type)
Definition: acrestyp.h:798
#define AML_OFFSET(f)
Definition: acresrc.h:123
#define ACPI_RESOURCE_NAME_ADDRESS16
Definition: aclocal.h:1336
#define ACPI_RS_OFFSET(f)
Definition: acresrc.h:122
#define ACPI_RSC_TABLE_SIZE(d)
Definition: acresrc.h:120
#define ACPI_RESOURCE_TYPE_ADDRESS16
Definition: acrestyp.h:725
struct aml_resource_address16 AML_RESOURCE_ADDRESS16

Definition at line 58 of file rsaddr.c.

◆ AcpiRsConvertAddress32

ACPI_RSCONVERT_INFO AcpiRsConvertAddress32[5]
Initial value:
=
{
0},
{ACPI_RSC_ADDRESS, 0, 0, 0},
{ACPI_RSC_MOVE32, ACPI_RS_OFFSET (Data.Address32.Address.Granularity),
AML_OFFSET (Address32.Granularity),
5},
{ACPI_RSC_SOURCE, ACPI_RS_OFFSET (Data.Address32.ResourceSource),
0,
}
#define ACPI_RS_SIZE(Type)
Definition: acrestyp.h:798
#define AML_OFFSET(f)
Definition: acresrc.h:123
#define ACPI_RS_OFFSET(f)
Definition: acresrc.h:122
#define ACPI_RESOURCE_NAME_ADDRESS32
Definition: aclocal.h:1335
#define ACPI_RESOURCE_TYPE_ADDRESS32
Definition: acrestyp.h:726
ACPI_RSCONVERT_INFO AcpiRsConvertAddress32[5]
Definition: rsaddr.c:98
#define ACPI_RSC_TABLE_SIZE(d)
Definition: acresrc.h:120
struct aml_resource_address32 AML_RESOURCE_ADDRESS32

Definition at line 98 of file rsaddr.c.

◆ AcpiRsConvertAddress64

ACPI_RSCONVERT_INFO AcpiRsConvertAddress64[5]
Initial value:
=
{
0},
{ACPI_RSC_ADDRESS, 0, 0, 0},
{ACPI_RSC_MOVE64, ACPI_RS_OFFSET (Data.Address64.Address.Granularity),
AML_OFFSET (Address64.Granularity),
5},
{ACPI_RSC_SOURCE, ACPI_RS_OFFSET (Data.Address64.ResourceSource),
0,
}
struct aml_resource_address64 AML_RESOURCE_ADDRESS64
#define ACPI_RS_SIZE(Type)
Definition: acrestyp.h:798
#define AML_OFFSET(f)
Definition: acresrc.h:123
#define ACPI_RS_OFFSET(f)
Definition: acresrc.h:122
#define ACPI_RESOURCE_NAME_ADDRESS64
Definition: aclocal.h:1338
ACPI_RSCONVERT_INFO AcpiRsConvertAddress64[5]
Definition: rsaddr.c:138
#define ACPI_RESOURCE_TYPE_ADDRESS64
Definition: acrestyp.h:727
#define ACPI_RSC_TABLE_SIZE(d)
Definition: acresrc.h:120

Definition at line 138 of file rsaddr.c.

◆ AcpiRsConvertExtAddress64

ACPI_RSCONVERT_INFO AcpiRsConvertExtAddress64[5]
Initial value:
=
{
0},
{ACPI_RSC_ADDRESS, 0, 0, 0},
{ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.ExtAddress64.RevisionID),
AML_OFFSET (ExtAddress64.RevisionID),
1},
{ACPI_RSC_MOVE64, ACPI_RS_OFFSET (Data.ExtAddress64.Address.Granularity),
AML_OFFSET (ExtAddress64.Granularity),
6}
}
#define ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64
Definition: aclocal.h:1339
struct aml_resource_extended_address64 AML_RESOURCE_EXTENDED_ADDRESS64
#define ACPI_RS_SIZE(Type)
Definition: acrestyp.h:798
#define ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64
Definition: acrestyp.h:728
#define AML_OFFSET(f)
Definition: acresrc.h:123
#define ACPI_RS_OFFSET(f)
Definition: acresrc.h:122
#define ACPI_RSC_TABLE_SIZE(d)
Definition: acresrc.h:120
ACPI_RSCONVERT_INFO AcpiRsConvertExtAddress64[5]
Definition: rsaddr.c:178

Definition at line 178 of file rsaddr.c.

◆ AcpiRsConvertGeneralFlags

ACPI_RSCONVERT_INFO AcpiRsConvertGeneralFlags[6]
static
Initial value:
=
{
{ACPI_RSC_MOVE8, ACPI_RS_OFFSET (Data.Address.ResourceType),
AML_OFFSET (Address.ResourceType),
1},
{ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.Address.ProducerConsumer),
0},
1},
{ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.Address.MinAddressFixed),
2},
{ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.Address.MaxAddressFixed),
3}
}
#define AML_OFFSET(f)
Definition: acresrc.h:123
#define ACPI_RS_OFFSET(f)
Definition: acresrc.h:122
static WCHAR Address[46]
Definition: ping.c:68
static ACPI_RSCONVERT_INFO AcpiRsConvertGeneralFlags[6]
Definition: rsaddr.c:218
#define ACPI_RSC_TABLE_SIZE(d)
Definition: acresrc.h:120

Definition at line 218 of file rsaddr.c.

Referenced by AcpiRsGetAddressCommon(), and AcpiRsSetAddressCommon().

◆ AcpiRsConvertIoFlags

ACPI_RSCONVERT_INFO AcpiRsConvertIoFlags[4]
static
Initial value:
=
{
{ACPI_RSC_FLAGINIT, 0, AML_OFFSET (Address.SpecificFlags),
{ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET (Data.Address.Info.Io.RangeType),
AML_OFFSET (Address.SpecificFlags),
0},
{ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.Address.Info.Io.Translation),
AML_OFFSET (Address.SpecificFlags),
4},
{ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.Address.Info.Io.TranslationType),
AML_OFFSET (Address.SpecificFlags),
5}
}
static ACPI_RSCONVERT_INFO AcpiRsConvertIoFlags[4]
Definition: rsaddr.c:286
#define AML_OFFSET(f)
Definition: acresrc.h:123
#define ACPI_RS_OFFSET(f)
Definition: acresrc.h:122
static WCHAR Address[46]
Definition: ping.c:68
#define ACPI_RSC_TABLE_SIZE(d)
Definition: acresrc.h:120

Definition at line 286 of file rsaddr.c.

Referenced by AcpiRsGetAddressCommon(), and AcpiRsSetAddressCommon().

◆ AcpiRsConvertMemFlags

ACPI_RSCONVERT_INFO AcpiRsConvertMemFlags[5]
static
Initial value:
=
{
{ACPI_RSC_FLAGINIT, 0, AML_OFFSET (Address.SpecificFlags),
{ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.Address.Info.Mem.WriteProtect),
AML_OFFSET (Address.SpecificFlags),
0},
{ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET (Data.Address.Info.Mem.Caching),
AML_OFFSET (Address.SpecificFlags),
1},
{ACPI_RSC_2BITFLAG, ACPI_RS_OFFSET (Data.Address.Info.Mem.RangeType),
AML_OFFSET (Address.SpecificFlags),
3},
{ACPI_RSC_1BITFLAG, ACPI_RS_OFFSET (Data.Address.Info.Mem.Translation),
AML_OFFSET (Address.SpecificFlags),
5}
}
#define AML_OFFSET(f)
Definition: acresrc.h:123
static ACPI_RSCONVERT_INFO AcpiRsConvertMemFlags[5]
Definition: rsaddr.c:255
#define ACPI_RS_OFFSET(f)
Definition: acresrc.h:122
static WCHAR Address[46]
Definition: ping.c:68
#define ACPI_RSC_TABLE_SIZE(d)
Definition: acresrc.h:120

Definition at line 255 of file rsaddr.c.

Referenced by AcpiRsGetAddressCommon(), and AcpiRsSetAddressCommon().