ReactOS 0.4.16-dev-306-g647d351
uthex.c File Reference
#include "acpi.h"
#include "accommon.h"
Include dependency graph for uthex.c:

Go to the source code of this file.

Macros

#define _COMPONENT   ACPI_COMPILER
 

Functions

char AcpiUtHexToAsciiChar (UINT64 Integer, UINT32 Position)
 
ACPI_STATUS AcpiUtAsciiToHexByte (char *TwoAsciiChars, UINT8 *ReturnByte)
 
UINT8 AcpiUtAsciiCharToHex (int HexChar)
 

Variables

static const char AcpiGbl_HexToAscii []
 

Macro Definition Documentation

◆ _COMPONENT

#define _COMPONENT   ACPI_COMPILER

Definition at line 47 of file uthex.c.

Function Documentation

◆ AcpiUtAsciiCharToHex()

UINT8 AcpiUtAsciiCharToHex ( int  HexChar)

Definition at line 135 of file uthex.c.

137{
138
139 /* Values 0-9 */
140
141 if (HexChar <= '9')
142 {
143 return ((UINT8) (HexChar - '0'));
144 }
145
146 /* Upper case A-F */
147
148 if (HexChar <= 'F')
149 {
150 return ((UINT8) (HexChar - 0x37));
151 }
152
153 /* Lower case a-f */
154
155 return ((UINT8) (HexChar - 0x57));
156}
unsigned char UINT8

Referenced by AcpiUtAsciiToHexByte(), and AcpiUtInsertDigit().

◆ AcpiUtAsciiToHexByte()

ACPI_STATUS AcpiUtAsciiToHexByte ( char TwoAsciiChars,
UINT8 ReturnByte 
)

Definition at line 100 of file uthex.c.

103{
104
105 /* Both ASCII characters must be valid hex digits */
106
107 if (!isxdigit ((int) TwoAsciiChars[0]) ||
108 !isxdigit ((int) TwoAsciiChars[1]))
109 {
110 return (AE_BAD_HEX_CONSTANT);
111 }
112
113 *ReturnByte =
114 AcpiUtAsciiCharToHex (TwoAsciiChars[1]) |
115 (AcpiUtAsciiCharToHex (TwoAsciiChars[0]) << 4);
116
117 return (AE_OK);
118}
#define isxdigit(c)
Definition: acclib.h:70
#define AE_BAD_HEX_CONSTANT
Definition: acexcep.h:155
#define AE_OK
Definition: acexcep.h:97
UINT8 AcpiUtAsciiCharToHex(int HexChar)
Definition: uthex.c:135

Referenced by AcpiEvMatchGpeMethod().

◆ AcpiUtHexToAsciiChar()

char AcpiUtHexToAsciiChar ( UINT64  Integer,
UINT32  Position 
)

Definition at line 74 of file uthex.c.

77{
79
81 return (AcpiGbl_HexToAscii[Index & 0xF]);
82}
unsigned long long UINT64
ACPI_STATUS AcpiUtShortShiftRight(UINT64 Operand, UINT32 Count, UINT64 *OutResult)
Definition: utmath.c:184
static COORD Position
Definition: mouse.c:34
static const char AcpiGbl_HexToAscii[]
Definition: uthex.c:53
_In_ WDFCOLLECTION _In_ ULONG Index

Referenced by AcpiExConvertToAscii(), AcpiExEisaIdToString(), and AcpiExPciClsToString().

Variable Documentation

◆ AcpiGbl_HexToAscii

const char AcpiGbl_HexToAscii[]
static
Initial value:
=
{
'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'
}

Definition at line 53 of file uthex.c.

Referenced by AcpiUtHexToAsciiChar().