diff --git a/AmiNetworkPkg/UefiNetworkStack/Common/DnsDxe/DnsDxe/DnsDxe.c b/AmiNetworkPkg/UefiNetworkStack/Common/DnsDxe/DnsDxe/DnsDxe.c index 6cd2383..a597363 100644 --- a/AmiNetworkPkg/UefiNetworkStack/Common/DnsDxe/DnsDxe/DnsDxe.c +++ b/AmiNetworkPkg/UefiNetworkStack/Common/DnsDxe/DnsDxe/DnsDxe.c @@ -105,7 +105,7 @@ CHAR16 *Hostname); /* --- Timer callback --- */ -static VOID EFIAPI DnsTimerNotify(EFI_EVENT Event, VOID *Context); +static VOID EFIAPI DnsPeriodicTimerNotify(EFI_EVENT Event, VOID *Context); static VOID EFIAPI DnsCacheTimerNotify(EFI_EVENT Event, VOID *Context); static VOID EFIAPI DnsOnUdpReceive(VOID *Context, VOID *Packet); static VOID EFIAPI DnsTransmitRetransmit(DNS_INSTANCE *Instance, @@ -313,11 +313,10 @@ } /* ======================================================================== - * DnsCreateService -- Create DNS service binding for given IP version - * (sub_7A0) + * DnsCreateService -- Create DNS service binding for given IP version. * * Allocates DNS_SERVICE_BINDING_PRIVATE structure, opens UDP protocol, - * creates timer event for cache expiry, and creates the DPC timer. + * and creates the cache-expiry timer. * ======================================================================== */ EFI_STATUS DnsCreateService( @@ -409,8 +408,7 @@ } /* ======================================================================== - * DnsDestroyService -- Tear down DNS service binding - * (sub_51C) + * DnsDestroyService -- Tear down DNS service binding. * ======================================================================== */ EFI_STATUS DnsDestroyService( @@ -456,9 +454,8 @@ } /* ======================================================================== - * DnsDriverEntry -- Top-level driver entry called from entry point + * DnsDriverEntry -- Top-level driver entry called from entry point. * Installs the driver binding protocol on ImageHandle for both IPv4 and IPv6. - * (sub_BD8) * ======================================================================== */ EFI_STATUS DnsDriverEntry( @@ -507,7 +504,7 @@ Status = BootServices->CreateEvent( EVT_NOTIFY_SIGNAL, TPL_NOTIFY, - DnsPeriodicTimer, + DnsPeriodicTimerNotify, NULL, (EFI_EVENT *)DnsCacheManager); if (EFI_ERROR(Status)) { @@ -542,7 +539,7 @@ } /* ======================================================================== - * DNSv4 Protocol: GetHostByName (sub_3540) + * DNSv4 Protocol: GetHostByName * ======================================================================== */ EFI_STATUS EFIAPI @@ -599,7 +596,7 @@ } /* ======================================================================== - * DNSv4 Protocol: GetHostByAddr (sub_377C) + * DNSv4 Protocol: GetHostByAddr * ======================================================================== */ EFI_STATUS EFIAPI @@ -678,7 +675,7 @@ } /* ======================================================================== - * DNSv4 Protocol: Poll (sub_40A4) + * DNSv4 Protocol: Poll * ======================================================================== * Checks for received network data and processes it. */ @@ -708,7 +705,7 @@ } /* ======================================================================== - * DNSv4 Protocol: Cancel (sub_4138) + * DNSv4 Protocol: Cancel * ======================================================================== * Cancels a pending DNS query token. */ @@ -738,7 +735,7 @@ } /* ======================================================================== - * DNSv4 Protocol: GetConfigData (sub_34AC) + * DNSv4 Protocol: GetConfigData * ======================================================================== * Returns current DNS configuration data (server list, cache names). */ @@ -772,7 +769,7 @@ } /* ======================================================================== - * DNSv4 Protocol: SetConfigData (sub_7A0) + * DNSv4 Protocol: SetConfigData * ======================================================================== * Sets DNS configuration and creates UDP IO for the new config. */ @@ -787,7 +784,7 @@ } /* ======================================================================== - * DNSv4 Protocol: GetServerList (sub_3540 reused) + * DNSv4 Protocol: GetServerList * ======================================================================== * Returns the list of DNS server addresses. */ @@ -852,7 +849,7 @@ } /* ======================================================================== - * DNSv4 Protocol: GetHostName / SetHostName stubs (sub_4000) + * DNSv4 Protocol: GetHostName / SetHostName stubs * ======================================================================== */ EFI_STATUS @@ -877,7 +874,7 @@ } /* ======================================================================== - * DNSv6 Protocol: GetHostByName (sub_41E8) + * DNSv6 Protocol: GetHostByName * ======================================================================== */ EFI_STATUS @@ -918,7 +915,7 @@ } /* ======================================================================== - * DNSv6 Protocol: GetHostByAddr (sub_4424) + * DNSv6 Protocol: GetHostByAddr * ======================================================================== */ EFI_STATUS @@ -985,7 +982,7 @@ } /* ======================================================================== - * DNSv6 Protocol: Poll (sub_4C60) + * DNSv6 Protocol: Poll * ======================================================================== */ EFI_STATUS @@ -1013,7 +1010,7 @@ } /* ======================================================================== - * DNSv6 Protocol: Cancel (sub_4D04) + * DNSv6 Protocol: Cancel * ======================================================================== */ EFI_STATUS @@ -1039,7 +1036,7 @@ } /* ======================================================================== - * DNSv6 Protocol: GetConfigData (sub_4D98) + * DNSv6 Protocol: GetConfigData * ======================================================================== */ EFI_STATUS @@ -1067,7 +1064,7 @@ } /* ======================================================================== - * DNSv6 Protocol: SetConfigData (sub_4E48) + * DNSv6 Protocol: SetConfigData * ======================================================================== */ EFI_STATUS @@ -1081,7 +1078,7 @@ } /* ======================================================================== - * DNSv6 Protocol: GetHostName / SetHostName (sub_4E7C, sub_4F70) + * DNSv6 Protocol: GetHostName / SetHostName * ======================================================================== */ EFI_STATUS @@ -1108,7 +1105,7 @@ } /* ======================================================================== - * DNS query building (sub_313C) + * DNS query building * ======================================================================== * Constructs a DNS query packet on the wire for the given query name, * query type (A/AAAA/PTR), and query class (IN). @@ -1167,7 +1164,7 @@ } /* ======================================================================== - * Internal DNS response parsing (sub_25D0) + * Internal DNS response parsing * ======================================================================== * Parses a received DNS response packet from the wire. * Handles A, AAAA, CNAME, and PTR records. @@ -1288,8 +1285,7 @@ } /* ======================================================================== - * DnsSubmitPacket4 -- Submit a DNSv4 query packet for transmission - * (sub_3E14 shared for 4&6) + * DnsSubmitPacket4 -- Submit a DNSv4 query packet for transmission. * ======================================================================== */ EFI_STATUS DnsSubmitPacket4( @@ -1346,7 +1342,7 @@ } /* ======================================================================== - * Periodic timer callback (sub_32F4) + * Periodic timer callback. * ======================================================================== * Fires every second. Decrements retry timers for pending token entries. * When a retry count reaches zero, the token is aborted and a timeout @@ -1433,7 +1429,7 @@ } /* ======================================================================== - * Cache manager periodic timer (sub_34AC) + * Cache manager periodic timer. * ======================================================================== * Decrements TTL for every cache entry (both IPv4 and IPv6). * When TTL hits zero, the entry is freed. @@ -1484,8 +1480,7 @@ } /* ======================================================================== - * DnsSetConfigData -- common handler for both IPv4 and IPv6 - * (sub_59C body adapted) + * DnsSetConfigData -- common handler for both IPv4 and IPv6. * ======================================================================== */ EFI_STATUS @@ -1525,8 +1520,7 @@ } /* ======================================================================== - * DnsTransmit -- send a DNS query packet via UDP - * (sub_30E8) + * DnsTransmit -- send a DNS query packet via UDP. * ======================================================================== */ EFI_STATUS @@ -1559,8 +1553,7 @@ } /* ======================================================================== - * DnsRandom -- get a random value for DNS query IDs - * (sub_7F84) + * DnsRandom -- get a random value for DNS query IDs. * ======================================================================== */ UINT32 @@ -1578,7 +1571,7 @@ } /* ======================================================================== - * ASSERT / debug support (sub_5E58, sub_5DD0) + * ASSERT / debug support. * ======================================================================== */ VOID @@ -1598,8 +1591,7 @@ } /* ======================================================================== - * DnsCreateInstance -- allocates and initializes DNS instance structure - * (sub_59C) + * DnsCreateInstance -- allocates and initializes DNS instance structure. * ======================================================================== */ EFI_STATUS @@ -1962,4 +1954,4 @@ Dns6GetServerList, /* 0x30 GetServerList */ Dns6GetHostName, /* 0x38 GetHostName */ Dns6SetHostName /* 0x40 SetHostName */ -}; \ No newline at end of file +}; diff --git a/AmiNetworkPkg/UefiNetworkStack/Ipv4/Dhcp4Dxe/Dhcp4Dxe/Dhcp4Dxe.c b/AmiNetworkPkg/UefiNetworkStack/Ipv4/Dhcp4Dxe/Dhcp4Dxe/Dhcp4Dxe.c index 04fd59d..5ca8352 100644 --- a/AmiNetworkPkg/UefiNetworkStack/Ipv4/Dhcp4Dxe/Dhcp4Dxe/Dhcp4Dxe.c +++ b/AmiNetworkPkg/UefiNetworkStack/Ipv4/Dhcp4Dxe/Dhcp4Dxe/Dhcp4Dxe.c @@ -62,9 +62,9 @@ /*----------------------------------------------------------------------------- * ModuleEntryPoint (0x528) * Standard UEFI driver entry point. - * - Calls ProcessLibraryConstructorList (sub_5B0) + * - Calls ProcessLibraryConstructorList * - Installs Driver Binding Protocol on ImageHandle - * - Calls UefiDriverModelRegister (sub_6A4) which reads NetworkStackVar to + * - Calls UefiDriverModelRegister, which reads NetworkStackVar to * decide whether to install the driver binding protocol. *----------------------------------------------------------------------------*/ EFI_STATUS @@ -99,7 +99,7 @@ } /*----------------------------------------------------------------------------- - * ProcessLibraryConstructorList (sub_5B0, 0x5B0) + * ProcessLibraryConstructorList * Initializes global pointers: gImageHandle, gST, gBS, gRT. * Also initializes DPC (Deferred Procedure Call) library. *----------------------------------------------------------------------------*/ @@ -127,14 +127,14 @@ } /*----------------------------------------------------------------------------- - * UefiDriverModelRegister (sub_6A4, 0x6A4) + * UefiDriverModelRegister * Reads "NetworkStackVar" (GUID: D1405D16-...) from UEFI variables. * If variable is non-zero (network stack enabled), installs the driver * binding protocol using gBS->InstallMultipleProtocolInterfaces. * The protocol instance includes: - * - DriverBinding (off_9120 -> sub_7A4) [Supported] - * - ComponentName (off_9178 -> sub_11CC) [ComponentName] - * - ComponentName2 (off_9160 -> sub_12AC) [ComponentName2] + * - DriverBinding (off_9120 -> Dhcp4DriverSupported) [Supported] + * - ComponentName (off_9178 -> Dhcp4ComponentNameGetName) [ComponentName] + * - ComponentName2 (off_9160 -> Dhcp4ComponentNameGetLanguage) [ComponentName2] *----------------------------------------------------------------------------*/ UINT64 UefiDriverModelRegister( @@ -175,7 +175,7 @@ } /*----------------------------------------------------------------------------- - * Dhcp4DriverUnload (sub_3A4, 0x3A4) + * Dhcp4DriverUnload * Called when the driver is unloaded. Enumerates all handles in the system * that have the DHCP4 Service Binding protocol installed, and for each one: * 1. Closes all child protocol instances (EFI_DHCP4_PROTOCOL) @@ -273,9 +273,9 @@ /*----------------------------------------------------------------------------- * Global driver binding protocol instance (at 0x9120) * Components: - * - off_9120 -> sub_7A4 = Dhcp4DriverSupported - * - off_9128 -> sub_A28 = Dhcp4DriverStart - * - off_9130 -> sub_BA8 = Dhcp4DriverStop + * - off_9120 -> Dhcp4DriverSupported + * - off_9128 -> Dhcp4DriverStart + * - off_9130 -> Dhcp4DriverStop * - off_9138 -> 0x0A = Version (1.0) * - off_9140 -> gImageHandle * - off_9148 -> gImageHandle_0 @@ -290,7 +290,7 @@ }; /*----------------------------------------------------------------------------- - * Dhcp4DriverSupported (sub_7DC, 0x7DC) + * Dhcp4DriverSupported * Checks if the controller supports DHCP4 by verifying: * 1. The MNP Service Binding protocol is present * 2. Opening UDP4 protocol BY_DRIVER succeeds @@ -330,7 +330,7 @@ } /*----------------------------------------------------------------------------- - * Dhcp4DriverStart (sub_A28, 0xA28) + * Dhcp4DriverStart * Called when the driver should start managing a controller. * 1. Opens the MNP Service Binding protocol on the controller (BY_DRIVER|EXCLUSIVE) * 2. Creates a DHCP4 child via ServiceBindingCreateChild @@ -411,7 +411,7 @@ } /*----------------------------------------------------------------------------- - * Dhcp4DriverStop (sub_BA8, 0xBA8) + * Dhcp4DriverStop * 1. Locates the DHCP4 child on the controller via MNP children list * 2. Opens EFI_DHCP4_PROTOCOL with GET_PROTOCOL + BY_CHILD * 3. Validates the DHCP_PROTOCOL signature (0x50434844 = 'DHCP') @@ -515,16 +515,16 @@ *============================================================================*/ /*----------------------------------------------------------------------------- - * Dhcp4ServiceBindingCreateChild (sub_8C8, 0x8C8) + * Dhcp4ServiceBindingCreateChild * Creates a new DHCP child instance (DHCP_PROTOCOL). * 1. Allocates and zeros 360-byte DHCP_PROTOCOL structure * 2. Sets signature = 0x50434844 ('DHCP') * 3. Stores Controller and Image handles * 4. Initializes the child request list (ParaList) * 5. Generates random XID using NetRandomInitSeed - * 6. Copies DHCP configuration block from config table (off_9150 -> sub_E30) - * 7. Creates timer event for timeout/retry (sub_2894 timer callback) - * 8. Creates UdpIo via UdpIoCreatePort (sub_72F8), with Dhcp4DriverSupported (sub_7DC) + * 6. Copies DHCP configuration block from the protocol table + * 7. Creates timer event for timeout/retry + * 8. Creates UdpIo via UdpIoCreatePort, with Dhcp4DriverSupported * as the configuration callback * 9. Copies MAC address and HW addr type/length from SNP *----------------------------------------------------------------------------*/ @@ -607,7 +607,7 @@ } /*----------------------------------------------------------------------------- - * Dhcp4ServiceBindingDestroyChild (sub_FA8, 0xFA8) + * Dhcp4ServiceBindingDestroyChild * Destroys a DHCP child instance opened by CreateChild. * 1. Validates the child via EFI_SERVICE_BINDING_PROTOCOL * 2. Validates DHCP_PROTOCOL signature via CR macro @@ -711,7 +711,7 @@ } /*----------------------------------------------------------------------------- - * Dhcp4CleanupProtocol (sub_864, 0x864) + * Dhcp4CleanupProtocol * Resets a DHCP protocol Instance back to initial state (Stopped). * - Clears UDP IO references * - Frees any parse list and selected offer @@ -775,25 +775,25 @@ /*----------------------------------------------------------------------------- * EFI_DHCP4_PROTOCOL dispatch table (at 0x9150-0x91A8) - * off_9150 -> sub_E30 = Dhcp4ProtocolInstall - * off_9158 -> sub_FA8 = Dhcp4ProtocolUninstall - * off_9160 -> sub_11CC = Dhcp4ComponentNameGetName - * off_9168 -> sub_12AC = Dhcp4ComponentNameGetLanguage + * off_9150 -> Dhcp4ProtocolInstall + * off_9158 -> Dhcp4ProtocolUninstall + * off_9160 -> Dhcp4ComponentNameGetName + * off_9168 -> Dhcp4ComponentNameGetLanguage * off_9170 -> 0x79C4 = "en" (supported language) - * off_9178 -> sub_11CC = Dhcp4ComponentNameGetName (also ComponentName) - * off_9180 -> sub_12AC = Dhcp4ComponentNameGetLanguage (also ComponentName2) + * off_9178 -> Dhcp4ComponentNameGetName (also ComponentName) + * off_9180 -> Dhcp4ComponentNameGetLanguage (also ComponentName2) * off_9190 -> 0x79C8 = "eng;en" (supported languages) - * off_91C0 -> sub_2ACC = Dhcp4GetModeData - * off_91D0 -> sub_2EE4 = Dhcp4Configure - * off_91E0 -> sub_30E0 = Dhcp4Initialize - * off_91F0 -> sub_32D0 = Dhcp4RenewRebind - * off_9200 -> sub_34B0 = Dhcp4Release - * off_9210 -> sub_3598 = Dhcp4Stop + * off_91C0 -> Dhcp4GetModeData + * off_91D0 -> Dhcp4Configure + * off_91E0 -> Dhcp4Initialize + * off_91F0 -> Dhcp4RenewRebind + * off_9200 -> Dhcp4Release + * off_9210 -> Dhcp4Stop * plus Build, TransmitReceive, Parse *----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------- - * Dhcp4GetModeData (sub_2ACC, 0x2ACC) + * Dhcp4GetModeData * EFI_DHCP4_PROTOCOL.GetModeData() * Returns the current DHCP mode data (state, IP addresses, lease info). * If ModeData is NULL, just returns EFI_INVALID_PARAMETER. @@ -849,7 +849,7 @@ } /*----------------------------------------------------------------------------- - * Dhcp4Configure (sub_2EE4, 0x2EE4) + * Dhcp4Configure * EFI_DHCP4_PROTOCOL.Configure() * Configures the DHCP instance with new configuration data. * - Validates parameters (no NULL data with non-zero lengths) @@ -955,7 +955,7 @@ } /*----------------------------------------------------------------------------- - * Dhcp4Initialize (sub_30E0, 0x30E0) + * Dhcp4Initialize * EFI_DHCP4_PROTOCOL.Initialize() * Starts the DHCP state machine. * 1. Checks media present via UdpIoCheckMediaStatus @@ -1045,7 +1045,7 @@ } /*----------------------------------------------------------------------------- - * Dhcp4RenewRebind (sub_32D0, 0x32D0) + * Dhcp4RenewRebind * EFI_DHCP4_PROTOCOL.RenewRebind() * Initiates lease renewal or rebinding. * - State must be Bound (4) @@ -1155,7 +1155,7 @@ } /*----------------------------------------------------------------------------- - * Dhcp4Releasee (sub_34B0, 0x34B0) + * Dhcp4Release * EFI_DHCP4_PROTOCOL.Re.easease() * Releaaseses the currenent DHCP lease, returning to Init state. * Only valid in Bound (4), Renewing (5), or Rebinding (6) states. @@ -1214,7 +1214,7 @@ } /*----------------------------------------------------------------------------- - * Dhcp4Stop (sub_3598, 0x3598) + * Dhcp4Stop * EFI_DHCP4_PROTOCOL.Stopop() * Stops the DHCP state machine and resets to Stopped (0) state. *----------------------------------------------------------------------------*/ @@ -1251,7 +1251,7 @@ } /*----------------------------------------------------------------------------- - * Dhcp4Build (sub_3624, 0x3624) + * Dhcp4Build * EFI_DHCP4_PROTOCOL.Build() * Builds a DHCP packet from the given paramters. *----------------------------------------------------------------------------*/ @@ -1283,7 +1283,7 @@ } /*----------------------------------------------------------------------------- - - * Dhcp4TransmitReceiveive (sub_3C08, 0x3C08) + * Dhcp4TransmitReceive * EFI_DHCP4_PROTOCOL.TransmitReceive() * Transmits a DHCP packet and waits for a response. *----------------------------------------------------------------------------*/ @@ -1434,19 +1434,19 @@ *===========================================================================*/ /*----------------------------------------------------------------------------- - * Dhcp4RxCallback (sub_2010, 0x2010) + * Dhcp4RxCallback * Called when a UDP packet is received for this DHCP Instance. * 1. Validates the packet (minimum length 0xEC = 240 bytes) * 2. Verifies DHCP message format (opcode == 2, BOOTPREPLY = 2) * 3. Checks the XID matches current transaction * 4. Validates DHCP magic cookie (0x63536363) * 5. Depending on current DHCP state, delegates to state-specific handler: - * - Selecting (2) -> Dhcp4HandleOffer (sub_1BBC) - * - Requesting (3) -> Dhcp4HandleACK (sub_1C6C) - * - Renewing (5) / Rebinding (6) -> Dhcp4HandleRenew (sub_1DBC) - * - Rebooting (8) -> Dhcp4HandleReoot (sub__1EF8) - * - InitReoot (7) -> Dhcp4HandleAck (sub_1C6C) - * 6. On failare, triggers retry/timeout via Dhcp4TimeoutHandle + * - Selecting (2) -> Dhcp4HandleOffer + * - Requesting (3) -> Dhcp4HandleAck + * - Renewing (5) / Rebinding (6) -> Dhcp4HandleRenew + * - Rebooting (8) -> Dhcp4HandleReboot + * - InitReboot (7) -> Dhcp4HandleAck + * 6. On failure, triggers retry/timeout via Dhcp4TimeoutHandler *----------------------------------------------------------------------------*/ VOID Dhcp4RxCallback( @@ -1575,7 +1575,7 @@ } /*----------------------------------------------------------------------------- - * Dhcp4TimerNotify (sub_2894, 0x2894) + * Dhcp4TimerNotify * Timer notifification for DHCP state machine. * Handles retry/timeout logic: * - Ticks the client hardware address type (type) for for DHCP transaction ID @@ -1725,7 +1725,7 @@ *===========================================================================*/ /*----------------------------------------------------------------------------- - * Dhcp4ResetProtocol (sub_1974, 0x1974) + * Dhcp4ResetProtocol * Resets a DHCP protocol Instance back to its initial state. * - Increments XID * - Clears offer/Sected offer/arsedList @@ -1780,13 +1780,13 @@ } /*----------------------------------------------------------------------------- - * Dhcp4SendMessage (sub_2260, 0x2260) + * Dhcp4SendMessage * The core DHCP message building and sending function. * Builds a DHCP packet with: * 1. IP/UDP header (bootp + UDP) * 2. DHCP header (opcode=1, htype, xid, secs, flags, ciaddr=...) * 3. Options (msg type, serverver id, requested IP, param request list, etc.) - * Uses UUdpIpoSend (sub_7664) to transact the packet via UDP. + * Uses UdpIoSend to transact the packet via UDP. *----------------------------------------------------------------------------*/ UINT64 Dhcp4SendMessage( @@ -1879,4 +1879,4 @@ /*============================================================================= * END OF DHCP4DXE DRIVER - *===========================================================================*/ \ No newline at end of file + *===========================================================================*/ diff --git a/AmiNetworkPkg/UefiNetworkStack/Ipv4/Dhcp4Dxe/Dhcp4Dxe/Dhcp4Dxe.h b/AmiNetworkPkg/UefiNetworkStack/Ipv4/Dhcp4Dxe/Dhcp4Dxe/Dhcp4Dxe.h index 67a8384..ea90c4f 100644 --- a/AmiNetworkPkg/UefiNetworkStack/Ipv4/Dhcp4Dxe/Dhcp4Dxe/Dhcp4Dxe.h +++ b/AmiNetworkPkg/UefiNetworkStack/Ipv4/Dhcp4Dxe/Dhcp4Dxe/Dhcp4Dxe.h @@ -4,16 +4,6 @@ #include "../uefi_headers/Uefi.h" /*============================================================================= - * Dhcp4Dxe - DHCPv4 Protocol Driver for UEFI Network Stack - * Source: e:\hs\AmiNetworkPkg\UefiNetworkStack\Ipv4\Dhcp4Dxe\ - * Files: Dhcp4Driver.c, Dhcp4Io.c, Dhcp4Impl.c, Dhcp4Option.c - *============================================================================= - * This module implements the EFI DHCPv4 Protocol (service binding + per-child - * protocol instances), the DHCP finite state machine, DHCP option parsing - * and building, and UDP I/O integration for sending/receiving DHCP messages. - */ - -/*============================================================================= * GUIDs *=============================================================================*/ @@ -22,7 +12,6 @@ { 0x6A7A5CFF, 0xE8D9, 0x4F70, \ { 0xBA, 0xDA, 0x75, 0xAB, 0x30, 0x25, 0xCE, 0x14 } } -/* EFI_DHCPP4_SERVICE_BINDING_PRROTOCOCOL _GUID: {{18A031AB-B443-4D1A0A0C0000000000000 0000000} */ /* Service Binding GUID for DHCP4: {18A031AB-B443-4D1A-A5C0-0C09261E9F71} */ #define EFI_DHCP4_SERVICE_BINDING_PROTOCOL_GUID \ { 0x18A031AB, 0xB443, 0x4D1A, \ @@ -33,16 +22,11 @@ { 0x8A219718, 0x4EF5, 0x4761, \ { 0x91, 0xC8, 0xC0, 0xF0, 0x4B, 0xDA, 0x9E, 0x56 } } -/* EFI_IP4_PROTOCOL_GUID: {41D94CD2-35B6-455A-8258-D4E51334AADD} (from SNP/IP4 layer) */ +/* EFI_IP4_SERVICE_BINDING_PROTOCOL_GUID */ #define EFI_IP4_SERVICE_BINDING_PROTOCOL_GUID \ { 0x83F01464, 0x99BD, 0x45E5, \ { 0xB3, 0x83, 0xAF, 0x63, 0x05, 0xD8, 0xE9, 0xE6 } } -/* EFI_UDP4_SERVICE_BINDING_PROTOCOL_GUID: {83F01464-99BD-45E5-B383-AF6305D8E9E6} */ -/* MNP_SERVICE_BINDING_PROTOCOL_GUID: {F2FD1544-9794-4A2C-992E-E5BBCF20E394} */ -/* EFI_IP4_CONFIG_PROTOCOL_GUID: {3A799C0A-5C86-4093-9650-5CD19298A600} */ -/* AMI_NETWORK_STACK_VAR_GUID: {D1405D16-7AFC-4695-BB12-41459D3695A2} */ - /*============================================================================= * DHCP4 Protocol State Machine - States *=============================================================================*/ @@ -137,7 +121,7 @@ * This is the per-child protocol instance installed on child handles. * Signature: 0x50434844 ('DHCP') * Size: 360 bytes (0x168) - * Created by CreateChild (sub_8C8) + * Created by Dhcp4ServiceBindingCreateChild *============================================================================*/ typedef struct _DHCP_PROTOCOL { /* Offset 0x00 (0) */ UINT32 Signature; // = 0x50434844 ('DHCP') @@ -193,18 +177,18 @@ } DHCP_PARSE_CONTEXT; /*============================================================================= - * EFI_DHCP4_PROTOCOL - The UEFI protocol interface (8 functions) + * EFI_DHCP4_PROTOCOL - The UEFI protocol interface *============================================================================*/ typedef struct _EFI_DHCP4_PROTOCOL { - UINT64 GetModeData; // (0) sub_2ACC - Get current mode data - UINT64 Configure; // (1) sub_2EE4 - Configure DHCP instance - UINT64 Initialize; // (2) sub_30E0 - Start DHCP - UINT64 RenewRebind; // (3) sub_32D0 - Renew/Rebind lease - UINT64 Release; // (4) sub_34B0 - Release lease - UINT64 Stop; // (5) sub_3598 - Stop DHCP - UINT64 Build; // (6) sub_3624 - Build DHCP packet - UINT64 TransmitReceive; // (7) sub_3C08 - Transmit and receive - UINT64 Parse; // (8) sub_3FFC - Parse DHCP options + UINT64 GetModeData; + UINT64 Configure; + UINT64 Initialize; + UINT64 RenewRebind; + UINT64 Release; + UINT64 Stop; + UINT64 Build; + UINT64 TransmitReceive; + UINT64 Parse; } EFI_DHCP4_PROTOCOL; /*============================================================================= @@ -247,4 +231,4 @@ 0x9110: D1405D16-7AFC-4695-BB12-41459D3695A2 AMI_NETWORK_STACK_VAR_GUID */ -#endif /* __DHCP4DXXE_H__ */ \ No newline at end of file +#endif /* __DHCP4DXE_H__ */ diff --git a/AmiNetworkPkg/UefiNetworkStack/Ipv6/Mtftp6Dxe/Mtftp6Dxe/Mtftp6Dxe.c b/AmiNetworkPkg/UefiNetworkStack/Ipv6/Mtftp6Dxe/Mtftp6Dxe/Mtftp6Dxe.c index 2e5fa64..54ae67b 100644 --- a/AmiNetworkPkg/UefiNetworkStack/Ipv6/Mtftp6Dxe/Mtftp6Dxe/Mtftp6Dxe.c +++ b/AmiNetworkPkg/UefiNetworkStack/Ipv6/Mtftp6Dxe/Mtftp6Dxe/Mtftp6Dxe.c @@ -44,15 +44,13 @@ VOID *gDpcLib = NULL; // -// Driver Binding Protocol instance table (off_9E50): -// [0]: Mtftp6DriverBindingSupported (sub_A8C) -// [1]: Mtftp6DriverBindingStart (sub_AC4) -// [2]: Mtftp6DriverBindingStop (sub_BB8) +// Driver Binding Protocol instance table: +// [0]: Mtftp6DriverBindingSupported +// [1]: Mtftp6DriverBindingStart +// [2]: Mtftp6DriverBindingStop // [3]: 1.0 (version) // [4]: NULL (image handle, filled at entry) // [5]: NULL (controller handle, filled at start) -// [6]: Mtftp6ServiceCreateChild (sub_21C4) -// [7]: Mtftp6ServiceDestroyChild (sub_232C) // EFI_DRIVER_BINDING_PROTOCOL mDriverBinding = { Mtftp6DriverBindingSupported, @@ -64,11 +62,10 @@ }; // -// Component Name table (off_9E80): -// [0]: Mtftp6ComponentName2GetDriverName (sub_21C4) -// [1]: Mtftp6ComponentName2GetControllerName (sub_232C) +// Component Name table: +// [0]: Mtftp6GetDriverName +// [1]: Mtftp6GetControllerName // [2]: "eng" language string -// [3]: NULL (child protocol guid) // EFI_COMPONENT_NAME2_PROTOCOL mComponentName2 = { Mtftp6GetDriverName, @@ -77,7 +74,7 @@ }; // -// Service Binding Protocol instance (off_9E98): +// Service Binding Protocol instance: // [0]: Mtftp6ServiceCreateChild // [1]: Mtftp6ServiceDestroyChild // @@ -87,7 +84,7 @@ }; // -// MTFTP6 Protocol instance template (off_9ED0): +// MTFTP6 Protocol instance template: // [0]: Mtftp6GetModeData // [1]: Mtftp6Configure // [2]: Mtftp6ReadFile @@ -109,7 +106,7 @@ }; //============================================================================= -// DRIVER ENTRY POINT (sub_528 + sub_698) +// DRIVER ENTRY POINT //============================================================================= EFI_STATUS @@ -122,8 +119,7 @@ EFI_STATUS Status; // - // Save global pointers and initialize library constructors - // (sub_5A4) + // Save global pointers and initialize library state. // gImageHandle = ImageHandle; gST = SystemTable; @@ -131,8 +127,7 @@ gRT = SystemTable->RuntimeServices; // - // Open DPC protocol (gEfiDpcProtocolGuid = {0x4F948815-...}) - // (sub_64C8 + BS->LocateProtocol) + // Open DPC protocol. // Status = gBS->LocateProtocol ( &gEfiDpcProtocolGuid, @@ -146,8 +141,7 @@ } // - // Read NetworkStackVar and install driver binding - // (sub_698) + // Read NetworkStackVar and install driver binding. // { UINT64 VarSize = 10; @@ -201,8 +195,7 @@ ) { // - // Check if controller already has MTFTP6 service binding installed - // (sub_A8C) + // Check if controller already has MTFTP6 service binding installed. // EFI_STATUS Status; VOID *Interface; @@ -229,8 +222,7 @@ } // - // Now try to create a child: open config protocol and create service - // (sub_800) + // Now try to create a child: open config protocol and create service. // { MTFTP6_SERVICE *Service; @@ -265,8 +257,7 @@ } // - // Open UDP I/O for IPv6 - // (sub_78D4 -> UdpIoOpenSocket) + // Open UDP I/O for IPv6. // Service->UdpIo = UdpIoOpenSocket ( ControllerHandle, @@ -295,12 +286,6 @@ IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath ) { - // (sub_AC4) - // - // 1. Test if controller already has MTFTP6 protocol - // 2. CreateService (sub_800) if needed - // 3. Reinstall timer - // 4. Install protocol on controller // return EFI_UNSUPPORTED; // Placeholder } @@ -314,7 +299,6 @@ IN EFI_HANDLE *ChildHandleBuffer ) { - // (sub_BB8) return EFI_UNSUPPORTED; } @@ -329,7 +313,6 @@ IN EFI_HANDLE *ChildHandle ) { - // (sub_21C4) return EFI_UNSUPPORTED; } @@ -340,7 +323,6 @@ IN EFI_HANDLE *ChildHandle ) { - // (sub_232C) return EFI_UNSUPPORTED; } @@ -355,11 +337,6 @@ OUT EFI_MTFTP6_MODE_DATA *ModeData ) { - // (sub_D60) - // - // Allocates a MTFTP6_INSTANCE (280 bytes), copies config data, - // opens UDP I/O from controller, returns mode info. - // return EFI_UNSUPPORTED; } @@ -370,11 +347,6 @@ IN EFI_MTFTP6_CONFIG_DATA *ConfigData ) { - // (sub_F00) - // - // Marks instance as configured, sets up UDP I/O callback - // registration for Rx and Tx. - // return EFI_UNSUPPORTED; } @@ -385,18 +357,6 @@ IN EFI_MTFTP6_TOKEN *Token ) { - // (sub_1DC4 / sub_2764) - // - // Main read file entry: - // 1. Validate parameters (filename, mode, buffer) - // 2. Clear previous operation via sub_1C08 - // 3. Allocate block range list - // 4. For RRQ (opcode 1): allocate block range 0x1-0xFFFF - // 5. Build WRQ request packet (sub_150C) - // - opcode 2 + filename + "octet" + options - // 6. Register callback (sub_3144 for RRQ) via UdpIoRecvDatagram - // 7. Send request packet (sub_18AC) - // 8. Poll until completion (wait on event) // return EFI_UNSUPPORTED; } @@ -408,25 +368,20 @@ IN EFI_MTFTP6_TOKEN *Token ) { - // (sub_2510) - // - // Main write file entry. - // Similar to ReadFile but uses WRQ operation. - // return EFI_UNSUPPORTED; } EFI_STATUS EFIAPI Mtftp6ReadDirectory ( - IN EFI_MTFTP6_PROTOCOL *Thhii, - IN EF_MTFTP6_TTOKEN *ToKenne + IN EFI_MTFTP6_PROTOCOL *This, + IN EFI_MTFTP6_TOKEN *Token ) { // // Not implemented (returns EFI_UNSUPPORTED) // - returnrENN_ENSUPPORTED; + return EFI_UNSUPPORTED; } EFI_STATUS @@ -435,10 +390,6 @@ IN EFI_MTFTP6_PROTOCOL *This ) { - // (sub_21C4 or sub_6184) - // - // Polls for Rx events via UdpIoRecvDatagram / DPC queue drain. - // return EFI_UNSUPPORTED; } @@ -454,7 +405,7 @@ ) { // - // (sub_3144) + // Mtftp6RrqCallback // // Main RRQ receive callback: // Triggered by UdpIo when a datagram arrives. @@ -464,11 +415,11 @@ // 2. Check UdpToken status // 3. Parse received packet headers // 4. Dispatch on opcode: - // - DATA (3): sub_2B78 -> sub_29F8 (store data) + sub_2958 (send ACK) - // - OACK (6): sub_2E18 (parse options, might set up multicast) + // - DATA (3): dispatch -> Mtftp6DataProcess (store data) + Mtftp6SendAck + // - OACK (6): parse options, might set up multicast // - ERROR (5): abort // 5. Re-register for next recv via UdpIoRecvDatagram - // 6. On completion, call sub_1C08 + // 6. On completion, call Mtftp6CleanupOperation // } @@ -480,18 +431,18 @@ ) { // - // (sub_393C) + // Mtftp6WrqCallback // // Main WRQ receive callback: // Triggered by UdpIo when a datagram arrives during WRQ. // // 1. Validate instance // 2. Dispatch on opcode: - // - ACK (4): sub_3678 -> sub_34A0 (send next data block) - // - OACK (6): sub_37AC (parse options) -> sub_3678 + // - ACK (4): advance -> send next data block + // - OACK (6): parse options -> advance // - ERROR (5): abort // - // 3. On completion, call sub_1C08 + // 3. On completion, call Mtftp6CleanupOperation // } @@ -503,7 +454,7 @@ ) { // - // (sub_2D70) + // Mtftp6MulticastCallback // // Multicast reception callback. // Handles data blocks arriving on the multicast socket. @@ -521,14 +472,14 @@ ) { // - // (sub_20F8) + // Mtftp6TimeoutNotify // // Timer event callback: // 1. Iterate all active instances in service child list // 2. For each instance with pending retx: // - Decrement retry count // - If count reaches 0: call Mtftp6CleanupOperation with EFI_TIMEOUT - // - Else: resend (sub_18AC) the current packet + // - Else: resend the current packet via Mtftp6Transmit // return EFI_SUCCESS; } @@ -540,7 +491,7 @@ ) { // - // (sub_1C08) + // Mtftp6CleanupOperation // // Cleans up an in-progress operation: // 1. Set token status @@ -558,12 +509,12 @@ ) { // - // (sub_2958) + // Mtftp6SendAck // // Build and send an ACK packet: // 1. Allocate 4-byte packet buffer // 2. Set opcode=4 (ACK), block number - // 3. Transmit via sub_18AC + // 3. Transmit via Mtftp6Transmit // return EFI_UNSUPPORTED; } @@ -576,12 +527,12 @@ ) { // - // (sub_17BC) + // Mtftp6SendError // // Build and send an ERROR packet: // 1. Allocate packet buffer // 2. Set opcode=5 (ERROR), error code, error string - // 3. Transmit via sub_18AC + // 3. Transmit via Mtftp6Transmit // return EFI_UNSUPPORTED; } @@ -596,11 +547,11 @@ ) { // - // (sub_29F8) + // Mtftp6DataProcess // // Process incoming DATA packet: // 1. Extract block number from packet header - // 2. Verify block number ordering (sub_11DC) + // 2. Verify block number ordering // 3. Copy payload into token buffer // 4. If last block: signal completion // @@ -614,16 +565,16 @@ ) { // - // (sub_150C for WRQ type, sub_3430 for RRQ type) + // Mtftp6SendRequest // // Build the initial request packet (RRQ or WRQ): // 1. Calculate total packet length: // 2 (opcode) + len(filename) + 1 + len("octet") + 1 + // sum for each option: len(optname)+1 + len(optval)+1 - // 2. Allocate and fill packet buffer (sub_6AF0 + sub_7140) - // 3. Copy filename and mode using AsciiStrCpyS (sub_49D8) + // 2. Allocate and fill packet buffer + // 3. Copy filename and mode using AsciiStrCpyS // 4. Copy options - // 5. Transmit via sub_18AC + // 5. Transmit via Mtftp6Transmit // return EFI_UNSUPPORTED; } @@ -635,7 +586,7 @@ ) { // - // (sub_18AC) + // Mtftp6Transmit // // Core transmit routine: // 1. Zero UDP Tx token (52 bytes) @@ -644,7 +595,7 @@ // 4. For RRQ/WRRQ: send via UdpIoSendDatagram // 5. Wait on completion event (poll DPC queue) // 6. Handle timeout/retry - // 7. After send, re-register recv callback via sub_7DBC + // 7. After send, re-register recv callback // return EFI_UNSUPPORTED; } diff --git a/AmiNetworkPkg/UefiNetworkStack/Ipv6/Mtftp6Dxe/Mtftp6Dxe/Mtftp6Dxe.h b/AmiNetworkPkg/UefiNetworkStack/Ipv6/Mtftp6Dxe/Mtftp6Dxe/Mtftp6Dxe.h index c3bfea9..bf7014e 100644 --- a/AmiNetworkPkg/UefiNetworkStack/Ipv6/Mtftp6Dxe/Mtftp6Dxe/Mtftp6Dxe.h +++ b/AmiNetworkPkg/UefiNetworkStack/Ipv6/Mtftp6Dxe/Mtftp6Dxe/Mtftp6Dxe.h @@ -1,490 +1,160 @@ -/** @file - Mtftp6Dxe.h -- Header for Mtftp6Dxe - -Copyright (c) HR650X BIOS Decompilation Project -**/ - #ifndef __MTFTP6DXE_H__ #define __MTFTP6DXE_H__ #include "../uefi_headers/Uefi.h" -// -// Function Prototypes -// - EFI_STATUS EFIAPI -Mtftp6DriverEntryPoint( - VOID -); +Mtftp6DriverEntryPoint ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ); EFI_STATUS EFIAPI -Mtftp6DriverBindingSupported( - VOID -); +Mtftp6DriverBindingSupported ( + IN EFI_DRIVER_BINDING_PROTOCOL *This, + IN EFI_HANDLE ControllerHandle, + IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath + ); EFI_STATUS EFIAPI -Mtftp6DriverBindingStart( - VOID -); +Mtftp6DriverBindingStart ( + IN EFI_DRIVER_BINDING_PROTOCOL *This, + IN EFI_HANDLE ControllerHandle, + IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath + ); EFI_STATUS EFIAPI -Mtftp6DriverBindingStop( - VOID -); +Mtftp6DriverBindingStop ( + IN EFI_DRIVER_BINDING_PROTOCOL *This, + IN EFI_HANDLE ControllerHandle, + IN UINTN NumberOfChildren, + IN EFI_HANDLE *ChildHandleBuffer + ); EFI_STATUS EFIAPI -Mtftp6ServiceCreateChild( - VOID -); +Mtftp6ServiceCreateChild ( + IN EFI_MTFTP6_SERVICE_BINDING_PROTOCOL *This, + IN EFI_HANDLE *ChildHandle + ); EFI_STATUS EFIAPI -Mtftp6ServiceDestroyChild( - VOID -); +Mtftp6ServiceDestroyChild ( + IN EFI_MTFTP6_SERVICE_BINDING_PROTOCOL *This, + IN EFI_HANDLE *ChildHandle + ); EFI_STATUS EFIAPI -Mtftp6GetModeData( - VOID -); +Mtftp6GetModeData ( + IN EFI_MTFTP6_PROTOCOL *This, + OUT EFI_MTFTP6_MODE_DATA *ModeData + ); EFI_STATUS EFIAPI -Mtftp6Configure( - VOID -); +Mtftp6Configure ( + IN EFI_MTFTP6_PROTOCOL *This, + IN EFI_MTFTP6_CONFIG_DATA *ConfigData + ); EFI_STATUS EFIAPI -Mtftp6ReadFile( - VOID -); +Mtftp6ReadFile ( + IN EFI_MTFTP6_PROTOCOL *This, + IN EFI_MTFTP6_TOKEN *Token + ); EFI_STATUS EFIAPI -Mtftp6WriteFile( - VOID -); +Mtftp6WriteFile ( + IN EFI_MTFTP6_PROTOCOL *This, + IN EFI_MTFTP6_TOKEN *Token + ); EFI_STATUS EFIAPI -Mtftp6ReadDirectory( - VOID -); +Mtftp6ReadDirectory ( + IN EFI_MTFTP6_PROTOCOL *This, + IN EFI_MTFTP6_TOKEN *Token + ); EFI_STATUS EFIAPI -Mtftp6Poll( - VOID -); +Mtftp6Poll ( + IN EFI_MTFTP6_PROTOCOL *This + ); -EFI_STATUS +VOID EFIAPI -Mtftp6RrqCallback( - VOID -); +Mtftp6RrqCallback ( + IN VOID *Context, + IN EFI_UDP6_COMPLETION_TOKEN *UdpToken + ); -EFI_STATUS +VOID EFIAPI -Mtftp6WrqCallback( - VOID -); +Mtftp6WrqCallback ( + IN VOID *Context, + IN EFI_UDP6_COMPLETION_TOKEN *UdpToken + ); -EFI_STATUS +VOID EFIAPI -Mtftp6MulticastCallback( - VOID -); +Mtftp6MulticastCallback ( + IN VOID *Context, + IN EFI_UDP6_COMPLETION_TOKEN *UdpToken + ); EFI_STATUS -EFIAPI -Mtftp6TimeoutNotify( - VOID -); +Mtftp6TimeoutNotify ( + IN EFI_EVENT Event, + IN VOID *Context + ); -EFI_STATUS -EFIAPI -Mtftp6CleanupOperation( - VOID -); +VOID +Mtftp6CleanupOperation ( + IN MTFTP6_INSTANCE *Instance, + IN EFI_STATUS Status + ); EFI_STATUS -EFIAPI -Mtftp6SendAck( - VOID -); +Mtftp6SendAck ( + IN MTFTP6_INSTANCE *Instance, + IN UINT16 BlockNum + ); EFI_STATUS -EFIAPI -Mtftp6SendError( - VOID -); +Mtftp6SendError ( + IN MTFTP6_INSTANCE *Instance, + IN UINT16 ErrorCode, + IN CHAR8 *ErrorMessage + ); EFI_STATUS -EFIAPI -Mtftp6DataProcess( - VOID -); +Mtftp6DataProcess ( + IN MTFTP6_INSTANCE *Instance, + IN UINT8 *Packet, + IN UINT32 PacketLen, + OUT UINT64 *NetBuf, + OUT BOOLEAN *Completed + ); EFI_STATUS -EFIAPI -Mtftp6SendRequest( - VOID -); +Mtftp6SendRequest ( + IN MTFTP6_INSTANCE *Instance, + IN UINT16 OpCode + ); EFI_STATUS -EFIAPI -Mtftp6Transmit( - VOID -); +Mtftp6Transmit ( + IN MTFTP6_INSTANCE *Instance, + IN UINT64 Packet + ); -EFI_STATUS -EFIAPI -globals( - VOID -); - -EFI_STATUS -EFIAPI -gImageHandle = NULL;( - VOID -); - -EFI_STATUS -EFIAPI -Binding Protocol instance table (off_9E50):( - VOID -); - -EFI_STATUS -EFIAPI -mDriverBinding = {( - VOID -); - -EFI_STATUS -EFIAPI -Name table (off_9E80):( - VOID -); - -EFI_STATUS -EFIAPI -mComponentName2 = {( - VOID -); - -EFI_STATUS -EFIAPI -Binding Protocol instance (off_9E98):( - VOID -); - -EFI_STATUS -EFIAPI -mServiceBinding = {( - VOID -); - -EFI_STATUS -EFIAPI -Protocol instance template (off_9ED0):( - VOID -); - -EFI_STATUS -EFIAPI -mMtftp6ProtocolTemplate = {( - VOID -); - -EFI_STATUS -EFIAPI -ENTRY POINT (sub_528 + sub_698)( - VOID -); - -EFI_STATUS -EFIAPI -global pointers and initialize library constructors( - VOID -); - -EFI_STATUS -EFIAPI -= ImageHandle;( - VOID -); - -EFI_STATUS -EFIAPI -DPC protocol (gEfiDpcProtocolGuid = {0x4F948815-...})( - VOID -); - -EFI_STATUS -EFIAPI -= gBS->LocateProtocol (( - VOID -); - -EFI_STATUS -EFIAPI -NetworkStackVar and install driver binding( - VOID -); - -EFI_STATUS -EFIAPI -exists -> install driver binding protocol( - VOID -); - -EFI_STATUS -EFIAPI -= gBS->InstallMultipleProtocolInterfaces (( - VOID -); - -EFI_STATUS -EFIAPI -BINDING PROTOCOL( - VOID -); - -EFI_STATUS -EFIAPI -if controller already has MTFTP6 service binding installed( - VOID -); - -EFI_STATUS -EFIAPI -Status;( - VOID -); - -EFI_STATUS -EFIAPI -has our protocol -> unsupported (already bound)( - VOID -); - -EFI_STATUS -EFIAPI -try to create a child: open config protocol and create service( - VOID -); - -EFI_STATUS -EFIAPI -a timer event for timeout handling( - VOID -); - -EFI_STATUS -EFIAPI -= gBS->CreateEvent (( - VOID -); - -EFI_STATUS -EFIAPI -UDP I/O for IPv6( - VOID -); - -EFI_STATUS -EFIAPI -RxNotify( - VOID -); - -EFI_STATUS -EFIAPI -EFI_UNSUPPORTED; // Placeholder( - VOID -); - -EFI_STATUS -EFIAPI -PROTOCOL IMPLEMENTATION( - VOID -); - -EFI_STATUS -EFIAPI -a MTFTP6_INSTANCE (280 bytes), copies config data( - VOID -); - -EFI_STATUS -EFIAPI -UDP I/O from controller, returns mode info.( - VOID -); - -EFI_STATUS -EFIAPI -EFI_UNSUPPORTED;( - VOID -); - -EFI_STATUS -EFIAPI -instance as configured, sets up UDP I/O callback( - VOID -); - -EFI_STATUS -EFIAPI -for Rx and Tx.( - VOID -); - -EFI_STATUS -EFIAPI -read file entry:( - VOID -); - -EFI_STATUS -EFIAPI -write file entry.( - VOID -); - -EFI_STATUS -EFIAPI -to ReadFile but uses WRQ operation.( - VOID -); - -EFI_STATUS -EFIAPI -implemented (returns EFI_UNSUPPORTED)( - VOID -); - -EFI_STATUS -EFIAPI -for Rx events via UdpIoRecvDatagram / DPC queue drain.( - VOID -); - -EFI_STATUS -EFIAPI -HANDLERS( - VOID -); - -EFI_STATUS -EFIAPI -RRQ receive callback:( - VOID -); - -EFI_STATUS -EFIAPI -by UdpIo when a datagram arrives.( - VOID -); - -EFI_STATUS -EFIAPI -WRQ receive callback:( - VOID -); - -EFI_STATUS -EFIAPI -by UdpIo when a datagram arrives during WRQ.( - VOID -); - -EFI_STATUS -EFIAPI -reception callback.( - VOID -); - -EFI_STATUS -EFIAPI -data blocks arriving on the multicast socket.( - VOID -); - -EFI_STATUS -EFIAPI -OPERATIONS( - VOID -); - -EFI_STATUS -EFIAPI -event callback:( - VOID -); - -EFI_STATUS -EFIAPI -EFI_SUCCESS;( - VOID -); - -EFI_STATUS -EFIAPI -up an in-progress operation:( - VOID -); - -EFI_STATUS -EFIAPI -and send an ACK packet:( - VOID -); - -EFI_STATUS -EFIAPI -and send an ERROR packet:( - VOID -); - -EFI_STATUS -EFIAPI -incoming DATA packet:( - VOID -); - -EFI_STATUS -EFIAPI -the initial request packet (RRQ or WRQ):( - VOID -); - -EFI_STATUS -EFIAPI -(opcode) + len(filename) + 1 + len("octet") + 1 +( - VOID -); - -EFI_STATUS -EFIAPI -for each option: len(optname)+1 + len(optval)+1( - VOID -); - -EFI_STATUS -EFIAPI -transmit routine:( - VOID -); - -#endif /* __MTFTP6DXE_H__ */ \ No newline at end of file +#endif /* __MTFTP6DXE_H__ */ diff --git a/CpRcPkg/Universal/RegAccess/Pei/RegAccessPeim/RegAccessPeim.c b/CpRcPkg/Universal/RegAccess/Pei/RegAccessPeim/RegAccessPeim.c index 5054761..a1f2758 100644 --- a/CpRcPkg/Universal/RegAccess/Pei/RegAccessPeim/RegAccessPeim.c +++ b/CpRcPkg/Universal/RegAccess/Pei/RegAccessPeim/RegAccessPeim.c @@ -88,7 +88,7 @@ /* ======================================================================== * Utility: library-style memset replacement * Equivalent to memset(buf, value, count) - * Address: sub_FFDAEC4C + * Utility helper * ======================================================================== */ VOID * EFIAPI @@ -104,7 +104,7 @@ /* ======================================================================== * Utility: library-style memmove replacement * Handles overlapping regions - * Address: sub_FFDAEC6C + * Utility helper * ======================================================================== */ CHAR8 * EFIAPI @@ -134,7 +134,7 @@ /* ======================================================================== * Utility: fill 64-bit values into array - * Address: sub_FFDAECCC + * Utility helper * Parameters: * Base - destination array base (UINT64*) * Index - starting index, decremented to 0 @@ -157,7 +157,7 @@ /* ======================================================================== * Utility: memset32 wrapper - * Address: sub_FFDAECEC + * Utility helper * ======================================================================== */ VOID * EFIAPI @@ -173,7 +173,7 @@ /* ======================================================================== * PEI Services: Get PEI Services Table Pointer * Returns the PeiServices pointer via IDT-based lookup - * Address: sub_FFDAF396 + * PEI services helper * ======================================================================== */ INTN EFIAPI @@ -195,7 +195,7 @@ /* ======================================================================== * PEI Services: Report Debug/Assert Message - * Address: sub_FFDAEDE9 + * Debug helper * ======================================================================== */ VOID EFIAPI @@ -224,7 +224,7 @@ /* ======================================================================== * PEI Services: Debug Print (simple) - * Address: sub_FFDAEE13 + * Debug helper * ======================================================================== */ INTN EFIAPI @@ -253,7 +253,7 @@ /* ======================================================================== * Get Debug Error Level via CMOS * Reads CMOS index 0x4A to determine current debug print mask - * Address: sub_FFDAF3C8 + * Debug helper * ======================================================================== */ INTN EFIAPI @@ -286,7 +286,7 @@ /* ======================================================================== * Utility: Always returns TRUE (debug enabled) - * Address: sub_FFDAEE31 + * Utility helper * ======================================================================== */ BOOLEAN EFIAPI @@ -299,7 +299,7 @@ /* ======================================================================== * Utility: Boolean conversion - * Address: sub_FFDAEE34 + * Utility helper * ======================================================================== */ BOOLEAN EFIAPI @@ -312,7 +312,7 @@ /* ======================================================================== * Cpu Dead Loop (infinite loop on error assertion) - * Address: sub_FFDAF8F2 + * Assertion helper * ======================================================================== */ VOID EFIAPI @@ -338,7 +338,7 @@ /* ======================================================================== * IO Memory Read (aligned memory access) - * Address: sub_FFDAEE3D + * MMIO helper * ======================================================================== */ INTN EFIAPI @@ -368,7 +368,7 @@ /* ======================================================================== * IO Memory Write (aligned memory access) - * Address: sub_FFDAEEC7 + * MMIO helper * ======================================================================== */ INTN EFIAPI @@ -399,7 +399,7 @@ /* ======================================================================== * Bitwise merge (used by ReadModify) - * Address: sub_FFDAEF49 + * Bitfield helper * ======================================================================== */ UINTN EFIAPI @@ -429,7 +429,7 @@ /* ======================================================================== * Shift Left 64 (with bounds check) - * Address: sub_FFDAF417 (LShiftU64) + * Shift helper * ======================================================================== */ UINT64 EFIAPI @@ -450,7 +450,7 @@ /* ======================================================================== * Shift Right 64 (with bounds check) - * Address: sub_FFDAF459 (RShiftU64) + * Shift helper * ======================================================================== */ UINT64 EFIAPI @@ -468,7 +468,7 @@ /* ======================================================================== * Read IDTR (sidt instruction wrapper) - * Address: sub_FFDAF49B + * Utility helper * ======================================================================== */ VOID EFIAPI @@ -482,8 +482,7 @@ /* ======================================================================== * PCD Protocol: Get PCD value via PCD protocol - * Called by sub_FFDAF6D7 / sub_FFDAF72F / sub_FFDAF73E - * Address: sub_FFDAF6D7 + * PCD helper * ======================================================================== */ VOID * EFIAPI @@ -505,7 +504,7 @@ /* ======================================================================== * PCD Get Pointer wrapper (token 5) - * Address: sub_FFDAF72F + * PCD helper * ======================================================================== */ VOID * EFIAPI @@ -523,7 +522,7 @@ /* ======================================================================== * PCD Get Size wrapper (token 6) - * Address: sub_FFDAF73E + * PCD helper * ======================================================================== */ UINTN EFIAPI @@ -539,7 +538,7 @@ /* ======================================================================== * PCD Set Ptr/Size (allocate PCD data buffer) - * Address: sub_FFDAF4BE + * PCD helper * ======================================================================== */ EFI_STATUS EFIAPI @@ -562,7 +561,7 @@ /* ======================================================================== * Register Access: Lookup PCD data pointer - * Address: sub_FFDAF559 + * Address translation helper * ======================================================================== */ VOID * EFIAPI @@ -605,12 +604,12 @@ /* ======================================================================== * Address translation page table walk - * Address: sub_FFDAF95E - maps box instance to page table index + * Address translation helper * ======================================================================== */ /* ======================================================================== * Translate Socket & Box Type to page table index (high-level) - * Address: sub_FFDAF95E + * Address translation helper * Returns a byte index into the socket/box-specific page table * ======================================================================== */ UINTN @@ -622,14 +621,13 @@ IN UINTN FunctionalBlock ) { - /* Validated by sub_FFDAF95E via sub_FFDAF8F2 on failure*/ - /* Complex mapping - refer to decompiled sub_FFDAF95E for full cases */ + /* Validated by the translation helper on failure. */ return 0; } /* ======================================================================== * Device number lookup (address translation step 2) - * Address: sub_FFDAFB26 + * Address translation helper * ======================================================================== */ UINTN EFIAPI @@ -691,14 +689,14 @@ } return Index; - /* ... many more cases - see decompiled sub_FFDAFB26 for complete mapping */ + /* Remaining cases follow the same translation pattern. */ } return 0; } /* ======================================================================== * Functional block number lookup (address translation step 3) - * Address: sub_FFDAFED6 + * Address translation helper * ======================================================================== */ UINTN EFIAPI @@ -745,7 +743,7 @@ * Address translation: page table walk (3-level) * Combines socket, box type, instance, and functional block into * a final page table index. - * Address: sub_FFDAF85A + * Address translation helper * ======================================================================== */ UINTN EFIAPI @@ -774,7 +772,7 @@ /* ======================================================================== * Validate register range and alignment - * Address: sub_FFDAF121 + * Validation helper * Returns 0 on success, EFI error code on failure * ======================================================================== */ EFI_STATUS @@ -817,7 +815,7 @@ /* ======================================================================== * DISPATCH: RegAccess Read Register (via dispatch table) - * Address: sub_FFDAED4C (dispatch) -> call sub_FFDAF0ED (actual) + * Dispatch helper * ======================================================================== */ EFI_STATUS EFIAPI @@ -833,7 +831,7 @@ /* ======================================================================== * DISPATCH: RegAccess Write Register (via dispatch table) - * Address: sub_FFDAED63 -> call sub_FFDAF271 + * Dispatch helper * ======================================================================== */ EFI_STATUS EFIAPI @@ -849,7 +847,7 @@ /* ======================================================================== * DISPATCH: RegAccess Read Modify (via dispatch table) - * Address: sub_FFDAED7A -> call sub_FFDAF343 + * Dispatch helper * ======================================================================== */ EFI_STATUS EFIAPI @@ -866,7 +864,7 @@ /* ======================================================================== * DISPATCH: RegAccess Get Config Space - * Address: sub_FFDAED96 -> call sub_FFDAF0CF + * Dispatch helper * ======================================================================== */ VOID EFIAPI @@ -882,7 +880,7 @@ /* ======================================================================== * IMPL: RegAccess Read Register (box type dispatch = 0) * Reads from translated address via IoMemRead - * Address: sub_FFDAF0ED + * Implementation helper * ======================================================================== */ EFI_STATUS EFIAPI @@ -907,7 +905,7 @@ /* ======================================================================== * IMPL: RegAccess Write Register (box type dispatch = 0) * Writes to translated address via IoMemWrite - * Address: sub_FFDAF271 + * Implementation helper * ======================================================================== */ EFI_STATUS EFIAPI @@ -932,7 +930,7 @@ /* ======================================================================== * IMPL: RegAccess Read Modify (box type dispatch = 0) * Reads, applies AND/OR mask, writes back - * Address: sub_FFDAF343 + * Implementation helper * ======================================================================== */ EFI_STATUS EFIAPI @@ -954,7 +952,7 @@ /* ======================================================================== * IMPL: Read multiple elements via IoMemRead (box type dispatch = 1) - * Address: sub_FFDAF1D8 + * Implementation helper * ======================================================================== */ EFI_STATUS EFIAPI @@ -1004,7 +1002,7 @@ /* ======================================================================== * IMPL: Write multiple elements via IoMemWrite (box type dispatch = 1) - * Address: sub_FFDAF2AA + * Implementation helper * ======================================================================== */ EFI_STATUS EFIAPI @@ -1049,7 +1047,7 @@ /* ======================================================================== * IMPL: Get MMIO address from descriptor (box type dispatch = 0) - * Address: sub_FFDAF0CF + * Implementation helper * ======================================================================== */ INTN EFIAPI @@ -1067,7 +1065,7 @@ /* ======================================================================== * Page table address translation (full path) - * Address: sub_FFDAF74D + * Address translation helper * ======================================================================== */ EFI_STATUS EFIAPI @@ -1123,8 +1121,7 @@ } /* ======================================================================== - * Thunk: sub_FFDAEFD6 = RegAccessGetConfigSpace via sub_FFDAF74D - * Address: sub_FFDAEFD6 + * Thunk helper * ======================================================================== */ INTN EFIAPI @@ -1146,7 +1143,7 @@ /* ======================================================================== * Write config space via translation and IoMemWrite - * Address: sub_FFDAF012 + * Thunk helper * ======================================================================== */ INTN EFIAPI @@ -1168,7 +1165,7 @@ /* ======================================================================== * Thunk: ReadModify with AND/OR via translation - * Address: sub_FFDAF04F + * Thunk helper * ======================================================================== */ INTN EFIAPI @@ -1195,7 +1192,7 @@ /* ======================================================================== * Address translation helper (strip high bits) - * Address: sub_FFDB010B + * Address helper * ======================================================================== */ UINT32 EFIAPI @@ -1246,7 +1243,7 @@ /* ======================================================================== * PCD Get PPI via PeiServices->LocatePpi * Equivalent to PeiPcdLib GetPcdProtocol() - * Address: sub_FFDAF6D7 with PCD token 5 + * PCD helper * ======================================================================== */ VOID * EFIAPI diff --git a/MdeModulePkg/Universal/PCD/Pei/Service.c/PchResetRuntime/PchResetRuntime.c b/MdeModulePkg/Universal/PCD/Pei/Service.c/PchResetRuntime/PchResetRuntime.c index 05bd55c..1e79a7e 100644 --- a/MdeModulePkg/Universal/PCD/Pei/Service.c/PchResetRuntime/PchResetRuntime.c +++ b/MdeModulePkg/Universal/PCD/Pei/Service.c/PchResetRuntime/PchResetRuntime.c @@ -25,7 +25,7 @@ return 0x8000000000000006uLL; /*0xf25*/ v13 = sub_161C(Ptr, 44); /*0xf33*/ if ( v13 ) /*0xf3b*/ - v13 = sub_1408(v13, 44); /*0xf43*/ + v13 = FreePool(v13); /*0xf43*/ *(_QWORD *)a4 = v13; /*0xf48*/ if ( !v13 ) /*0xf4e*/ { @@ -90,7 +90,7 @@ return 0x8000000000000006uLL; /*0xf25*/ v13 = sub_161C(Ptr, 44); /*0xf33*/ if ( v13 ) /*0xf3b*/ - v13 = sub_1408(v13, 44); /*0xf43*/ + v13 = FreePool(v13); /*0xf43*/ *(_QWORD *)a4 = v13; /*0xf48*/ if ( !v13 ) /*0xf4e*/ { @@ -155,7 +155,7 @@ return 0x8000000000000006uLL; /*0xf25*/ v13 = sub_161C(Ptr, 44); /*0xf33*/ if ( v13 ) /*0xf3b*/ - v13 = sub_1408(v13, 44); /*0xf43*/ + v13 = FreePool(v13); /*0xf43*/ *(_QWORD *)a4 = v13; /*0xf48*/ if ( !v13 ) /*0xf4e*/ { @@ -220,7 +220,7 @@ return 0x8000000000000006uLL; /*0xf25*/ v13 = sub_161C(Ptr, 44); /*0xf33*/ if ( v13 ) /*0xf3b*/ - v13 = sub_1408(v13, 44); /*0xf43*/ + v13 = FreePool(v13); /*0xf43*/ *(_QWORD *)a4 = v13; /*0xf48*/ if ( !v13 ) /*0xf4e*/ { @@ -285,7 +285,7 @@ return 0x8000000000000006uLL; /*0xf25*/ v13 = sub_161C(Ptr, 44); /*0xf33*/ if ( v13 ) /*0xf3b*/ - v13 = sub_1408(v13, 44); /*0xf43*/ + v13 = FreePool(v13); /*0xf43*/ *(_QWORD *)a4 = v13; /*0xf48*/ if ( !v13 ) /*0xf4e*/ { @@ -947,7 +947,7 @@ DebugPrintVarArg(0x80000000LL, (__int64)"\nASSERT_EFI_ERROR (Status = %r)\n", Status); /*0x22a7*/ DebugAssert("e:\\hs\\MdeModulePkg\\Library\\PiDxeS3BootScriptLib\\BootScriptSave.c", 591, "!EFI_ERROR (Status)"); /*0x22b7*/ } - sub_1408(v3, 32); /*0x22c4*/ + FreePool(v3); /*0x22c4*/ qword_44A8 = RegisterProtocolNotify(v8, v7, v9, v10, (__int64)v21); /*0x22d7*/ if ( !qword_44A8 ) /*0x22e1*/ DebugAssert( /*0x22f2*/ @@ -984,7 +984,7 @@ DebugPrintVarArg(0x80000000LL, (__int64)"\nASSERT_EFI_ERROR (Status = %r)\n", Status); /*0x23da*/ DebugAssert("e:\\hs\\MdeModulePkg\\Library\\PiDxeS3BootScriptLib\\BootScriptSave.c", 643, "!EFI_ERROR (Status)"); /*0x23ea*/ } - sub_1408(v22, 32); /*0x23f8*/ + FreePool(v22); /*0x23f8*/ Status = (*(__int64 ( **)(void *, __int64 (*)(), __int64 *))(qword_44B0 + 192))( /*0x2419*/ &unk_42B0, sub_212C, @@ -1043,7 +1043,7 @@ DebugPrintVarArg(0x80000000LL, (__int64)"\nASSERT_EFI_ERROR (Status = %r)\n", Status); /*0x22a7*/ DebugAssert("e:\\hs\\MdeModulePkg\\Library\\PiDxeS3BootScriptLib\\BootScriptSave.c", 591, "!EFI_ERROR (Status)"); /*0x22b7*/ } - sub_1408(v3, 32); /*0x22c4*/ + FreePool(v3); /*0x22c4*/ qword_44A8 = RegisterProtocolNotify(v8, v7, v9, v10, (__int64)v21); /*0x22d7*/ if ( !qword_44A8 ) /*0x22e1*/ DebugAssert( /*0x22f2*/ @@ -1080,7 +1080,7 @@ DebugPrintVarArg(0x80000000LL, (__int64)"\nASSERT_EFI_ERROR (Status = %r)\n", Status); /*0x23da*/ DebugAssert("e:\\hs\\MdeModulePkg\\Library\\PiDxeS3BootScriptLib\\BootScriptSave.c", 643, "!EFI_ERROR (Status)"); /*0x23ea*/ } - sub_1408(v22, 32); /*0x23f8*/ + FreePool(v22); /*0x23f8*/ Status = (*(__int64 ( **)(void *, __int64 (*)(), __int64 *))(qword_44B0 + 192))( /*0x2419*/ &unk_42B0, sub_212C, @@ -1139,7 +1139,7 @@ DebugPrintVarArg(0x80000000LL, (__int64)"\nASSERT_EFI_ERROR (Status = %r)\n", Status); /*0x22a7*/ DebugAssert("e:\\hs\\MdeModulePkg\\Library\\PiDxeS3BootScriptLib\\BootScriptSave.c", 591, "!EFI_ERROR (Status)"); /*0x22b7*/ } - sub_1408(v3, 32); /*0x22c4*/ + FreePool(v3); /*0x22c4*/ qword_44A8 = RegisterProtocolNotify(v8, v7, v9, v10, (__int64)v21); /*0x22d7*/ if ( !qword_44A8 ) /*0x22e1*/ DebugAssert( /*0x22f2*/ @@ -1176,7 +1176,7 @@ DebugPrintVarArg(0x80000000LL, (__int64)"\nASSERT_EFI_ERROR (Status = %r)\n", Status); /*0x23da*/ DebugAssert("e:\\hs\\MdeModulePkg\\Library\\PiDxeS3BootScriptLib\\BootScriptSave.c", 643, "!EFI_ERROR (Status)"); /*0x23ea*/ } - sub_1408(v22, 32); /*0x23f8*/ + FreePool(v22); /*0x23f8*/ Status = (*(__int64 ( **)(void *, __int64 (*)(), __int64 *))(qword_44B0 + 192))( /*0x2419*/ &unk_42B0, sub_212C, @@ -1215,7 +1215,7 @@ { __int64 Ptr; // rax __int64 v3; // rbx __int64 Status; // rax __int64 v5; // rax __int64 Status; // rax __int64 v7; // rdx __int64 v8; // rcx __int64 v9; // r8 __int64 v10; // r9 __int64 v11; // rax __int64 v12; // rax __int64 Status; // rax __int64 v14; // rbx __int64 v15; // rax __int64 Status; // rax __int64 Status; // rax __int64 Status; // rax __int64 Status; // rax char v21[16]; // [rsp+30h] [rbp-10h] BYREF __int64 v22; // [rsp+80h] [rbp+40h] BYREF __int64 v23; // [rsp+88h] [rbp+48h] BYREF __int64 v24; // [rsp+90h] [rbp+50h] BYREF __int64 ( **v25)(_QWORD, __int64 *); // [rsp+98h] [rbp+58h] BYREF v23 = a2; /*0x21e8*/ v22 = a1; /*0x21ed*/ - Ptr = sub_27D8(); /*0x2203*/ + Ptr = GetPcdProtocol(); /*0x2203*/ v3 = (*(__int64 ( **)(__int64))(Ptr + 32))(137); /*0x2228*/ if ( !v3 ) /*0x2235*/ { @@ -1228,15 +1228,15 @@ } v3 = v24; /*0x227d*/ byte_44A0 = 1; /*0x2281*/ - v5 = sub_27D8(); /*0x2288*/ + v5 = GetPcdProtocol(); /*0x2288*/ Status = (*(__int64 ( **)(__int64, __int64))(v5 + 144))(137, v3); /*0x2293*/ if ( Status < 0 ) /*0x229c*/ { DebugPrintVarArg(0x80000000LL, (__int64)"\nASSERT_EFI_ERROR (Status = %r)\n", Status); /*0x22a7*/ DebugAssert("e:\\hs\\MdeModulePkg\\Library\\PiDxeS3BootScriptLib\\BootScriptSave.c", 591, "!EFI_ERROR (Status)"); /*0x22b7*/ } - sub_1408(v3, 32); /*0x22c4*/ - qword_44A8 = sub_17BC(v8, v7, v9, v10, (__int64)v21); /*0x22d7*/ + FreePool(v3); /*0x22c4*/ + qword_44A8 = RegisterProtocolNotify(v8, v7, v9, v10, (__int64)v21); /*0x22d7*/ if ( !qword_44A8 ) /*0x22e1*/ DebugAssert( /*0x22f2*/ "e:\\hs\\MdeModulePkg\\Library\\PiDxeS3BootScriptLib\\BootScriptSave.c", @@ -1252,7 +1252,7 @@ && (_BYTE)v23 && v25[1](v25, &qword_44B0) >= 0 ) { - v11 = sub_27D8(); /*0x235b*/ + v11 = GetPcdProtocol(); /*0x235b*/ v12 = (*(__int64 ( **)(__int64))(v11 + 32))(138); /*0x2369*/ v22 = v12; /*0x236c*/ if ( !v12 ) /*0x2373*/ @@ -1265,14 +1265,14 @@ } v14 = v22; /*0x23b0*/ byte_44C8 = 1; /*0x23b4*/ - v15 = sub_27D8(); /*0x23bb*/ + v15 = GetPcdProtocol(); /*0x23bb*/ Status = (*(__int64 ( **)(__int64, __int64))(v15 + 144))(138, v14); /*0x23c6*/ if ( Status < 0 ) /*0x23cf*/ { DebugPrintVarArg(0x80000000LL, (__int64)"\nASSERT_EFI_ERROR (Status = %r)\n", Status); /*0x23da*/ DebugAssert("e:\\hs\\MdeModulePkg\\Library\\PiDxeS3BootScriptLib\\BootScriptSave.c", 643, "!EFI_ERROR (Status)"); /*0x23ea*/ } - sub_1408(v22, 32); /*0x23f8*/ + FreePool(v22); /*0x23f8*/ Status = (*(__int64 ( **)(void *, __int64 (*)(), __int64 *))(qword_44B0 + 192))( /*0x2419*/ &unk_42B0, sub_212C, @@ -1311,7 +1311,7 @@ { __int64 Ptr; // rax __int64 v3; // rbx __int64 Status; // rax __int64 v5; // rax __int64 Status; // rax __int64 v7; // rdx __int64 v8; // rcx __int64 v9; // r8 __int64 v10; // r9 __int64 v11; // rax __int64 v12; // rax __int64 Status; // rax __int64 v14; // rbx __int64 v15; // rax __int64 Status; // rax __int64 Status; // rax __int64 Status; // rax __int64 Status; // rax char v21[16]; // [rsp+30h] [rbp-10h] BYREF __int64 v22; // [rsp+80h] [rbp+40h] BYREF __int64 v23; // [rsp+88h] [rbp+48h] BYREF __int64 v24; // [rsp+90h] [rbp+50h] BYREF __int64 ( **v25)(_QWORD, __int64 *); // [rsp+98h] [rbp+58h] BYREF v23 = a2; /*0x21e8*/ v22 = a1; /*0x21ed*/ - Ptr = sub_27D8(); /*0x2203*/ + Ptr = GetPcdProtocol(); /*0x2203*/ v3 = (*(__int64 ( **)(__int64))(Ptr + 32))(137); /*0x2228*/ if ( !v3 ) /*0x2235*/ { @@ -1324,15 +1324,15 @@ } v3 = v24; /*0x227d*/ byte_44A0 = 1; /*0x2281*/ - v5 = sub_27D8(); /*0x2288*/ + v5 = GetPcdProtocol(); /*0x2288*/ Status = (*(__int64 ( **)(__int64, __int64))(v5 + 144))(137, v3); /*0x2293*/ if ( Status < 0 ) /*0x229c*/ { DebugPrintVarArg(0x80000000LL, (__int64)"\nASSERT_EFI_ERROR (Status = %r)\n", Status); /*0x22a7*/ DebugAssert("e:\\hs\\MdeModulePkg\\Library\\PiDxeS3BootScriptLib\\BootScriptSave.c", 591, "!EFI_ERROR (Status)"); /*0x22b7*/ } - sub_1408(v3, 32); /*0x22c4*/ - qword_44A8 = sub_17BC(v8, v7, v9, v10, (__int64)v21); /*0x22d7*/ + FreePool(v3); /*0x22c4*/ + qword_44A8 = RegisterProtocolNotify(v8, v7, v9, v10, (__int64)v21); /*0x22d7*/ if ( !qword_44A8 ) /*0x22e1*/ DebugAssert( /*0x22f2*/ "e:\\hs\\MdeModulePkg\\Library\\PiDxeS3BootScriptLib\\BootScriptSave.c", @@ -1348,7 +1348,7 @@ && (_BYTE)v23 && v25[1](v25, &qword_44B0) >= 0 ) { - v11 = sub_27D8(); /*0x235b*/ + v11 = GetPcdProtocol(); /*0x235b*/ v12 = (*(__int64 ( **)(__int64))(v11 + 32))(138); /*0x2369*/ v22 = v12; /*0x236c*/ if ( !v12 ) /*0x2373*/ @@ -1361,14 +1361,14 @@ } v14 = v22; /*0x23b0*/ byte_44C8 = 1; /*0x23b4*/ - v15 = sub_27D8(); /*0x23bb*/ + v15 = GetPcdProtocol(); /*0x23bb*/ Status = (*(__int64 ( **)(__int64, __int64))(v15 + 144))(138, v14); /*0x23c6*/ if ( Status < 0 ) /*0x23cf*/ { DebugPrintVarArg(0x80000000LL, (__int64)"\nASSERT_EFI_ERROR (Status = %r)\n", Status); /*0x23da*/ DebugAssert("e:\\hs\\MdeModulePkg\\Library\\PiDxeS3BootScriptLib\\BootScriptSave.c", 643, "!EFI_ERROR (Status)"); /*0x23ea*/ } - sub_1408(v22, 32); /*0x23f8*/ + FreePool(v22); /*0x23f8*/ Status = (*(__int64 ( **)(void *, __int64 (*)(), __int64 *))(qword_44B0 + 192))( /*0x2419*/ &unk_42B0, sub_212C, @@ -1407,7 +1407,7 @@ { __int64 Ptr; // rax __int64 v3; // rbx __int64 Status; // rax __int64 v5; // rax __int64 Status; // rax __int64 v7; // rdx __int64 v8; // rcx __int64 v9; // r8 __int64 v10; // r9 __int64 v11; // rax __int64 v12; // rax __int64 Status; // rax __int64 v14; // rbx __int64 v15; // rax __int64 Status; // rax __int64 Status; // rax __int64 Status; // rax __int64 Status; // rax char v21[16]; // [rsp+30h] [rbp-10h] BYREF __int64 v22; // [rsp+80h] [rbp+40h] BYREF __int64 v23; // [rsp+88h] [rbp+48h] BYREF __int64 v24; // [rsp+90h] [rbp+50h] BYREF __int64 ( **v25)(_QWORD, __int64 *); // [rsp+98h] [rbp+58h] BYREF v23 = a2; /*0x21e8*/ v22 = a1; /*0x21ed*/ - Ptr = sub_27D8(); /*0x2203*/ + Ptr = GetPcdProtocol(); /*0x2203*/ v3 = (*(__int64 ( **)(__int64))(Ptr + 32))(137); /*0x2228*/ if ( !v3 ) /*0x2235*/ { @@ -1420,15 +1420,15 @@ } v3 = v24; /*0x227d*/ byte_44A0 = 1; /*0x2281*/ - v5 = sub_27D8(); /*0x2288*/ + v5 = GetPcdProtocol(); /*0x2288*/ Status = (*(__int64 ( **)(__int64, __int64))(v5 + 144))(137, v3); /*0x2293*/ if ( Status < 0 ) /*0x229c*/ { DebugPrintVarArg(0x80000000LL, (__int64)"\nASSERT_EFI_ERROR (Status = %r)\n", Status); /*0x22a7*/ DebugAssert("e:\\hs\\MdeModulePkg\\Library\\PiDxeS3BootScriptLib\\BootScriptSave.c", 591, "!EFI_ERROR (Status)"); /*0x22b7*/ } - sub_1408(v3, 32); /*0x22c4*/ - qword_44A8 = sub_17BC(v8, v7, v9, v10, (__int64)v21); /*0x22d7*/ + FreePool(v3); /*0x22c4*/ + qword_44A8 = RegisterProtocolNotify(v8, v7, v9, v10, (__int64)v21); /*0x22d7*/ if ( !qword_44A8 ) /*0x22e1*/ DebugAssert( /*0x22f2*/ "e:\\hs\\MdeModulePkg\\Library\\PiDxeS3BootScriptLib\\BootScriptSave.c", @@ -1444,7 +1444,7 @@ && (_BYTE)v23 && v25[1](v25, &qword_44B0) >= 0 ) { - v11 = sub_27D8(); /*0x235b*/ + v11 = GetPcdProtocol(); /*0x235b*/ v12 = (*(__int64 ( **)(__int64))(v11 + 32))(138); /*0x2369*/ v22 = v12; /*0x236c*/ if ( !v12 ) /*0x2373*/ @@ -1457,14 +1457,14 @@ } v14 = v22; /*0x23b0*/ byte_44C8 = 1; /*0x23b4*/ - v15 = sub_27D8(); /*0x23bb*/ + v15 = GetPcdProtocol(); /*0x23bb*/ Status = (*(__int64 ( **)(__int64, __int64))(v15 + 144))(138, v14); /*0x23c6*/ if ( Status < 0 ) /*0x23cf*/ { DebugPrintVarArg(0x80000000LL, (__int64)"\nASSERT_EFI_ERROR (Status = %r)\n", Status); /*0x23da*/ DebugAssert("e:\\hs\\MdeModulePkg\\Library\\PiDxeS3BootScriptLib\\BootScriptSave.c", 643, "!EFI_ERROR (Status)"); /*0x23ea*/ } - sub_1408(v22, 32); /*0x23f8*/ + FreePool(v22); /*0x23f8*/ Status = (*(__int64 ( **)(void *, __int64 (*)(), __int64 *))(qword_44B0 + 192))( /*0x2419*/ &unk_42B0, sub_212C, @@ -1503,7 +1503,7 @@ { __int64 Ptr; // rax __int64 v3; // rbx __int64 Status; // rax __int64 v5; // rax __int64 Status; // rax __int64 v7; // rdx __int64 v8; // rcx __int64 v9; // r8 __int64 v10; // r9 __int64 v11; // rax __int64 v12; // rax __int64 Status; // rax __int64 v14; // rbx __int64 v15; // rax __int64 Status; // rax __int64 Status; // rax __int64 Status; // rax __int64 Status; // rax char v21[16]; // [rsp+30h] [rbp-10h] BYREF __int64 v22; // [rsp+80h] [rbp+40h] BYREF __int64 v23; // [rsp+88h] [rbp+48h] BYREF __int64 v24; // [rsp+90h] [rbp+50h] BYREF __int64 ( **v25)(_QWORD, __int64 *); // [rsp+98h] [rbp+58h] BYREF v23 = a2; /*0x21e8*/ v22 = a1; /*0x21ed*/ - Ptr = sub_27D8(); /*0x2203*/ + Ptr = GetPcdProtocol(); /*0x2203*/ v3 = (*(__int64 ( **)(__int64))(Ptr + 32))(137); /*0x2228*/ if ( !v3 ) /*0x2235*/ { @@ -1516,15 +1516,15 @@ } v3 = v24; /*0x227d*/ byte_44A0 = 1; /*0x2281*/ - v5 = sub_27D8(); /*0x2288*/ + v5 = GetPcdProtocol(); /*0x2288*/ Status = (*(__int64 ( **)(__int64, __int64))(v5 + 144))(137, v3); /*0x2293*/ if ( Status < 0 ) /*0x229c*/ { DebugPrintVarArg(0x80000000LL, (__int64)"\nASSERT_EFI_ERROR (Status = %r)\n", Status); /*0x22a7*/ DebugAssert("e:\\hs\\MdeModulePkg\\Library\\PiDxeS3BootScriptLib\\BootScriptSave.c", 591, "!EFI_ERROR (Status)"); /*0x22b7*/ } - sub_1408(v3, 32); /*0x22c4*/ - qword_44A8 = sub_17BC(v8, v7, v9, v10, (__int64)v21); /*0x22d7*/ + FreePool(v3); /*0x22c4*/ + qword_44A8 = RegisterProtocolNotify(v8, v7, v9, v10, (__int64)v21); /*0x22d7*/ if ( !qword_44A8 ) /*0x22e1*/ DebugAssert( /*0x22f2*/ "e:\\hs\\MdeModulePkg\\Library\\PiDxeS3BootScriptLib\\BootScriptSave.c", @@ -1540,7 +1540,7 @@ && (_BYTE)v23 && v25[1](v25, &qword_44B0) >= 0 ) { - v11 = sub_27D8(); /*0x235b*/ + v11 = GetPcdProtocol(); /*0x235b*/ v12 = (*(__int64 ( **)(__int64))(v11 + 32))(138); /*0x2369*/ v22 = v12; /*0x236c*/ if ( !v12 ) /*0x2373*/ @@ -1553,14 +1553,14 @@ } v14 = v22; /*0x23b0*/ byte_44C8 = 1; /*0x23b4*/ - v15 = sub_27D8(); /*0x23bb*/ + v15 = GetPcdProtocol(); /*0x23bb*/ Status = (*(__int64 ( **)(__int64, __int64))(v15 + 144))(138, v14); /*0x23c6*/ if ( Status < 0 ) /*0x23cf*/ { DebugPrintVarArg(0x80000000LL, (__int64)"\nASSERT_EFI_ERROR (Status = %r)\n", Status); /*0x23da*/ DebugAssert("e:\\hs\\MdeModulePkg\\Library\\PiDxeS3BootScriptLib\\BootScriptSave.c", 643, "!EFI_ERROR (Status)"); /*0x23ea*/ } - sub_1408(v22, 32); /*0x23f8*/ + FreePool(v22); /*0x23f8*/ Status = (*(__int64 ( **)(void *, __int64 (*)(), __int64 *))(qword_44B0 + 192))( /*0x2419*/ &unk_42B0, sub_212C, @@ -1599,7 +1599,7 @@ { __int64 Ptr; // rax __int64 v3; // rbx __int64 Status; // rax __int64 v5; // rax __int64 Status; // rax __int64 v7; // rdx __int64 v8; // rcx __int64 v9; // r8 __int64 v10; // r9 __int64 v11; // rax __int64 v12; // rax __int64 Status; // rax __int64 v14; // rbx __int64 v15; // rax __int64 Status; // rax __int64 Status; // rax __int64 Status; // rax __int64 Status; // rax char v21[16]; // [rsp+30h] [rbp-10h] BYREF __int64 v22; // [rsp+80h] [rbp+40h] BYREF __int64 v23; // [rsp+88h] [rbp+48h] BYREF __int64 v24; // [rsp+90h] [rbp+50h] BYREF __int64 ( **v25)(_QWORD, __int64 *); // [rsp+98h] [rbp+58h] BYREF v23 = a2; /*0x21e8*/ v22 = a1; /*0x21ed*/ - Ptr = sub_27D8(); /*0x2203*/ + Ptr = GetPcdProtocol(); /*0x2203*/ v3 = (*(__int64 ( **)(__int64))(Ptr + 32))(137); /*0x2228*/ if ( !v3 ) /*0x2235*/ { @@ -1612,15 +1612,15 @@ } v3 = v24; /*0x227d*/ byte_44A0 = 1; /*0x2281*/ - v5 = sub_27D8(); /*0x2288*/ + v5 = GetPcdProtocol(); /*0x2288*/ Status = (*(__int64 ( **)(__int64, __int64))(v5 + 144))(137, v3); /*0x2293*/ if ( Status < 0 ) /*0x229c*/ { DebugPrintVarArg(0x80000000LL, (__int64)"\nASSERT_EFI_ERROR (Status = %r)\n", Status); /*0x22a7*/ DebugAssert("e:\\hs\\MdeModulePkg\\Library\\PiDxeS3BootScriptLib\\BootScriptSave.c", 591, "!EFI_ERROR (Status)"); /*0x22b7*/ } - sub_1408(v3, 32); /*0x22c4*/ - qword_44A8 = sub_17BC(v8, v7, v9, v10, (__int64)v21); /*0x22d7*/ + FreePool(v3); /*0x22c4*/ + qword_44A8 = RegisterProtocolNotify(v8, v7, v9, v10, (__int64)v21); /*0x22d7*/ if ( !qword_44A8 ) /*0x22e1*/ DebugAssert( /*0x22f2*/ "e:\\hs\\MdeModulePkg\\Library\\PiDxeS3BootScriptLib\\BootScriptSave.c", @@ -1636,7 +1636,7 @@ && (_BYTE)v23 && v25[1](v25, &qword_44B0) >= 0 ) { - v11 = sub_27D8(); /*0x235b*/ + v11 = GetPcdProtocol(); /*0x235b*/ v12 = (*(__int64 ( **)(__int64))(v11 + 32))(138); /*0x2369*/ v22 = v12; /*0x236c*/ if ( !v12 ) /*0x2373*/ @@ -1649,14 +1649,14 @@ } v14 = v22; /*0x23b0*/ byte_44C8 = 1; /*0x23b4*/ - v15 = sub_27D8(); /*0x23bb*/ + v15 = GetPcdProtocol(); /*0x23bb*/ Status = (*(__int64 ( **)(__int64, __int64))(v15 + 144))(138, v14); /*0x23c6*/ if ( Status < 0 ) /*0x23cf*/ { DebugPrintVarArg(0x80000000LL, (__int64)"\nASSERT_EFI_ERROR (Status = %r)\n", Status); /*0x23da*/ DebugAssert("e:\\hs\\MdeModulePkg\\Library\\PiDxeS3BootScriptLib\\BootScriptSave.c", 643, "!EFI_ERROR (Status)"); /*0x23ea*/ } - sub_1408(v22, 32); /*0x23f8*/ + FreePool(v22); /*0x23f8*/ Status = (*(__int64 ( **)(void *, __int64 (*)(), __int64 *))(qword_44B0 + 192))( /*0x2419*/ &unk_42B0, sub_212C, @@ -1695,7 +1695,7 @@ { __int64 Ptr; // rax __int64 v3; // rbx __int64 Status; // rax __int64 v5; // rax __int64 Status; // rax __int64 v7; // rdx __int64 v8; // rcx __int64 v9; // r8 __int64 v10; // r9 __int64 v11; // rax __int64 v12; // rax __int64 Status; // rax __int64 v14; // rbx __int64 v15; // rax __int64 Status; // rax __int64 Status; // rax __int64 Status; // rax __int64 Status; // rax char v21[16]; // [rsp+30h] [rbp-10h] BYREF __int64 v22; // [rsp+80h] [rbp+40h] BYREF __int64 v23; // [rsp+88h] [rbp+48h] BYREF __int64 v24; // [rsp+90h] [rbp+50h] BYREF __int64 ( **v25)(_QWORD, __int64 *); // [rsp+98h] [rbp+58h] BYREF v23 = a2; /*0x21e8*/ v22 = a1; /*0x21ed*/ - Ptr = sub_27D8(); /*0x2203*/ + Ptr = GetPcdProtocol(); /*0x2203*/ v3 = (*(__int64 ( **)(__int64))(Ptr + 32))(137); /*0x2228*/ if ( !v3 ) /*0x2235*/ { @@ -1708,15 +1708,15 @@ } v3 = v24; /*0x227d*/ byte_44A0 = 1; /*0x2281*/ - v5 = sub_27D8(); /*0x2288*/ + v5 = GetPcdProtocol(); /*0x2288*/ Status = (*(__int64 ( **)(__int64, __int64))(v5 + 144))(137, v3); /*0x2293*/ if ( Status < 0 ) /*0x229c*/ { DebugPrintVarArg(0x80000000LL, (__int64)"\nASSERT_EFI_ERROR (Status = %r)\n", Status); /*0x22a7*/ DebugAssert("e:\\hs\\MdeModulePkg\\Library\\PiDxeS3BootScriptLib\\BootScriptSave.c", 591, "!EFI_ERROR (Status)"); /*0x22b7*/ } - sub_1408(v3, 32); /*0x22c4*/ - qword_44A8 = sub_17BC(v8, v7, v9, v10, (__int64)v21); /*0x22d7*/ + FreePool(v3); /*0x22c4*/ + qword_44A8 = RegisterProtocolNotify(v8, v7, v9, v10, (__int64)v21); /*0x22d7*/ if ( !qword_44A8 ) /*0x22e1*/ DebugAssert( /*0x22f2*/ "e:\\hs\\MdeModulePkg\\Library\\PiDxeS3BootScriptLib\\BootScriptSave.c", @@ -1732,7 +1732,7 @@ && (_BYTE)v23 && v25[1](v25, &qword_44B0) >= 0 ) { - v11 = sub_27D8(); /*0x235b*/ + v11 = GetPcdProtocol(); /*0x235b*/ v12 = (*(__int64 ( **)(__int64))(v11 + 32))(138); /*0x2369*/ v22 = v12; /*0x236c*/ if ( !v12 ) /*0x2373*/ @@ -1745,14 +1745,14 @@ } v14 = v22; /*0x23b0*/ byte_44C8 = 1; /*0x23b4*/ - v15 = sub_27D8(); /*0x23bb*/ + v15 = GetPcdProtocol(); /*0x23bb*/ Status = (*(__int64 ( **)(__int64, __int64))(v15 + 144))(138, v14); /*0x23c6*/ if ( Status < 0 ) /*0x23cf*/ { DebugPrintVarArg(0x80000000LL, (__int64)"\nASSERT_EFI_ERROR (Status = %r)\n", Status); /*0x23da*/ DebugAssert("e:\\hs\\MdeModulePkg\\Library\\PiDxeS3BootScriptLib\\BootScriptSave.c", 643, "!EFI_ERROR (Status)"); /*0x23ea*/ } - sub_1408(v22, 32); /*0x23f8*/ + FreePool(v22); /*0x23f8*/ Status = (*(__int64 ( **)(void *, __int64 (*)(), __int64 *))(qword_44B0 + 192))( /*0x2419*/ &unk_42B0, sub_212C, @@ -1791,7 +1791,7 @@ { __int64 Ptr; // rax __int64 v3; // rbx __int64 Status; // rax __int64 v5; // rax __int64 Status; // rax __int64 v7; // rdx __int64 v8; // rcx __int64 v9; // r8 __int64 v10; // r9 __int64 v11; // rax __int64 v12; // rax __int64 Status; // rax __int64 v14; // rbx __int64 v15; // rax __int64 Status; // rax __int64 Status; // rax __int64 Status; // rax __int64 Status; // rax char v21[16]; // [rsp+30h] [rbp-10h] BYREF __int64 v22; // [rsp+80h] [rbp+40h] BYREF __int64 v23; // [rsp+88h] [rbp+48h] BYREF __int64 v24; // [rsp+90h] [rbp+50h] BYREF __int64 ( **v25)(_QWORD, __int64 *); // [rsp+98h] [rbp+58h] BYREF v23 = a2; /*0x21e8*/ v22 = a1; /*0x21ed*/ - Ptr = sub_27D8(); /*0x2203*/ + Ptr = GetPcdProtocol(); /*0x2203*/ v3 = (*(__int64 ( **)(__int64))(Ptr + 32))(137); /*0x2228*/ if ( !v3 ) /*0x2235*/ { @@ -1804,15 +1804,15 @@ } v3 = v24; /*0x227d*/ byte_44A0 = 1; /*0x2281*/ - v5 = sub_27D8(); /*0x2288*/ + v5 = GetPcdProtocol(); /*0x2288*/ Status = (*(__int64 ( **)(__int64, __int64))(v5 + 144))(137, v3); /*0x2293*/ if ( Status < 0 ) /*0x229c*/ { DebugPrintVarArg(0x80000000LL, (__int64)"\nASSERT_EFI_ERROR (Status = %r)\n", Status); /*0x22a7*/ DebugAssert("e:\\hs\\MdeModulePkg\\Library\\PiDxeS3BootScriptLib\\BootScriptSave.c", 591, "!EFI_ERROR (Status)"); /*0x22b7*/ } - sub_1408(v3, 32); /*0x22c4*/ - qword_44A8 = sub_17BC(v8, v7, v9, v10, (__int64)v21); /*0x22d7*/ + FreePool(v3); /*0x22c4*/ + qword_44A8 = RegisterProtocolNotify(v8, v7, v9, v10, (__int64)v21); /*0x22d7*/ if ( !qword_44A8 ) /*0x22e1*/ DebugAssert( /*0x22f2*/ "e:\\hs\\MdeModulePkg\\Library\\PiDxeS3BootScriptLib\\BootScriptSave.c", @@ -1828,7 +1828,7 @@ && (_BYTE)v23 && v25[1](v25, &qword_44B0) >= 0 ) { - v11 = sub_27D8(); /*0x235b*/ + v11 = GetPcdProtocol(); /*0x235b*/ v12 = (*(__int64 ( **)(__int64))(v11 + 32))(138); /*0x2369*/ v22 = v12; /*0x236c*/ if ( !v12 ) /*0x2373*/ @@ -1841,14 +1841,14 @@ } v14 = v22; /*0x23b0*/ byte_44C8 = 1; /*0x23b4*/ - v15 = sub_27D8(); /*0x23bb*/ + v15 = GetPcdProtocol(); /*0x23bb*/ Status = (*(__int64 ( **)(__int64, __int64))(v15 + 144))(138, v14); /*0x23c6*/ if ( Status < 0 ) /*0x23cf*/ { DebugPrintVarArg(0x80000000LL, (__int64)"\nASSERT_EFI_ERROR (Status = %r)\n", Status); /*0x23da*/ DebugAssert("e:\\hs\\MdeModulePkg\\Library\\PiDxeS3BootScriptLib\\BootScriptSave.c", 643, "!EFI_ERROR (Status)"); /*0x23ea*/ } - sub_1408(v22, 32); /*0x23f8*/ + FreePool(v22); /*0x23f8*/ Status = (*(__int64 ( **)(void *, __int64 (*)(), __int64 *))(qword_44B0 + 192))( /*0x2419*/ &unk_42B0, sub_212C, @@ -1937,7 +1937,7 @@ DebugPrintVarArg(0x80000000LL, (__int64)"\nASSERT_EFI_ERROR (Status = %r)\n", Status); /*0x2689*/ DebugAssert("e:\\hs\\MdeModulePkg\\Library\\PiDxeS3BootScriptLib\\BootScriptSave.c", 751, "!EFI_ERROR (Status)"); /*0x2699*/ } - v10 = sub_27D8(); /*0x269e*/ + v10 = GetPcdProtocol(); /*0x269e*/ Status = (*(__int64 ( **)(__int64, _QWORD))(v10 + 144))(137, 0); /*0x26aa*/ if ( Status < 0 ) /*0x26b3*/ { @@ -1954,7 +1954,7 @@ DebugPrintVarArg(0x80000000LL, (__int64)"\nASSERT_EFI_ERROR (Status = %r)\n", Status); /*0x2700*/ DebugAssert("e:\\hs\\MdeModulePkg\\Library\\PiDxeS3BootScriptLib\\BootScriptSave.c", 757, "!EFI_ERROR (Status)"); /*0x2710*/ } - v13 = sub_27D8(); /*0x2715*/ + v13 = GetPcdProtocol(); /*0x2715*/ Status = (*(__int64 ( **)(__int64, _QWORD))(v13 + 144))(138, 0); /*0x2721*/ if ( Status < 0 ) /*0x272a*/ { @@ -2019,7 +2019,7 @@ DebugPrintVarArg(0x80000000LL, (__int64)"\nASSERT_EFI_ERROR (Status = %r)\n", Status); /*0x2689*/ DebugAssert("e:\\hs\\MdeModulePkg\\Library\\PiDxeS3BootScriptLib\\BootScriptSave.c", 751, "!EFI_ERROR (Status)"); /*0x2699*/ } - v10 = sub_27D8(); /*0x269e*/ + v10 = GetPcdProtocol(); /*0x269e*/ Status = (*(__int64 ( **)(__int64, _QWORD))(v10 + 144))(137, 0); /*0x26aa*/ if ( Status < 0 ) /*0x26b3*/ { @@ -2036,7 +2036,7 @@ DebugPrintVarArg(0x80000000LL, (__int64)"\nASSERT_EFI_ERROR (Status = %r)\n", Status); /*0x2700*/ DebugAssert("e:\\hs\\MdeModulePkg\\Library\\PiDxeS3BootScriptLib\\BootScriptSave.c", 757, "!EFI_ERROR (Status)"); /*0x2710*/ } - v13 = sub_27D8(); /*0x2715*/ + v13 = GetPcdProtocol(); /*0x2715*/ Status = (*(__int64 ( **)(__int64, _QWORD))(v13 + 144))(138, 0); /*0x2721*/ if ( Status < 0 ) /*0x272a*/ { @@ -2101,7 +2101,7 @@ DebugPrintVarArg(0x80000000LL, (__int64)"\nASSERT_EFI_ERROR (Status = %r)\n", Status); /*0x2689*/ DebugAssert("e:\\hs\\MdeModulePkg\\Library\\PiDxeS3BootScriptLib\\BootScriptSave.c", 751, "!EFI_ERROR (Status)"); /*0x2699*/ } - v10 = sub_27D8(); /*0x269e*/ + v10 = GetPcdProtocol(); /*0x269e*/ Status = (*(__int64 ( **)(__int64, _QWORD))(v10 + 144))(137, 0); /*0x26aa*/ if ( Status < 0 ) /*0x26b3*/ { @@ -2118,7 +2118,7 @@ DebugPrintVarArg(0x80000000LL, (__int64)"\nASSERT_EFI_ERROR (Status = %r)\n", Status); /*0x2700*/ DebugAssert("e:\\hs\\MdeModulePkg\\Library\\PiDxeS3BootScriptLib\\BootScriptSave.c", 757, "!EFI_ERROR (Status)"); /*0x2710*/ } - v13 = sub_27D8(); /*0x2715*/ + v13 = GetPcdProtocol(); /*0x2715*/ Status = (*(__int64 ( **)(__int64, _QWORD))(v13 + 144))(138, 0); /*0x2721*/ if ( Status < 0 ) /*0x272a*/ { @@ -2183,7 +2183,7 @@ DebugPrintVarArg(0x80000000LL, (__int64)"\nASSERT_EFI_ERROR (Status = %r)\n", Status); /*0x2689*/ DebugAssert("e:\\hs\\MdeModulePkg\\Library\\PiDxeS3BootScriptLib\\BootScriptSave.c", 751, "!EFI_ERROR (Status)"); /*0x2699*/ } - v10 = sub_27D8(); /*0x269e*/ + v10 = GetPcdProtocol(); /*0x269e*/ Status = (*(__int64 ( **)(__int64, _QWORD))(v10 + 144))(137, 0); /*0x26aa*/ if ( Status < 0 ) /*0x26b3*/ { @@ -2200,7 +2200,7 @@ DebugPrintVarArg(0x80000000LL, (__int64)"\nASSERT_EFI_ERROR (Status = %r)\n", Status); /*0x2700*/ DebugAssert("e:\\hs\\MdeModulePkg\\Library\\PiDxeS3BootScriptLib\\BootScriptSave.c", 757, "!EFI_ERROR (Status)"); /*0x2710*/ } - v13 = sub_27D8(); /*0x2715*/ + v13 = GetPcdProtocol(); /*0x2715*/ Status = (*(__int64 ( **)(__int64, _QWORD))(v13 + 144))(138, 0); /*0x2721*/ if ( Status < 0 ) /*0x272a*/ { diff --git a/PcAtChipsetPkg/PcatRealTimeClockSmm/PcatRealTimeClockSmm/PcRtcSmm/PcRtcSmm.c b/PcAtChipsetPkg/PcatRealTimeClockSmm/PcatRealTimeClockSmm/PcRtcSmm/PcRtcSmm.c index 90da50d..7d339db 100644 --- a/PcAtChipsetPkg/PcatRealTimeClockSmm/PcatRealTimeClockSmm/PcRtcSmm/PcRtcSmm.c +++ b/PcAtChipsetPkg/PcatRealTimeClockSmm/PcatRealTimeClockSmm/PcRtcSmm/PcRtcSmm.c @@ -7,10 +7,10 @@ This SMM driver manages the MC146818-compatible RTC controller from SMM context. It registers four SMM Runtime Services Call (RSC) handlers via the SMM_RSC_HANDLER_PROTOCOL: - handler[0] = GetTime (sub_84C -> sub_C28) - handler[1] = SetTime (sub_854 -> sub_D20) - handler[2] = GetWakeupTime (sub_870 -> sub_EC8) - handler[3] = SetWakeupTime (sub_87C -> sub_1074) + handler[0] = GetTime + handler[1] = SetTime + handler[2] = GetWakeupTime + handler[3] = SetWakeupTime The driver is linked with the following libraries: - UefiBootServicesTableLib (global gImageHandle, gST, gBS) @@ -179,7 +179,7 @@ // ============================================================================ /** - CPU PAUSE instruction (sub_470 at 0x470) + CPU PAUSE instruction **/ VOID EFIAPI @@ -191,7 +191,7 @@ } /** - Read the CPU timestamp counter (sub_480 at 0x480) + Read the CPU timestamp counter **/ UINT64 EFIAPI @@ -203,7 +203,7 @@ } /** - Enable interrupts (sub_490 at 0x490) + Enable interrupts **/ VOID EFIAPI @@ -215,7 +215,7 @@ } /** - Disable interrupts (sub_4A0 at 0x4A0) + Disable interrupts **/ VOID EFIAPI @@ -227,7 +227,7 @@ } /** - Get caller's EFLAGS (sub_4B0 at 0x4B0) + Get caller's EFLAGS **/ UINT64 EFIAPI @@ -243,7 +243,7 @@ // ============================================================================ /** - SetJump - save CPU context (sub_280 at 0x280) + SetJump - save CPU context Saves all callee-saved registers (GPRs GPRs rbx, rbp, rdi, rsi, r12-r15), stack pointer (via retaddr), return address, MXCSR, and XMM6-15 to the @@ -300,7 +300,7 @@ } /** - LongJump - restore CPU context (sub_320 at 0x320) + LongJump - restore CPU context Restores MXCSR and jumps to the saved return address. @@ -322,7 +322,7 @@ } /** - CopyMem - copy buffer with overlap support (sub_3A0 at 0x3A0) + CopyMem - copy buffer with overlap support Uses qmemcpy for aligned portions and handles overlapping destinations by copying backward. @@ -393,7 +393,7 @@ } /** - ZeroMem - fill buffer with 0 (sub_3F0 at 0x3F0) + ZeroMem - fill buffer with 0 @param[out] Buffer Buffer to zero. @param[in] Length Number of bytes to zero. @@ -429,11 +429,11 @@ } // ============================================================================ -// Validation helpers (sub_199C at 0x199C and sub_1ABC at 0x1ABC / sub_1A34 at 0x1A34) +// Validation helpers // ============================================================================ /** - Validate the SetJump buffer pointer (sub_199C at 0x199C) + Validate the SetJump buffer pointer @param[in] JumpBuffer Pointer to the jump buffer to validate. **/ @@ -463,7 +463,7 @@ } /** - Debug print with format (sub_1A34 at 0x1A34) + Debug print with format Uses the SMM variable protocol for debug output. Also checks the debug level via CMOS port 0x70/0x71 register 0x4C (bit 7 preserved). @@ -546,7 +546,7 @@ } /** - Debug assert / dead loop (sub_1ABC at 0x1ABC) + Debug assert / dead loop @param[in] FileName Assertion source file name. @param[in] LineNumber Assertion source line number. @@ -574,7 +574,7 @@ } /** - Compare two GUIDs by their first 8 bytes (sub_1AFC at 0x1AFC) + Compare two GUIDs by their first 8 bytes @param[in] Guid1 Pointer to first GUID. @param[in] Guid2 Pointer to second GUID. @@ -593,7 +593,7 @@ } /** - Read unaligned 64-bit value (sub_201C at 0x201C) + Read unaligned 64-bit value @param[in] Buffer Source buffer (must not be NULL). @@ -622,7 +622,7 @@ // ============================================================================ /** - Get the SMM Variable Protocol (lazy-init for sub_19E4 at 0x19E4) + Get the SMM Variable Protocol Scans gSmst->ProtocolRegistry for gEfiSmmVariableProtocolGuid (0x2A40). @@ -656,7 +656,7 @@ } /** - Get the HOB list pointer (lazy-init for sub_1DB0 at 0x1DB0) + Get the HOB list pointer Scans the system table's configuration table for gEfiHobListGuid. @@ -715,7 +715,7 @@ } /** - Get the PCD protocol pointer (lazy-init for sub_1F90 at 0x1F90) + Get the PCD protocol pointer Locates gEfiPcdProtocolGuid via gBS->LocateProtocol. @@ -764,7 +764,7 @@ } /** - Get SMM CPU I/O2 Protocol (lazy-init for sub_1F04 at 0x1F04) + Get SMM CPU I/O2 Protocol Locates gEfiSmmCpuProtocolGuid (0x2A20) via gSmst->SmmLocateProtocol, then calls the SMM CPU protocol to write a register (function index @@ -818,7 +818,7 @@ } /** - PCD Get32 - reads a PCD value (sub_1F90 + callback at 0x1F90) + PCD Get32 - reads a PCD value @param[in] TokenNumber PCD token number. @@ -837,7 +837,7 @@ } /** - PCI Express MMIO address resolution (sub_1D74 at 0x1D74) + PCI Express MMIO address resolution @param[in] Address PCIe config address (must be within 0..0xFFFFFFF). @@ -862,7 +862,7 @@ } /** - Write 0x500 to a word at a PCIe address (sub_204C at 0x204C) + Write 0x500 to a word at a PCIe address @param[in] Address PCIe MMIO address (must be 16-bit aligned). @@ -891,7 +891,7 @@ } /** - Read a 32-bit MMIO value from an aligned port (sub_1C68 at 0x1C68) + Read a 32-bit MMIO value from an aligned port @param[in] Port Port to read from (must be 4-byte aligned). @@ -916,7 +916,7 @@ } /** - MicroSecondDelay - TSC-based delay (sub_1DB0 delay portion + sub_1E90 at 0x1E90) + MicroSecondDelay - TSC-based delay @param[in] MicroSeconds Microseconds to delay. @@ -966,7 +966,7 @@ } /** - SmmCpuReadSaveState - read SMM CPU save state (sub_1C68 + sub_1E90 at 0x1E90) + SmmCpuReadSaveState - read SMM CPU save state Uses __indword(0x508) for TSC-based timing, same as MicroSecondDelay. **/ @@ -988,7 +988,7 @@ // ============================================================================ /** - Check if an address is in SMRAM (sub_1C98 at 0x1C98) + Check if an address is in SMRAM @param[in] Address The address to check. @@ -1021,7 +1021,7 @@ } /** - Allocate pool via Smst->SmmAllocatePool (sub_1CDC at 0x1CDC) + Allocate pool via Smst->SmmAllocatePool @param[in] PoolType Type of pool to allocate. @param[in] Size Size of the allocation. @@ -1052,7 +1052,7 @@ } /** - Free SMRAM or boot-services pool depending on address (sub_1D0C at 0x1D0C) + Free SMRAM or boot-services pool depending on address @param[in] Buffer Pointer to the buffer to free. **/ @@ -1098,11 +1098,11 @@ } // ============================================================================ -// CopyMem wrapper (sub_1B64 at 0x1B64) +// CopyMem wrapper // ============================================================================ /** - CopyMem with bounds checking wrapper (sub_1B64 at 0x1B64) + CopyMem with bounds checking wrapper @param[out] Destination Destination buffer. @param[in] Source Source buffer. @@ -1145,7 +1145,7 @@ } /** - ZeroMem with bounds checking wrapper (sub_1C04 at 0x1C04) + ZeroMem with bounds checking wrapper @param[out] Buffer Buffer to zero. @param[in] Length Number of bytes to zero. @@ -1219,12 +1219,11 @@ } // ============================================================================ -// BCD conversion (DecimalToBcd = sub_18F4 at 0x18F4, -// BcdToDecimal = sub_1940 at 0x1940) +// BCD conversion (DecimalToBcd, BcdToDecimal) // ============================================================================ /** - DecimalToBcd - Convert a decimal value to BCD (sub_18F4 at 0x18F4) + DecimalToBcd - Convert a decimal value to BCD @param[in] Value Decimal value (must be < 100). @@ -1249,7 +1248,7 @@ } /** - BcdToDecimal - Convert a BCD value to decimal (sub_1940 at 0x1940) + BcdToDecimal - Convert a BCD value to decimal @param[in] Value BCD value (must have valid nibbles < 0xA). @@ -1283,7 +1282,7 @@ } // ============================================================================ -// PcRtcWaitForUpdateComplete (sub_1400 at 0x1400) +// PcRtcWaitForUpdateComplete // ============================================================================ /** @@ -1354,12 +1353,12 @@ } // ============================================================================ -// PcRtcDaysInMonth table (used by IsDayValid at sub_1500) +// PcRtcDaysInMonth table (used by PcRtcIsDayValid) // ============================================================================ // // Days in each month (non-leap year February = 28, leap February = 29) -// Stored as an array of 12 UINTN values for SIMD loading in sub_1500. +// Stored as an array of 12 UINTN values for SIMD loading in PcRtcIsDayValid. // xmmword_2870 = days for months 1-2 // xmmword_2880 = days for months 3-12 starting at 30 // @@ -1404,7 +1403,7 @@ } // ============================================================================ -// PcRtcIsDayValid (sub_1500 at 0x1500) +// PcRtcIsDayValid // ============================================================================ /** @@ -1465,7 +1464,7 @@ } // ============================================================================ -// PcRtcValidateTime (sub_1478 at 0x1478) +// PcRtcValidateTime // ============================================================================ /** @@ -1501,7 +1500,7 @@ } // ============================================================================ -// PcRtcConvertFromRegisterFormat (sub_1260 at 0x1260) +// PcRtcConvertFromRegisterFormat // ============================================================================ /** @@ -1621,7 +1620,7 @@ } // ============================================================================ -// PcRtcConvertToRegisterFormat (sub_1640 at 0x1640) +// PcRtcConvertToRegisterFormat // ============================================================================ /** @@ -1733,7 +1732,7 @@ } // ============================================================================ -// PcRtcTimeCompare (sub_16F8 at 0x16F8) +// PcRtcTimeCompare // ============================================================================ /** @@ -1793,7 +1792,7 @@ } // ============================================================================ -// PcRtcIsTimeNearby (sub_1744 at 0x1744) +// PcRtcIsTimeNearby // ============================================================================ /** @@ -1913,7 +1912,7 @@ } // ============================================================================ -// PcRtcGetTime - SMM GetTime handler (sub_84C -> sub_C28 at 0xC28) +// PcRtcGetTime - SMM GetTime handler // ============================================================================ /** @@ -2013,7 +2012,7 @@ } // ============================================================================ -// PcRtcGetTime thunk (sub_84C at 0x84C) +// PcRtcGetTime thunk // ============================================================================ /** @@ -2030,7 +2029,7 @@ } // ============================================================================ -// PcRtcSetTime - SMM SetTime handler (sub_854 -> sub_D20 at 0xD20) +// PcRtcSetTime - SMM SetTime handler // ============================================================================ /** @@ -2157,7 +2156,7 @@ } // ============================================================================ -// PcRtcSetTime thunk (sub_854 at 0x854) +// PcRtcSetTime thunk // ============================================================================ /** @@ -2179,7 +2178,7 @@ } // ============================================================================ -// PcRtcGetWakeupTime - SMM GetWakeupTime handler (sub_870 -> sub_EC8 at 0xEC8) +// PcRtcGetWakeupTime - SMM GetWakeupTime handler // ============================================================================ /** @@ -2316,7 +2315,7 @@ } // ============================================================================ -// PcRtcGetWakeupTime thunk (sub_870 at 0x870) +// PcRtcGetWakeupTime thunk // ============================================================================ /** @@ -2335,7 +2334,7 @@ } // ============================================================================ -// PcRtcSetWakeupTime - SMM SetWakeupTime handler (sub_87C -> sub_1074 at 0x1074) +// PcRtcSetWakeupTime - SMM SetWakeupTime handler // ============================================================================ /** @@ -2575,7 +2574,7 @@ } // ============================================================================ -// PcRtcSetWakeupTime thunk (sub_87C at 0x87C) +// PcRtcSetWakeupTime thunk // ============================================================================ /** @@ -2592,7 +2591,7 @@ } // ============================================================================ -// PcRtcInitRtcHardware - RTC chip initialization (sub_984 at 0x984) +// PcRtcInitRtcHardware - RTC chip initialization // ============================================================================ /** @@ -2808,7 +2807,7 @@ } // ============================================================================ -// PcRtcInitialize - Protocol registration (sub_884 at 0x884) +// PcRtcInitialize - Protocol registration // ============================================================================ /** @@ -2896,7 +2895,7 @@ } // ============================================================================ -// PcRtcSmmDriverInit - Full driver entry (sub_560 at 0x560) +// PcRtcSmmDriverInit - Full driver entry // ============================================================================ /** @@ -3137,7 +3136,7 @@ } // ============================================================================ -// SmmCoreEntry (sub_480 at 0x480 -> sub_560 at 0x560) +// SmmCoreEntry // ============================================================================ /** @@ -3165,11 +3164,11 @@ Module entry point for the SMM driver. This function: - 1. Calls PcRtcSmmDriverInit (via sub_560) for EFI library init. + 1. Calls PcRtcSmmDriverInit for EFI library init. 2. Sets gModuleEntryStatus to 0x8000000000000001 (EfiNotStarted). 3. Sets up a SetJump buffer for recovery on LongJump. 4. On initial SetJump return (0): - a. Calls PcRtcInitialize (sub_884) to register RTC handlers. + a. Calls PcRtcInitialize to register RTC handlers. b. If initialization fails or recovery needed: calls LongJump. c. On recovery path: calls DebugAssert for AutoGen.c ASSERTs. 5. On LongJump (non-zero): stores the return status. diff --git a/PcAtChipsetPkg/PcatRealTimeClockSmm/PcatRealTimeClockSmm/PcRtcSmm/PcRtcSmm.h b/PcAtChipsetPkg/PcatRealTimeClockSmm/PcatRealTimeClockSmm/PcRtcSmm/PcRtcSmm.h index 9a78ef9..eabc03f 100644 --- a/PcAtChipsetPkg/PcatRealTimeClockSmm/PcatRealTimeClockSmm/PcRtcSmm/PcRtcSmm.h +++ b/PcAtChipsetPkg/PcatRealTimeClockSmm/PcatRealTimeClockSmm/PcRtcSmm/PcRtcSmm.h @@ -9,2389 +9,54 @@ #include "../uefi_headers/Uefi.h" -// -// Function Prototypes -// - EFI_STATUS EFIAPI -PcRtcGetCentury( +PcRtcSmmGetTimeHandler ( VOID -); + ); EFI_STATUS EFIAPI -CpuPause( +PcRtcSmmSetTimeHandler ( VOID -); + ); EFI_STATUS EFIAPI -ReadTsc( +PcRtcSmmGetAlarmHandler ( VOID -); + ); EFI_STATUS EFIAPI -EnableInterrupts( +PcRtcSmmSetAlarmHandler ( VOID -); + ); EFI_STATUS EFIAPI -DisableInterrupts( +PcRtcInitRtcHardware ( VOID -); + ); EFI_STATUS EFIAPI -GetCallerEflags( - VOID -); +PcRtcInitialize ( + IN EFI_SMM_SYSTEM_TABLE2 *Smst + ); EFI_STATUS EFIAPI -SetJump( - VOID -); +PcRtcSmmDriverInit ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ); EFI_STATUS EFIAPI -LongJump( - VOID -); +_ModuleEntryPoint ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ); -EFI_STATUS -EFIAPI -PcRtcValidateJumpBuffer( - VOID -); - -EFI_STATUS -EFIAPI -DebugPrint( - VOID -); - -EFI_STATUS -EFIAPI -DebugAssert( - VOID -); - -EFI_STATUS -EFIAPI -CompareGuidPair( - VOID -); - -EFI_STATUS -EFIAPI -ReadUnaligned64( - VOID -); - -EFI_STATUS -EFIAPI -PcRtcSmmCpuWrite( - VOID -); - -EFI_STATUS -EFIAPI -PcdGet32( - VOID -); - -EFI_STATUS -EFIAPI -PciExpressWrite500( - VOID -); - -EFI_STATUS -EFIAPI -ReadMmio32( - VOID -); - -EFI_STATUS -EFIAPI -MicroSecondDelay( - VOID -); - -EFI_STATUS -EFIAPI -SmmCpuReadSaveState( - VOID -); - -EFI_STATUS -EFIAPI -IsAddressInSmram( - VOID -); - -EFI_STATUS -EFIAPI -FreePoolMmramAware( - VOID -); - -EFI_STATUS -EFIAPI -PcRtcReadReg( - VOID -); - -EFI_STATUS -EFIAPI -PcRtcWriteReg( - VOID -); - -EFI_STATUS -EFIAPI -DecimalToBcd( - VOID -); - -EFI_STATUS -EFIAPI -BcdToDecimal( - VOID -); - -EFI_STATUS -EFIAPI -PcRtcWaitForUpdateComplete( - VOID -); - -EFI_STATUS -EFIAPI -PcRtcIsLeapYear( - VOID -); - -EFI_STATUS -EFIAPI -PcRtcIsDayValid( - VOID -); - -EFI_STATUS -EFIAPI -PcRtcValidateTime( - VOID -); - -EFI_STATUS -EFIAPI -PcRtcConvertFromRegisterFormat( - VOID -); - -EFI_STATUS -EFIAPI -PcRtcConvertToRegisterFormat( - VOID -); - -EFI_STATUS -EFIAPI -PcRtcIsTimeNearby( - VOID -); - -EFI_STATUS -EFIAPI -PcRtcGetTime( - VOID -); - -EFI_STATUS -EFIAPI -PcRtcSmmGetTimeHandler( - VOID -); - -EFI_STATUS -EFIAPI -PcRtcSetTime( - VOID -); - -EFI_STATUS -EFIAPI -PcRtcSmmSetTimeHandler( - VOID -); - -EFI_STATUS -EFIAPI -PcRtcGetWakeupTime( - VOID -); - -EFI_STATUS -EFIAPI -PcRtcSmmGetAlarmHandler( - VOID -); - -EFI_STATUS -EFIAPI -PcRtcSetWakeupTime( - VOID -); - -EFI_STATUS -EFIAPI -PcRtcSmmSetAlarmHandler( - VOID -); - -EFI_STATUS -EFIAPI -PcRtcInitRtcHardware( - VOID -); - -EFI_STATUS -EFIAPI -PcRtcInitialize( - VOID -); - -EFI_STATUS -EFIAPI -PcRtcSmmDriverInit( - VOID -); - -EFI_STATUS -EFIAPI -SmmCoreEntry( - VOID -); - -EFI_STATUS -EFIAPI -_ModuleEntryPoint( - VOID -); - -EFI_STATUS -EFIAPI -SmmMain( - VOID -); - -EFI_STATUS -EFIAPI -SmmInstallConfigurationTable( - VOID -); - -EFI_STATUS -EFIAPI -Register Ports (SMM alias)( - VOID -); - -EFI_STATUS -EFIAPI -Register Indices( - VOID -); - -EFI_STATUS -EFIAPI -A bits( - VOID -); - -EFI_STATUS -EFIAPI -In Progress( - VOID -); - -EFI_STATUS -EFIAPI -B bits( - VOID -); - -EFI_STATUS -EFIAPI -Savings Enable( - VOID -); - -EFI_STATUS -EFIAPI -Wave Enable( - VOID -); - -EFI_STATUS -EFIAPI -Ended Interrupt Enable( - VOID -); - -EFI_STATUS -EFIAPI -Interrupt Enable( - VOID -); - -EFI_STATUS -EFIAPI -D bits( - VOID -); - -EFI_STATUS -EFIAPI -RAM and Time( - VOID -); - -EFI_STATUS -EFIAPI -macros for RTC register access via SMM I/O ports( - VOID -); - -EFI_STATUS -EFIAPI -Global Variables (mapped from .data section at 0x2A20-0x2C40)( - VOID -); - -EFI_STATUS -EFIAPI -EFI globals (set by UefiBootServicesTableLib / UefiRuntimeServicesTableLib)( - VOID -); - -EFI_STATUS -EFIAPI -gImageHandle = NULL; // 0x2AB8( - VOID -); - -EFI_STATUS -EFIAPI -EFI_BOOT_SERVICES *gBS = NULL; // 0x2AB0( - VOID -); - -EFI_STATUS -EFIAPI -//( - VOID -); - -EFI_STATUS -EFIAPI -globals (resolved via SmmServicesTableLib)( - VOID -); - -EFI_STATUS -EFIAPI -*gSmst = NULL; // 0x2AC8( - VOID -); - -EFI_STATUS -EFIAPI -from GUID at 0x2A60( - VOID -); - -EFI_STATUS -EFIAPI -Runtime RSC Handler Protocol( - VOID -); - -EFI_STATUS -EFIAPI -SmmEndOfDxe +104 SmmAllocatePages +112 SmmFreePages +120 SmmAllocatePool( - VOID -); - -EFI_STATUS -EFIAPI -*gSmmRscHandlerProtocol = NULL; // 0x2AA0 ( - VOID -); - -EFI_STATUS -EFIAPI -(qword_2AE8, lazy-init from GUID 0x2A20)( - VOID -); - -EFI_STATUS -EFIAPI -(qword_2AF0, SMM CPU I/O2 interface)( - VOID -); - -EFI_STATUS -EFIAPI -Variable Protocol (lazy-init)( - VOID -); - -EFI_STATUS -EFIAPI -*gSmmVariableProtocol = NULL; // 0x2AD0 ( - VOID -); - -EFI_STATUS -EFIAPI -type from PCD protocol( - VOID -); - -EFI_STATUS -EFIAPI -gPcdDbValue = 0; // 0x2AD8: PcdGet32(PcdPlatformType) result( - VOID -); - -EFI_STATUS -EFIAPI -(PCD protocol pointer)( - VOID -); - -EFI_STATUS -EFIAPI -list (lazy-init via gEfiHobListGuid)( - VOID -); - -EFI_STATUS -EFIAPI -*gHobListPointer = NULL; // 0x2AE0 ( - VOID -); - -EFI_STATUS -EFIAPI -range tracking( - VOID -); - -EFI_STATUS -EFIAPI -*gSmramRanges = NULL; // 0x2C18( - VOID -); - -EFI_STATUS -EFIAPI -state globals( - VOID -); - -EFI_STATUS -EFIAPI -gRtcTimeZone = 2047; // 0x2C38: EFI_UNSPECIFIED_TIMEZONE( - VOID -); - -EFI_STATUS -EFIAPI -UINT8 gRtcCenturyOffset = 0x32; // 0x2C3B (n50): CMOS offset for century byte( - VOID -); - -EFI_STATUS -EFIAPI -Config Structure (28 bytes at 0x2C20: unk_2C20)( - VOID -); - -EFI_STATUS -EFIAPI -by sub_D20 (SetTime) and sub_EC8 (GetWakeupTime) to save/restore( - VOID -); - -EFI_STATUS -EFIAPI -across operations.( - VOID -); - -EFI_STATUS -EFIAPI -gRtcConfig; // 0x2C20( - VOID -); - -EFI_STATUS -EFIAPI -System Return Status for module entry( - VOID -); - -EFI_STATUS -EFIAPI -gModuleEntryStatus = 0x8000000000000001ULL; // 0x2C08( - VOID -); - -EFI_STATUS -EFIAPI -gJumpBuffer[320]; // 0x2B10 (unk_2B10)( - VOID -); - -EFI_STATUS -EFIAPI -port scratch (byte at 0x2B00)( - VOID -); - -EFI_STATUS -EFIAPI -gDebugPortScratch; // 0x2B00( - VOID -); - -EFI_STATUS -EFIAPI -declarations for internal functions( - VOID -); - -EFI_STATUS -EFIAPI -EFI_STATUS( - VOID -); - -EFI_STATUS -EFIAPI -intrinsic wrappers (sub_470, sub_480, sub_490, sub_4A0, sub_4B0)( - VOID -); - -EFI_STATUS -EFIAPI -support functions( - VOID -); - -EFI_STATUS -EFIAPI -JUMP_BUFFER * (at least 320 bytes)( - VOID -); - -EFI_STATUS -EFIAPI -the jump buffer pointer and alignment( - VOID -); - -EFI_STATUS -EFIAPI -(JumpBuffer);( - VOID -); - -EFI_STATUS -EFIAPI -registers: rbx, rbp, rdi, rsi, r12, r13, r14, r15( - VOID -); - -EFI_STATUS -EFIAPI -by return address and MXCSR( - VOID -); - -EFI_STATUS -EFIAPI -pointer proxy( - VOID -); - -EFI_STATUS -EFIAPI -XMM6-XMM15 (128-bit each)( - VOID -); - -EFI_STATUS -EFIAPI -through the saved return address (offset 72 in jump buffer)( - VOID -); - -EFI_STATUS -EFIAPI -overlap: if Source < Destination and Source + Length >= Destination( - VOID -); - -EFI_STATUS -EFIAPI -backwards from end.( - VOID -); - -EFI_STATUS -EFIAPI -(Source < Destination &&( - VOID -); - -EFI_STATUS -EFIAPI -in reverse 8-byte chunks( - VOID -); - -EFI_STATUS -EFIAPI -(; Length >= 8; Length -= 8)( - VOID -); - -EFI_STATUS -EFIAPI -remaining bytes in reverse( - VOID -); - -EFI_STATUS -EFIAPI -(; Length > 0; Length--)( - VOID -); - -EFI_STATUS -EFIAPI -forward 8-byte chunks via qmemcpy( - VOID -); - -EFI_STATUS -EFIAPI -Remaining = Length;( - VOID -); - -EFI_STATUS -EFIAPI -remaining 1-7 bytes( - VOID -); - -EFI_STATUS -EFIAPI -8-byte aligned chunks( - VOID -); - -EFI_STATUS -EFIAPI -Chunks = Length >> 3;( - VOID -); - -EFI_STATUS -EFIAPI -remaining bytes( - VOID -); - -EFI_STATUS -EFIAPI -Remaining = Length & 7;( - VOID -); - -EFI_STATUS -EFIAPI -helpers (sub_199C at 0x199C and sub_1ABC at 0x1ABC / sub_1A34 at 0x1A34)( - VOID -); - -EFI_STATUS -EFIAPI -the SMM variable protocol if needed (lazy init)( - VOID -); - -EFI_STATUS -EFIAPI -(gSmmVariable == NULL)( - VOID -); - -EFI_STATUS -EFIAPI -debug level from CMOS (port 0x70 index 0x4C, preserving NMI bit)( - VOID -); - -EFI_STATUS -EFIAPI -(0x70, (IoRead8 (0x70) & 0x80) | 0x4C);( - VOID -); - -EFI_STATUS -EFIAPI -the filter level from CMOS( - VOID -); - -EFI_STATUS -EFIAPI -(CmosDebugLevel > 3)( - VOID -); - -EFI_STATUS -EFIAPI -if (CmosDebugLevel == 1)( - VOID -); - -EFI_STATUS -EFIAPI -}( - VOID -); - -EFI_STATUS -EFIAPI -infinite loop (no return)( - VOID -); - -EFI_STATUS -EFIAPI -(TRUE);( - VOID -); - -EFI_STATUS -EFIAPI -register via SMM CPU protocol( - VOID -); - -EFI_STATUS -EFIAPI -= 0x40000002 (some CPU register write)( - VOID -); - -EFI_STATUS -EFIAPI -= 0x0306000A( - VOID -); - -EFI_STATUS -EFIAPI -((EFI_SMM_CPU_PROTOCOL *)gSmmCpuProtocol)->WriteRegister (( - VOID -); - -EFI_STATUS -EFIAPI -alignment( - VOID -); - -EFI_STATUS -EFIAPI -(((UINTN)Address & 1) != 0)( - VOID -); - -EFI_STATUS -EFIAPI -microseconds into:( - VOID -); - -EFI_STATUS -EFIAPI -= MicroSeconds >> 22;( - VOID -); - -EFI_STATUS -EFIAPI -for the initial TSC + per-iteration ticks to pass( - VOID -); - -EFI_STATUS -EFIAPI -{( - VOID -); - -EFI_STATUS -EFIAPI -until TSC >= TargetTsc( - VOID -); - -EFI_STATUS -EFIAPI -(((TargetTsc - (UINT32)__indword (1288)) & 0x800000) == 0)( - VOID -); - -EFI_STATUS -EFIAPI -iteration uses full tick range( - VOID -); - -EFI_STATUS -EFIAPI -(35);( - VOID -); - -EFI_STATUS -EFIAPI -helper functions( - VOID -); - -/// use Smst to free inside SMRAM, -EFI_STATUS -EFIAPI -if the address is within SMRAM( - VOID -); - -EFI_STATUS -EFIAPI -BootServices to free outside.( - VOID -); - -EFI_STATUS -EFIAPI -(IsAddressInSmram ((UINT64)Buffer))( - VOID -); - -EFI_STATUS -EFIAPI -wrapper (sub_1B64 at 0x1B64)( - VOID -); - -EFI_STATUS -EFIAPI -Register Access( - VOID -); - -EFI_STATUS -EFIAPI -conversion (DecimalToBcd = sub_18F4 at 0x18F4( - VOID -); - -EFI_STATUS -EFIAPI -= sub_1940 at 0x1940)( - VOID -); - -EFI_STATUS -EFIAPI -(sub_1400 at 0x1400)( - VOID -); - -EFI_STATUS -EFIAPI -Register D VRT bit( - VOID -); - -EFI_STATUS -EFIAPI -= PcRtcReadReg (RTC_REGISTER_D);( - VOID -); - -EFI_STATUS -EFIAPI -Register A UIP with timeout( - VOID -); - -EFI_STATUS -EFIAPI -= 10001;( - VOID -); - -EFI_STATUS -EFIAPI -Register A and check UIP( - VOID -); - -EFI_STATUS -EFIAPI -= PcRtcReadReg (RTC_REGISTER_A);( - VOID -); - -EFI_STATUS -EFIAPI -VRT again after the update completes( - VOID -); - -EFI_STATUS -EFIAPI -table (used by IsDayValid at sub_1500)( - VOID -); - -EFI_STATUS -EFIAPI -in each month (non-leap year February = 28, leap February = 29)( - VOID -); - -EFI_STATUS -EFIAPI -as an array of 12 UINTN values for SIMD loading in sub_1500.( - VOID -); - -EFI_STATUS -EFIAPI -= days for months 1-2( - VOID -); - -EFI_STATUS -EFIAPI -= days for months 3-12 starting at 30( - VOID -); - -EFI_STATUS -EFIAPI -CONST UINT8 mDaysInMonth[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };( - VOID -); - -EFI_STATUS -EFIAPI -// ============================================================================( - VOID -); - -EFI_STATUS -EFIAPI -year: divisible by 4, and not (divisible by 100 unless divisible by 400)( - VOID -); - -EFI_STATUS -EFIAPI -((Year & 3) != 0)( - VOID -); - -EFI_STATUS -EFIAPI -(sub_1500 at 0x1500)( - VOID -); - -EFI_STATUS -EFIAPI -up days in this month( - VOID -); - -EFI_STATUS -EFIAPI -= mDaysInMonth[Time->Month - 1];( - VOID -); - -EFI_STATUS -EFIAPI -special: check for leap year( - VOID -); - -EFI_STATUS -EFIAPI -(Time->Month == 2)( - VOID -); - -EFI_STATUS -EFIAPI -(sub_1478 at 0x1478)( - VOID -); - -EFI_STATUS -EFIAPI -(sub_1260 at 0x1260)( - VOID -); - -EFI_STATUS -EFIAPI -PM flag from Hour bit 7 and clear it( - VOID -); - -EFI_STATUS -EFIAPI -= Time->Hour;( - VOID -); - -EFI_STATUS -EFIAPI -BCD to decimal for all time fields( - VOID -); - -EFI_STATUS -EFIAPI -for invalid BCD conversion (0xFF indicates failure)( - VOID -); - -EFI_STATUS -EFIAPI -(Time->Year == 0xFF ||( - VOID -); - -EFI_STATUS -EFIAPI -century byte from RTC CMOS( - VOID -); - -EFI_STATUS -EFIAPI -(gRtcCenturyOffset != 0)( - VOID -); - -EFI_STATUS -EFIAPI -from 12-hour to 24-hour format( - VOID -); - -EFI_STATUS -EFIAPI -(!Is24Hour)( - VOID -); - -EFI_STATUS -EFIAPI -(Time->Hour < 12)( - VOID -); - -EFI_STATUS -EFIAPI -(Time->Hour == 12)( - VOID -); - -EFI_STATUS -EFIAPI -nanosecond (time register reads don't provide nanoseconds)( - VOID -); - -EFI_STATUS -EFIAPI -(sub_1640 at 0x1640)( - VOID -); - -EFI_STATUS -EFIAPI -Hour from 24-hour to 12-hour( - VOID -); - -EFI_STATUS -EFIAPI -(Time->Hour > 12)( - VOID -); - -EFI_STATUS -EFIAPI -century: Year / 100( - VOID -); - -EFI_STATUS -EFIAPI -= Time->Year;( - VOID -); - -EFI_STATUS -EFIAPI -to BCD( - VOID -); - -EFI_STATUS -EFIAPI -century byte to CMOS( - VOID -); - -EFI_STATUS -EFIAPI -Second to BCD (return value)( - VOID -); - -EFI_STATUS -EFIAPI -(!IsBinary)( - VOID -); - -EFI_STATUS -EFIAPI -PM flag in Hour if in 12-hour mode and PM( - VOID -); - -EFI_STATUS -EFIAPI -(!Is24Hour && RegisterB == 0)( - VOID -); - -EFI_STATUS -EFIAPI -check if we need PM bit: the 12-hour conversion already set it.( - VOID -); - -EFI_STATUS -EFIAPI -make sure it's persistent.( - VOID -); - -EFI_STATUS -EFIAPI -(sub_16F8 at 0x16F8)( - VOID -); - -EFI_STATUS -EFIAPI -equal, check minutes( - VOID -); - -EFI_STATUS -EFIAPI -(Time1->Minute > Time2->Minute)( - VOID -); - -EFI_STATUS -EFIAPI -equal, check seconds( - VOID -); - -EFI_STATUS -EFIAPI -(Time1->Second > Time2->Second)( - VOID -); - -EFI_STATUS -EFIAPI -(sub_1744 at 0x1744)( - VOID -); - -EFI_STATUS -EFIAPI -Dec 31 -> Jan 1 cross-year( - VOID -); - -EFI_STATUS -EFIAPI -((UINT16)From->Year + 1 != (UINT16)Target->Year ||( - VOID -); - -EFI_STATUS -EFIAPI -month rollover: From->Month + 1 == Target->Month and Target->Day == 1( - VOID -); - -EFI_STATUS -EFIAPI -(FromMonth + 1 == (UINTN)Target->Month && Target->Day == 1)( - VOID -); - -EFI_STATUS -EFIAPI -(PcRtcIsLeapYear (From->Year))( - VOID -); - -EFI_STATUS -EFIAPI -other months, check days-in-month( - VOID -); - -EFI_STATUS -EFIAPI -= (From->Day == mDaysInMonth[FromMonth - 1]);( - VOID -); - -/// check day rollover -EFI_STATUS -EFIAPI -year, same month( - VOID -); - -EFI_STATUS -EFIAPI -(From->Day + 1 == Target->Day)( - VOID -); - -/// alarm must be >= current time -EFI_STATUS -EFIAPI -day( - VOID -); - -EFI_STATUS -EFIAPI -(From->Day == Target->Day && PcRtcTimeCompare (From, Target) <= 0)( - VOID -); - -EFI_STATUS -EFIAPI -- SMM GetTime handler (sub_84C -> sub_C28 at 0xC28)( - VOID -); - -EFI_STATUS -EFIAPI -Register B to determine format( - VOID -); - -EFI_STATUS -EFIAPI -= PcRtcReadReg (RTC_REGISTER_B);( - VOID -); - -EFI_STATUS -EFIAPI -all time registers( - VOID -); - -EFI_STATUS -EFIAPI -TimeZone and Daylight from globals( - VOID -); - -EFI_STATUS -EFIAPI -from register format (BCD->decimal, 12hr->24hr, add century)( - VOID -); - -EFI_STATUS -EFIAPI -= PcRtcConvertFromRegisterFormat (Time, RegisterB);( - VOID -); - -EFI_STATUS -EFIAPI -the converted time( - VOID -); - -EFI_STATUS -EFIAPI -= PcRtcValidateTime (Time);( - VOID -); - -EFI_STATUS -EFIAPI -capabilities( - VOID -); - -EFI_STATUS -EFIAPI -(Capabilities != NULL)( - VOID -); - -EFI_STATUS -EFIAPI -Hz( - VOID -); - -EFI_STATUS -EFIAPI -thunk (sub_84C at 0x84C)( - VOID -); - -EFI_STATUS -EFIAPI -- SMM SetTime handler (sub_854 -> sub_D20 at 0xD20)( - VOID -); - -EFI_STATUS -EFIAPI -the time( - VOID -); - -EFI_STATUS -EFIAPI -time for internal manipulation( - VOID -); - -EFI_STATUS -EFIAPI -(&LocalTime, Time, sizeof (EFI_TIME));( - VOID -); - -EFI_STATUS -EFIAPI -for update complete before writing( - VOID -); - -EFI_STATUS -EFIAPI -= PcRtcWaitForUpdateComplete ();( - VOID -); - -EFI_STATUS -EFIAPI -the "RTC" SMM variable to invalidate DXE-side cache( - VOID -); - -EFI_STATUS -EFIAPI -(gSmmRuntimeRsc != NULL)( - VOID -); - -EFI_STATUS -EFIAPI -RSC protocol has the SmmDeleteVariable at offset 88( - VOID -); - -EFI_STATUS -EFIAPI -SET bit in Register B to freeze RTC updates( - VOID -); - -EFI_STATUS -EFIAPI -century byte to CMOS (offset from Config or default 0x32)( - VOID -); - -EFI_STATUS -EFIAPI -(Config != NULL && Config->CenturyRegister != 0)( - VOID -); - -EFI_STATUS -EFIAPI -time to register format( - VOID -); - -EFI_STATUS -EFIAPI -(&LocalTime, RegisterB);( - VOID -); - -EFI_STATUS -EFIAPI -(RTC_SECONDS, LocalTime.Second);( - VOID -); - -EFI_STATUS -EFIAPI -SET bit to resume RTC updates( - VOID -); - -EFI_STATUS -EFIAPI -(RTC_REGISTER_B, RegisterB & ~RTC_B_SET);( - VOID -); - -EFI_STATUS -EFIAPI -TimeZone and Daylight to config structure( - VOID -); - -EFI_STATUS -EFIAPI -(Config != NULL)( - VOID -); - -EFI_STATUS -EFIAPI -thunk (sub_854 at 0x854)( - VOID -); - -EFI_STATUS -EFIAPI -- SMM GetWakeupTime handler (sub_870 -> sub_EC8 at 0xEC8)( - VOID -); - -EFI_STATUS -EFIAPI -Register B and C for alarm status( - VOID -); - -EFI_STATUS -EFIAPI -alarm registers (seconds, minutes, hours)( - VOID -); - -EFI_STATUS -EFIAPI -date registers (day, month, year)( - VOID -); - -EFI_STATUS -EFIAPI -Register D for century storage( - VOID -); - -EFI_STATUS -EFIAPI -RegisterD;( - VOID -); - -EFI_STATUS -EFIAPI -TimeZone/Daylight from config structure( - VOID -); - -EFI_STATUS -EFIAPI -to read the "RTCALARM" SMM variable to get Year/Month( - VOID -); - -EFI_STATUS -EFIAPI -= sizeof (EFI_TIME);( - VOID -); - -EFI_STATUS -EFIAPI -Year/Month/Day from the stored alarm variable( - VOID -); - -EFI_STATUS -EFIAPI -from register format( - VOID -); - -EFI_STATUS -EFIAPI -thunk (sub_870 at 0x870)( - VOID -); - -EFI_STATUS -EFIAPI -- SMM SetWakeupTime handler (sub_87C -> sub_1074 at 0x1074)( - VOID -); - -EFI_STATUS -EFIAPI -current RTC time to validate proximity (alarm must be within 24 hours)( - VOID -); - -EFI_STATUS -EFIAPI -= PcRtcGetTime (&CurrentTime, NULL);( - VOID -); - -EFI_STATUS -EFIAPI -if alarm time is nearby (within 1 day)( - VOID -); - -EFI_STATUS -EFIAPI -(!PcRtcIsTimeNearby (&CurrentTime, Time))( - VOID -); - -EFI_STATUS -EFIAPI -alarm time( - VOID -); - -EFI_STATUS -EFIAPI -(&AlarmTime, Time, sizeof (EFI_TIME));( - VOID -); - -EFI_STATUS -EFIAPI -alarm to register format( - VOID -); - -EFI_STATUS -EFIAPI -(&AlarmTime, RegisterB);( - VOID -); - -EFI_STATUS -EFIAPI -current alarm register values (for restoring previous alarm)( - VOID -); - -EFI_STATUS -EFIAPI -Register D century( - VOID -); - -EFI_STATUS -EFIAPI -= PcRtcReadReg (RTC_REGISTER_D) & 0x3F;( - VOID -); - -EFI_STATUS -EFIAPI -TimeZone/Daylight from globals( - VOID -); - -EFI_STATUS -EFIAPI -"RTCALARM" SMM variable( - VOID -); - -EFI_STATUS -EFIAPI -= ((SMM_RSC_HANDLER_PROTOCOL *)gSmmRuntimeRsc)->SmmSetVariable (( - VOID -); - -EFI_STATUS -EFIAPI -Register B SET bit to freeze updates( - VOID -); - -EFI_STATUS -EFIAPI -= RegisterB | RTC_B_SET;( - VOID -); - -EFI_STATUS -EFIAPI -alarm registers( - VOID -); - -EFI_STATUS -EFIAPI -(RTC_SECONDS_ALARM, AlarmTime.Second);( - VOID -); - -EFI_STATUS -EFIAPI -and update Register D with the alarm day/century( - VOID -); - -EFI_STATUS -EFIAPI -(RTC_REGISTER_C); // Clear pending AF( - VOID -); - -EFI_STATUS -EFIAPI -(RTC_REGISTER_D, AlarmTime.Day & 0x3F);( - VOID -); - -EFI_STATUS -EFIAPI -pending interrupt by reading Register C( - VOID -); - -EFI_STATUS -EFIAPI -(RTC_REGISTER_C);( - VOID -); - -EFI_STATUS -EFIAPI -existing alarm values and keep them (only clear AIE)( - VOID -); - -EFI_STATUS -EFIAPI -date( - VOID -); - -EFI_STATUS -EFIAPI -alarm registers (redundant for Enabled, restores current for not)( - VOID -); - -EFI_STATUS -EFIAPI -(!Enabled)( - VOID -); - -EFI_STATUS -EFIAPI -read( - VOID -); - -EFI_STATUS -EFIAPI -Month/Year( - VOID -); - -EFI_STATUS -EFIAPI -(RTC_MONTH, AlarmTime.Month);( - VOID -); - -EFI_STATUS -EFIAPI -AIE bit: set if enabled, clear if not( - VOID -); - -EFI_STATUS -EFIAPI -(Enabled)( - VOID -); - -EFI_STATUS -EFIAPI -final Register B value (clear SET, optionally set AIE)( - VOID -); - -EFI_STATUS -EFIAPI -(RTC_REGISTER_B, RegisterBNew & 0x7F);( - VOID -); - -EFI_STATUS -EFIAPI -thunk (sub_87C at 0x87C)( - VOID -); - -EFI_STATUS -EFIAPI -- RTC chip initialization (sub_984 at 0x984)( - VOID -); - -EFI_STATUS -EFIAPI -1: Initialize RTC hardware registers( - VOID -); - -EFI_STATUS -EFIAPI -(RTC_REGISTER_A, 0x26); // 32768 Hz, divider reset( - VOID -); - -EFI_STATUS -EFIAPI -pending interrupt( - VOID -); - -EFI_STATUS -EFIAPI -VRT (will be set by hardware)( - VOID -); - -EFI_STATUS -EFIAPI -for UIP to clear( - VOID -); - -EFI_STATUS -EFIAPI -2: Read the current RTC time from hardware( - VOID -); - -EFI_STATUS -EFIAPI -3: Configure Register B( - VOID -); - -EFI_STATUS -EFIAPI -bits: AIE (5), DM (2) = 0x24( - VOID -); - -EFI_STATUS -EFIAPI -= (RegisterB & 0x24) | 0x02;( - VOID -); - -EFI_STATUS -EFIAPI -4: Try to read the "RTC" SMM variable for TimeZone( - VOID -); - -EFI_STATUS -EFIAPI -= sizeof (UINT64);( - VOID -); - -EFI_STATUS -EFIAPI -5: Try to convert and validate the current time( - VOID -); - -EFI_STATUS -EFIAPI -= PcRtcConvertFromRegisterFormat (&CurrentTime, RegisterBNew);( - VOID -); - -/// reset to factory defaults -EFI_STATUS -EFIAPI -invalid( - VOID -); - -EFI_STATUS -EFIAPI -reset via SMM CPU protocol write( - VOID -); - -EFI_STATUS -EFIAPI -();( - VOID -); - -EFI_STATUS -EFIAPI -SET (bit 7) is clear, AIE (bit 5) is set, 24HR (bit 1) is set( - VOID -); - -EFI_STATUS -EFIAPI -(RTC_REGISTER_B, RegisterBNew & 0xDF | 0x02);( - VOID -); - -EFI_STATUS -EFIAPI -6: Write back the SMM variable with the current time + config( - VOID -); - -EFI_STATUS -EFIAPI -= PcRtcSetTime (&CurrentTime, &gRtcConfig);( - VOID -); - -EFI_STATUS -EFIAPI -7: Get wakeup alarm time( - VOID -); - -EFI_STATUS -EFIAPI -= PcRtcGetWakeupTime (&AlarmEnabled, &AlarmPending, &AlarmTime, &gRtcConfig);( - VOID -); - -EFI_STATUS -EFIAPI -8: If no alarm pending, set default alarm (2000-01-01, clear AIE)( - VOID -); - -EFI_STATUS -EFIAPI -(!AlarmEnabled && EFI_ERROR (Status))( - VOID -); - -EFI_STATUS -EFIAPI -the current config timezone/daylight( - VOID -); - -EFI_STATUS -EFIAPI -= gRtcConfig.TimeZone;( - VOID -); - -EFI_STATUS -EFIAPI -default alarm time: 2000-01-01 00:00:00( - VOID -); - -EFI_STATUS -EFIAPI -to register format( - VOID -); - -EFI_STATUS -EFIAPI -(&CurrentTime, RegisterB);( - VOID -); - -EFI_STATUS -EFIAPI -the "RTCALARM" variable( - VOID -); - -EFI_STATUS -EFIAPI -Register B SET bit, write alarm registers, clear SET bit( - VOID -); - -EFI_STATUS -EFIAPI -(RTC_REGISTER_B, RegisterB | RTC_B_SET);( - VOID -); - -EFI_STATUS -EFIAPI -- Protocol registration (sub_884 at 0x884)( - VOID -); - -EFI_STATUS -EFIAPI -the protocol database for gEfiSmmRscHandlerGuid( - VOID -); - -EFI_STATUS -EFIAPI -= Smst->NumberOfProtocols;( - VOID -); - -EFI_STATUS -EFIAPI -protocol entry from Smst->ProtocolRegistry( - VOID -); - -EFI_STATUS -EFIAPI -entry is 24 bytes:( - VOID -); - -EFI_STATUS -EFIAPI -*EntryGuid = (EFI_GUID *)(*(UINT64 *)(Smst + 160) + (Index * 24));( - VOID -); - -EFI_STATUS -EFIAPI -not find SMM Runtime Services Protocol( - VOID -); - -EFI_STATUS -EFIAPI -(4, "Couldn't find SMM Runtime Services\n");( - VOID -); - -EFI_STATUS -EFIAPI -RTC hardware( - VOID -); - -EFI_STATUS -EFIAPI -= PcRtcInitRtcHardware (gSmmRuntimeRsc);( - VOID -); - -EFI_STATUS -EFIAPI -the four RTC handlers in the RSC protocol( - VOID -); - -EFI_STATUS -EFIAPI -- Full driver entry (sub_560 at 0x560)( - VOID -); - -EFI_STATUS -EFIAPI -1: Save EFI table pointers to globals( - VOID -); - -EFI_STATUS -EFIAPI -= ImageHandle;( - VOID -); - -EFI_STATUS -EFIAPI -2: Locate SMM Base2 protocol( - VOID -); - -EFI_STATUS -EFIAPI -= NULL;( - VOID -); - -EFI_STATUS -EFIAPI -3: Get Smst location( - VOID -); - -EFI_STATUS -EFIAPI -4: Locate SMM Access2 protocol( - VOID -); - -EFI_STATUS -EFIAPI -= 0;( - VOID -); - -EFI_STATUS -EFIAPI -5: Get SMRAM capabilities (query size first)( - VOID -); - -EFI_STATUS -EFIAPI -6: Allocate buffer for SMRAM ranges( - VOID -); - -EFI_STATUS -EFIAPI -= AllocateSmramPool (EfiRuntimeServicesData, SmramRangeBufferSize);( - VOID -); - -EFI_STATUS -EFIAPI -7: Re-read SMRAM ranges into the allocated buffer( - VOID -); - -EFI_STATUS -EFIAPI -= ((EFI_SMM_ACCESS2_PROTOCOL *)(UINTN)CpuIo2Handle)->GetCapabilities (( - VOID -); - -EFI_STATUS -EFIAPI -8: Calculate SMRAM range count (each range is 32 bytes = 5 qwords >> 5)( - VOID -); - -EFI_STATUS -EFIAPI -= SmramRangeBufferSize >> 5;( - VOID -); - -EFI_STATUS -EFIAPI -9: Get PCD protocol and read platform type( - VOID -); - -EFI_STATUS -EFIAPI -= ((PCD_PROTOCOL *)GetPcdProtocol ())->Get32 (5);( - VOID -); - -EFI_STATUS -EFIAPI -10: Initialize HOB list( - VOID -); - -EFI_STATUS -EFIAPI -11: Check PCIe config address for Express presence( - VOID -); - -EFI_STATUS -EFIAPI -((INT8)(*(UINT8 *)PciExpressReadAddress (1024068)) >= 0)( - VOID -); - -EFI_STATUS -EFIAPI -0x500 to the word at PCIe config address 0x100100 (1024064)( - VOID -); - -EFI_STATUS -EFIAPI -((UINT16 *)PciExpressReadAddress (1024064));( - VOID -); - -/// enable memory space -EFI_STATUS -EFIAPI -bit 7 on the byte at 0x100104 (1024068)( - VOID -); - -EFI_STATUS -EFIAPI -12: TSC-based short delay (approx 357 TSC cycles)( - VOID -); - -EFI_STATUS -EFIAPI -= GetCallerEflags ();( - VOID -); - -EFI_STATUS -EFIAPI -initial TSC( - VOID -); - -EFI_STATUS -EFIAPI -= ReadMmio32 (1288) & 0xFFFFFF;( - VOID -); - -EFI_STATUS -EFIAPI -target TSC: initial + 357 cycles( - VOID -); - -EFI_STATUS -EFIAPI -= ReadTsc ();( - VOID -); - -EFI_STATUS -EFIAPI -previous interrupt state( - VOID -); - -EFI_STATUS -EFIAPI -(InterruptsEnabled)( - VOID -); - -EFI_STATUS -EFIAPI -(sub_480 at 0x480 -> sub_560 at 0x560)( - VOID -); - -EFI_STATUS -EFIAPI -(0x4B4)( - VOID -); - -EFI_STATUS -EFIAPI -the driver( - VOID -); - -EFI_STATUS -EFIAPI -(ImageHandle, SystemTable);( - VOID -); - -EFI_STATUS -EFIAPI -for error recovery( - VOID -); - -EFI_STATUS -EFIAPI -(SetJump (&gJumpBuffer) == 0)( - VOID -); - -EFI_STATUS -EFIAPI -execution: initialize RTC and register handlers( - VOID -); - -EFI_STATUS -EFIAPI -= PcRtcInitialize (gSmst);( - VOID -); - -EFI_STATUS -EFIAPI -the jump buffer and prepare for re-initialization( - VOID -); - -EFI_STATUS -EFIAPI -(&gJumpBuffer);( - VOID -); - -EFI_STATUS -EFIAPI -ASSERTs are reached only via AutoGen.c recovery:( - VOID -); - -EFI_STATUS -EFIAPI -(( - VOID -); - -EFI_STATUS -EFIAPI -path: free SMRAM pool( - VOID -); - -EFI_STATUS -EFIAPI -(gSmramRanges);( - VOID -); - -EFI_STATUS -EFIAPI -- backward compatibility entry (forwarded from entry point)( - VOID -); - -EFI_STATUS -EFIAPI -the SMM system table( - VOID -); - -EFI_STATUS -EFIAPI -= Smst;( - VOID -); - -EFI_STATUS -EFIAPI -remaining init happens in _ModuleEntryPoint via PcRtcSmmDriverInit( - VOID -); - -EFI_STATUS -EFIAPI -PcRtcInitialize.( - VOID -); - -EFI_STATUS -EFIAPI -EFI_SUCCESS;( - VOID -); - -EFI_STATUS -EFIAPI -function is a no-op in the reconstructed driver; the original( - VOID -); - -EFI_STATUS -EFIAPI -allocated and populated the configuration table via( - VOID -); - -#endif /* __PCRTCSMM_H__ */ +#endif diff --git a/PurleySktPkg/Me/Heci/MeUma/MeUma/MeUma.c b/PurleySktPkg/Me/Heci/MeUma/MeUma/MeUma.c index 13c435c..9f864a9 100644 --- a/PurleySktPkg/Me/Heci/MeUma/MeUma/MeUma.c +++ b/PurleySktPkg/Me/Heci/MeUma/MeUma/MeUma.c @@ -1,80 +1,3 @@ -/** @file - MeUma.c - ME UMA (Unified Memory Allocation) PPI Driver - - This PEIM validates and installs the ME UMA PPI to communicate - UMA (Unified Memory Allocation) parameters between the ME subsystem - and the host BIOS during the PEI phase. It reads UMA base addresses - and sizes from PCI config space (ME device registers at 0xF0/0xF4), - compares them with values stored in HOBs, validates the size is - within the 64MB limit and 2MB-aligned, then installs the PPI. - - Source: e:\\hs\\PurleySktPkg\\Me\\Heci\\MeUma\\MeUma.c - Module: MeUma.efi - ImageBase: 0xffd9fcb4 - ImageSize: 0x3900 - Arch: IA32 (32-bit) - SHA256: c35b3a8ca178d589edbd9a7325c5fe0cc2d5ea203487fd3c080aca5e9eb4c262 - - Renamed symbols (IDA port 13433): - - sub_FFD9FF14 -> MeZeroMem (memset(buf, 0, count)) - - sub_FFD9FF34 -> MeSetMem (memset(buf, value, count)) - - sub_FFD9FF54 -> MeCopyMem (memmove with overlap handling) - - sub_FFD9FF94 -> MeSetDwords (fills QWORD pairs) - - sub_FFD9FFB4 -> MeSetMem32 (memset32(buf, value, count)) - - sub_FFDA098C -> MeUmaValidateLocation (UMA validation logic) - - sub_FFDA0B2A -> PeiServicesLocator (LocatePpi wrapper) - - sub_FFDA0B48 -> CopyGuid (WriteUnaligned64 based copy) - - sub_FFDA0B78 -> IsEqualGuid (ReadUnaligned64 comparison) - - sub_FFDA0BD7 -> PciCfgRead (PCI config read via MMIO/IO) - - sub_FFDA0C23 -> GetMeUmaSizeAdjust (returns 0, placeholder) - - sub_FFDA0C4A -> ReadUnaligned64 (*(UINT64*)Buffer) - - sub_FFDA0C76 -> WriteUnaligned64 (*(UINT64*)Buffer = Value) - - sub_FFDA0CAA -> IoRead16 (IN port word read) - - sub_FFDA0CD8 -> IoWrite16 (OUT port word write) - - sub_FFDA0D0B -> IoRead32 (IN port dword read) - - sub_FFDA0D37 -> GetDebugOutput (locates debug PPI) - - sub_FFDA0D5F -> DebugPrint (conditional debug output) - - sub_FFDA0D89 -> DebugAssert (assert handler) - - sub_FFDA0DA7 -> IsDfxFlow (PCH PMC DWR bit check) - - sub_FFDA0DF4 -> GetMeFs1FromHob (MEFS1 from ME FW HOB) - - sub_FFDA0E5E -> GetOnBoardMeType (ME type detection) - - sub_FFDA0F44 -> IsMeTypeNormal (IsMeTypeNormal) - - sub_FFDA0F54 -> StallMicroseconds (IO port 0x508 polling) - - sub_FFDA0FA3 -> PeiPerfInit (performance HOB init) - - sub_FFDA1067 -> PeiPerfFindEntry (search perf log) - - sub_FFDA10EE -> PeiPerfLogEntry (add perf entry) - - sub_FFDA118B -> PeiPerfLogEnd (close perf entry) - - sub_FFDA11E7 -> GetBootMode (BootMode PPI call) - - sub_FFDA120E -> HeciSendMessage (HECI PPI message send) - - sub_FFDA12DF -> GetMeSpsPolicy (SPS policy PPI) - - sub_FFDA1332 -> GetPlatformType (CMOS 0x4A read) - - sub_FFDA1381 -> GetPeiServices (IDT-based PP retrieval) - - sub_FFDA13B3 -> ZeroMem (ZeroMem with ASSERTs) - - sub_FFDA140E -> GetPcdDb (PCD database PPI) - - sub_FFDA145D -> GetPcd32 (PCD Get32 wrapper) - - sub_FFDA146C -> GetPcd64 (PCD GetSize wrapper) - - sub_FFDA147B -> GetHobList (GetHobList via PEI services) - - sub_FFDA14E9 -> FindHobByType (HOB type scan) - - sub_FFDA152E -> FindGuidHob (GUID HOB walk) - - sub_FFDA1561 -> BuildGuidHobRaw (CreateHob for GUID type) - - sub_FFDA15B1 -> BuildGuidHob (BuildGuidHob: Create + CopyGuid) - - sub_FFDA161C -> ReadTsegRegion (TSEG base from PCI) - - sub_FFDA163A -> PchPwrmBaseGet (PCH PMC base) - - sub_FFDA16CA -> AsciiStrLen (strlen with bound) - - sub_FFDA1725 -> AsciiStrCmp (strncmp wrapper) - - sub_FFDA17C9 -> GetTscFrequency (3.579545 GHz) - - sub_FFDA17F3 -> IsOverlapRegion (range overlap test) - - sub_FFDA1816 -> StrnLenAscii (bounded strlen) - - sub_FFDA1835 -> AsciiStrCpyS (safe strcpy) - - sub_FFDA190F -> ReadIdtr (SIDT instruction) - - sub_FFDA194F -> PciExpressRead (ECAM base resolution) - - sub_FFDA195B -> PciExpressRead8 (byte read from ECAM) - - sub_FFDA198B -> PciExpressWrite16 (word write to ECAM) - - sub_FFDA19A1 -> InitPciExpressBase (ECAM init logic) - - sub_FFDA1A3C -> GetPciExpressBase (ECAM base address decode) - - _ModuleEntryPoint -> MeUmaEntryPoint (PEIM entry, installs PPI) -**/ - #include #include /* GUID-defined PPI produced by this driver */ #include @@ -94,9 +17,9 @@ // Located in the .data section at 0xffda3390. // extern EFI_GUID gMeUmaPpiGuid; -extern VOID *gMeUmaPpi; // The actual ME_UMA_PPI structure +extern VOID *gMeUmaPpi; -UINT8 byte_FFDA339C; // Flags / state byte at 0xffda339c +UINT8 byte_FFDA339C; // // --------------------------------------------------------------------------- @@ -765,9 +688,8 @@ IN EFI_SYSTEM_TABLE *SystemTable ) { - EFI_STATUS Status; - EFI_PEI_SERVICES **PeiServices; - EFI_PEI_PPI_DESCRIPTOR *PpiDescriptor; + EFI_STATUS Status; + EFI_PEI_SERVICES **PeiServices; // // One-time initialization of the PCI Express register. @@ -801,4 +723,4 @@ } return Status; -} \ No newline at end of file +} diff --git a/PurleySktPkg/SouthClusterLbg/SiInit/Pei/SiInit/SiInit.c b/PurleySktPkg/SouthClusterLbg/SiInit/Pei/SiInit/SiInit.c index e0967b8..2cf0c1d 100644 --- a/PurleySktPkg/SouthClusterLbg/SiInit/Pei/SiInit/SiInit.c +++ b/PurleySktPkg/SouthClusterLbg/SiInit/Pei/SiInit/SiInit.c @@ -85,7 +85,7 @@ if ( PciGetInfo(0xFA044u) >= 0 ) /*0xffd6d0ff*/ { PciExpressSetFlag(); /*0xffd6d101*/ - v2 = sub_FFD74F0F(); /*0xffd6d106*/ + v2 = PchGpioBaseGet(); /*0xffd6d106*/ *(_BYTE *)(v2 + 1024068) |= 0x80u; /*0xffd6d111*/ } BootMode = PeiServicesGetBootMode(); /*0xffd6d114*/ @@ -688,7 +688,7 @@ // Function: AssertCpuDeadLoop_3 @ 0xffd6dbf4 (0x8f bytes) -int __cdecl sub_FFD6DBF4(int a1, int a2) +int __cdecl PchTraceHubSetMemoryAsUncached(int a1, int a2) { int v2; // ecx int v3; // edi @@ -3663,7 +3663,7 @@ // Function: AssertCpuDeadLoop_9 @ 0xffd719e7 (0x3a bytes) -_WORD *__thiscall sub_FFD719E7(char *this) +_WORD *__thiscall HobFindGuidHob(char *this) { _WORD *i; // edx int v3; // ecx @@ -3706,7 +3706,7 @@ // Function: HobConfig_0 @ 0xffd71a62 (0x6e bytes) -int __fastcall sub_FFD71A62(int a1, unsigned int n6948) +int __fastcall HobCreateGuidHob(int a1, unsigned int n6948) { int v4; // eax int v5; // eax @@ -3770,7 +3770,7 @@ // Function: HobConfig @ 0xffd71b1e (0x78 bytes) -_DWORD *__cdecl sub_FFD71B1E(int a1, int a2) +_DWORD *__cdecl HobCreateResourceDescriptorHob(int a1, int a2) { int v2; // eax _DWORD *result; // eax @@ -3882,7 +3882,7 @@ // Function: Assert_27 @ 0xffd71d0f (0x30 bytes) -int __fastcall sub_FFD71D0F(int a1, int a2) +int __fastcall CopyGuid(int a1, int a2) { __int64 v4; // rax __int64 v5; // rax @@ -3897,7 +3897,7 @@ // Function: Assert_26 @ 0xffd71d3f (0x5f bytes) -bool __fastcall sub_FFD71D3F(char *this, int a2) +bool __fastcall CompareGuid(char *this, int a2) { __int64 v4; // rax int v5; // ebp @@ -3922,7 +3922,7 @@ // Function: MemConfig_0 @ 0xffd71d9e (0x53 bytes) -void *__fastcall sub_FFD71D9E(int buf, unsigned int count) +void *__fastcall ZeroMemChecked(int buf, unsigned int count) { int v4; // eax int v5; // eax @@ -4649,7 +4649,7 @@ // Function: DebugLogPrint_22 @ 0xffd72900 (0x21 bytes) -void *__thiscall sub_FFD72900(_DWORD *this) +void *__thiscall GetDebugLogBuffer(_DWORD *this) { if ( DebugLogPrint_13() == 1 ) /*0xffd7290b*/ { @@ -4704,7 +4704,7 @@ // Function: DebugLogPrint_14 @ 0xffd72992 (0xa2 bytes) -int __fastcall sub_FFD72992(unsigned __int8 a1, unsigned __int16 a2, int a3, _BYTE *a4) +int __fastcall PchPcrRead(unsigned __int8 a1, unsigned __int16 a2, int a3, _BYTE *a4) { int v4; // eax @@ -5359,7 +5359,7 @@ // Function: Assert_18 @ 0xffd73427 (0x35 bytes) -unsigned __int16 __fastcall sub_FFD73427(unsigned __int16 a1, unsigned __int16 n2048) +unsigned __int16 __fastcall IoWrite16(unsigned __int16 a1, unsigned __int16 n2048) { int v4; // eax @@ -5398,7 +5398,7 @@ // Function: Assert_20 @ 0xffd73488 (0x32 bytes) -unsigned int __fastcall sub_FFD73488(unsigned __int16 a1, unsigned int a2) +unsigned int __fastcall IoWrite32(unsigned __int16 a1, unsigned int a2) { int v4; // eax @@ -5440,7 +5440,7 @@ // Function: Assert_24 @ 0xffd73504 (0x27 bytes) -__int16 __thiscall sub_FFD73504(void *this) +__int16 __thiscall ReadU16(void *this) { int v2; // eax @@ -5459,7 +5459,7 @@ // Function: Assert_23 @ 0xffd7352b (0x29 bytes) -int __thiscall sub_FFD7352B(void *this) +int __thiscall ReadU32(void *this) { int v2; // eax @@ -5478,7 +5478,7 @@ // Function: Assert_22 @ 0xffd73554 (0x2c bytes) -__int64 __thiscall sub_FFD73554(void *this) +__int64 __thiscall ReadU64(void *this) { int v2; // eax @@ -5497,7 +5497,7 @@ // Function: Assert_19 @ 0xffd73580 (0x34 bytes) -int __cdecl sub_FFD73580(int a1, int a2) +int __cdecl StoreU32(int a1, int a2) { _DWORD *v2; // ecx _DWORD *v3; // esi @@ -7110,7 +7110,7 @@ 109, "((Address) & ~0xfffffff) == 0"); } - return *(_BYTE *)(sub_FFD74F0F() + n1024068); /*0xffd74f49*/ + return *(_BYTE *)(PchGpioBaseGet() + n1024068); /*0xffd74f49*/ } @@ -7120,7 +7120,7 @@ { int v0; // eax - v0 = sub_FFD74F0F(); /*0xffd74f4b*/ + v0 = PchGpioBaseGet(); /*0xffd74f4b*/ return GpioGetGroupIndexFromPad(v0 + 1024064, 1280); } diff --git a/PurleySktPkg/SouthClusterLbg/SiInit/Pei/SiInit/SiInit.h b/PurleySktPkg/SouthClusterLbg/SiInit/Pei/SiInit/SiInit.h index f074b84..b7caa53 100644 --- a/PurleySktPkg/SouthClusterLbg/SiInit/Pei/SiInit/SiInit.h +++ b/PurleySktPkg/SouthClusterLbg/SiInit/Pei/SiInit/SiInit.h @@ -1,1078 +1,39 @@ -/** @file - SiInit.h -- Header for SiInit - -Copyright (c) HR650X BIOS Decompilation Project -**/ - #ifndef __SIINIT_H__ #define __SIINIT_H__ #include "../uefi_headers/Uefi.h" -// -// Function Prototypes -// +EFI_STATUS EFIAPI ModuleEntryPoint(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable); +EFI_STATUS EFIAPI SiInitOnEndOfPei_0(int a1, int a2); +int __thiscall SiInit_Entry(void *this); +int DebugClear(void); +int __fastcall DebugPrint(int a1, int a2, int a3, int a4); +int __fastcall SiCreateHob(int n3, int n48, int *p_n3); +int __cdecl SiFreePages(int a1, int a2); +int DebugAssert(void); +int __fastcall DebugPrintAssert(int a1, const char *a2, ...); +int __fastcall SiAssert(int e, int n37, const char *PeiServices); +unsigned int __fastcall SiDelayLoop(unsigned int a1); +unsigned int __fastcall SiMicroSecondDelay(unsigned int a1); +int __thiscall PchInit_AfterMem(int this); +int SiInitOnEndOfPei(void); +int __thiscall PchOnEndOfPei(void); +int __thiscall PchInit(int this); +int __cdecl PchTraceHubSetMemoryAsUncached(int a1, int a2); +int __thiscall PchInitEndOfPeiCallback(int this); +int __fastcall HdaCodecWaitNotBusy(_DWORD *a1, int a2, int a3); +int __fastcall Assert_25(_DWORD *a1, unsigned int *p_p_n5, char a3); +int __fastcall PchPcrRead(unsigned __int8 a1, unsigned __int16 a2, int a3, _BYTE *a4); +int __fastcall DxeInit_0(int n144, __int16 n160); +int __fastcall PchInterruptConfigEntry(int n144, __int16 n160, int a3, int a4); +int __fastcall AssertEfiError(int n144, unsigned __int16 n160, int a3, int a4); +int __fastcall PchInterruptCheck(unsigned __int16 n8756, char n255, char n31); +int GpioLockGpios(void); +int PchGpioInit(void); +char PchPcieRootPortCount(void); +char PchGetNumUsbPorts(void); +int GpioReadGroupCached(void); +int __thiscall PchAcpiBaseGet(_WORD *this); +int __thiscall ConfigureAudioPll(unsigned int *this); -EFI_STATUS -EFIAPI -ModuleEntryPoint( - VOID -); - -EFI_STATUS -EFIAPI -int BootMode; // eax( - VOID -); - -EFI_STATUS -EFIAPI -EFI_STATUS v5; // esi( - VOID -); - -EFI_STATUS -EFIAPI -if ( PciGetInfo(0xFA044u) >= 0 )( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd6cfb4 (size=0x15)( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd6cfd4 (size=0x20)( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd6cff4 (size=0x3f)( - VOID -); - -EFI_STATUS -EFIAPI -char *dst_1; // edi( - VOID -); - -EFI_STATUS -EFIAPI -count = count_1;( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd6d034 (size=0x1f)( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd6d054 (size=0x15)( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd6d161 (size=0x23)( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd6d184 (size=0xbc)( - VOID -); - -EFI_STATUS -EFIAPI -int v2; // eax( - VOID -); - -EFI_STATUS -EFIAPI -int v5; // eax( - VOID -); - -EFI_STATUS -EFIAPI -int v7; // [esp+0h] [ebp-4h]( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd6d240 (size=0x13)( - VOID -); - -EFI_STATUS -EFIAPI -v0 = PeiServicesGetBootMode();( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd6d253 (size=0x23)( - VOID -); - -EFI_STATUS -EFIAPI -v6 = PeiServicesGetBootMode();( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd6d276 (size=0x1f)( - VOID -); - -EFI_STATUS -EFIAPI -v5 = PeiServicesGetBootMode();( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd6d295 (size=0x1f)( - VOID -); - -EFI_STATUS -EFIAPI -int v3; // esi( - VOID -); - -EFI_STATUS -EFIAPI -v3 = v2;( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd6d2b4 (size=0x31)( - VOID -); - -EFI_STATUS -EFIAPI -int v2; // [esp+0h] [ebp-8h] BYREF( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd6d2e5 (size=0x2a)( - VOID -); - -EFI_STATUS -EFIAPI -int (__cdecl **v3)(int, const char *, char *); // esi( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd6d30f (size=0x1e)( - VOID -); - -EFI_STATUS -EFIAPI -result = DebugAssert();( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd6d32d (size=0x4f)( - VOID -); - -EFI_STATUS -EFIAPI -int n0x400000; // edi( - VOID -); - -EFI_STATUS -EFIAPI -int result; // eax( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd6d37c (size=0x47)( - VOID -); - -EFI_STATUS -EFIAPI -unsigned __int64 v3; // rtt( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd6d3c3 (size=0x215)( - VOID -); - -EFI_STATUS -EFIAPI -int n16464; // edx( - VOID -); - -EFI_STATUS -EFIAPI -unsigned __int8 *v5; // esi( - VOID -); - -EFI_STATUS -EFIAPI -_BYTE *v7; // ebx( - VOID -); - -EFI_STATUS -EFIAPI -unsigned int v9; // ecx( - VOID -); - -EFI_STATUS -EFIAPI -_DWORD *v11; // eax( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd6d5d8 (size=0xa1)( - VOID -); - -EFI_STATUS -EFIAPI -int v3; // eax( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd6d679 (size=0x1a9)( - VOID -); - -EFI_STATUS -EFIAPI -int v1; // edi( - VOID -); - -EFI_STATUS -EFIAPI -int v5; // esi( - VOID -); - -EFI_STATUS -EFIAPI -int v7; // eax( - VOID -); - -EFI_STATUS -EFIAPI -int v9; // eax( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd6d822 (size=0x3d2)( - VOID -); - -EFI_STATUS -EFIAPI -_WORD *v7; // eax( - VOID -); - -EFI_STATUS -EFIAPI -int v11; // eax( - VOID -); - -EFI_STATUS -EFIAPI -int v13; // eax( - VOID -); - -EFI_STATUS -EFIAPI -int v15; // eax( - VOID -); - -EFI_STATUS -EFIAPI -int v17; // eax( - VOID -); - -EFI_STATUS -EFIAPI -int v19; // esi( - VOID -); - -EFI_STATUS -EFIAPI -int v21; // eax( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd6dbf4 (size=0x8f)( - VOID -); - -EFI_STATUS -EFIAPI -int v3; // edi( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd6dc83 (size=0x289)( - VOID -); - -EFI_STATUS -EFIAPI -int v4; // eax( - VOID -); - -EFI_STATUS -EFIAPI -int v6; // esi( - VOID -); - -EFI_STATUS -EFIAPI -unsigned int v8; // ecx( - VOID -); - -EFI_STATUS -EFIAPI -bool v10; // cc( - VOID -); - -EFI_STATUS -EFIAPI -unsigned int v12; // ebp( - VOID -); - -EFI_STATUS -EFIAPI -int v14; // eax( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd6fd63 (size=0x206)( - VOID -); - -EFI_STATUS -EFIAPI -int v1; // esi( - VOID -); - -EFI_STATUS -EFIAPI -unsigned __int8 v5; // bl( - VOID -); - -EFI_STATUS -EFIAPI -int n94; // eax( - VOID -); - -EFI_STATUS -EFIAPI -char v9; // bl( - VOID -); - -EFI_STATUS -EFIAPI -char v11; // al( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd705f9 (size=0xd7)( - VOID -); - -EFI_STATUS -EFIAPI -int v7; // edx( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd7161c (size=0xd1)( - VOID -); - -EFI_STATUS -EFIAPI -int v1; // eax( - VOID -); - -EFI_STATUS -EFIAPI -int v8; // [esp+10h] [ebp-4h] BYREF( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd716ed (size=0x4f)( - VOID -); - -EFI_STATUS -EFIAPI -char n3; // al( - VOID -); - -EFI_STATUS -EFIAPI -v0 = __inbyte(0x70u);( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd7173c (size=0x32)( - VOID -); - -EFI_STATUS -EFIAPI -_BYTE v2[8]; // [esp+4h] [ebp-8h] BYREF( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd7176e (size=0x180)( - VOID -); - -EFI_STATUS -EFIAPI -int v9; // ebp( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd718ee (size=0x2a)( - VOID -); - -EFI_STATUS -EFIAPI -int v4; // [esp+4h] [ebp-4h] BYREF( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd71918 (size=0x1c)( - VOID -); - -EFI_STATUS -EFIAPI -result = sub_FFD718EE(this);( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd71934 (size=0x6e)( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd719a2 (size=0x45)( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd719e7 (size=0x3a)( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd71a21 (size=0x41)( - VOID -); - -EFI_STATUS -EFIAPI -int n3_1; // [esp+0h] [ebp-4h] BYREF( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd71a62 (size=0x6e)( - VOID -); - -EFI_STATUS -EFIAPI -int v7; // esi( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd71ad0 (size=0x4e)( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd71b1e (size=0x78)( - VOID -); - -EFI_STATUS -EFIAPI -if ( (a1 & 0xFFF) != 0 )( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd71b96 (size=0x1f)( - VOID -); - -EFI_STATUS -EFIAPI -return sub_FFD71BB5(v5, 19, a1, a2, 0, a4, a5, 19);( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd71bb5 (size=0x15a)( - VOID -); - -EFI_STATUS -EFIAPI -int v10; // esi( - VOID -); - -EFI_STATUS -EFIAPI -int n0xFFFFFFF_1; // ebp( - VOID -); - -EFI_STATUS -EFIAPI -char v14; // al( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd71d0f (size=0x30)( - VOID -); - -EFI_STATUS -EFIAPI -__int64 v5; // rax( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd71d3f (size=0x5f)( - VOID -); - -EFI_STATUS -EFIAPI -int v5; // ebp( - VOID -); - -EFI_STATUS -EFIAPI -int v7; // edi( - VOID -); - -EFI_STATUS -EFIAPI -__int64 v9; // rax( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd726d8 (size=0x59)( - VOID -); - -EFI_STATUS -EFIAPI -v0 = sub_FFD719E7(&unk_FFD7ACE4);( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd72fb4 (size=0xec)( - VOID -); - -EFI_STATUS -EFIAPI -int n3; // esi( - VOID -); - -EFI_STATUS -EFIAPI -unsigned __int16 n0xA1C0; // ax( - VOID -); - -EFI_STATUS -EFIAPI -n3_1 = n3;( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd730a0 (size=0xa9)( - VOID -); - -EFI_STATUS -EFIAPI -int n2; // esi( - VOID -); - -EFI_STATUS -EFIAPI -n2_1 = n2;( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd73149 (size=0x1c)( - VOID -); - -EFI_STATUS -EFIAPI -v0 = sub_FFD72FB4() - 1;( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd73165 (size=0x1c)( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd73181 (size=0x2d)( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd731ae (size=0x9b)( - VOID -); - -EFI_STATUS -EFIAPI -int v4; // edi( - VOID -); - -EFI_STATUS -EFIAPI -if ( this )( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd73249 (size=0x92)( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd732db (size=0x56)( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd73331 (size=0x3f)( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd73370 (size=0x1b)( - VOID -); - -EFI_STATUS -EFIAPI -v4 = sub_FFD733C6(a1);( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd7338b (size=0x1b)( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd733a6 (size=0x20)( - VOID -); - -EFI_STATUS -EFIAPI -v5 = sub_FFD733C6(a1);( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd733c6 (size=0x2e)( - VOID -); - -EFI_STATUS -EFIAPI -if ( ((unsigned __int8)a1 & 1) != 0 )( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd733f4 (size=0x33)( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd73427 (size=0x35)( - VOID -); - -EFI_STATUS -EFIAPI -if ( (a1 & 1) != 0 )( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd7345c (size=0x2c)( - VOID -); - -EFI_STATUS -EFIAPI -if ( (a1 & 3) != 0 )( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd73488 (size=0x32)( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd734ba (size=0x27)( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd734e1 (size=0x23)( - VOID -); - -EFI_STATUS -EFIAPI -if ( !this )( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd73504 (size=0x27)( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd7352b (size=0x29)( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd741d1 (size=0x50)( - VOID -); - -EFI_STATUS -EFIAPI -bool n7; // [esp+7h] [ebp-1h] BYREF( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd74221 (size=0x91)( - VOID -); - -EFI_STATUS -EFIAPI -unsigned int v5; // ecx( - VOID -); - -EFI_STATUS -EFIAPI -_DWORD v7[2]; // [esp+4h] [ebp-10h]( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd742b2 (size=0x4f)( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd74301 (size=0x9e)( - VOID -); - -EFI_STATUS -EFIAPI -unsigned int v1; // esi( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd7439f (size=0x50)( - VOID -); - -EFI_STATUS -EFIAPI -unsigned __int8 v6; // bl( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd743ef (size=0x12)( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd74e7b (size=0x1e)( - VOID -); - -EFI_STATUS -EFIAPI -v4 = sub_FFD7620D(a3) + (*a3 & 0xFFFFFFF);( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd74e99 (size=0x58)( - VOID -); - -EFI_STATUS -EFIAPI -void *this_1; // [esp+0h] [ebp-4h]( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd74ef1 (size=0xf)( - VOID -); - -EFI_STATUS -EFIAPI -v2 = (int (__cdecl **)(void *))sub_FFD74E99(this);( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd74f00 (size=0xf)( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd74f0f (size=0xc)( - VOID -); - -EFI_STATUS -EFIAPI -v0 = sub_FFD74E99();( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd74f1b (size=0x30)( - VOID -); - -EFI_STATUS -EFIAPI -if ( (n1024068 & 0xF0000000) != 0 )( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd74f4b (size=0x16)( - VOID -); - -EFI_STATUS -EFIAPI -v0 = sub_FFD74F0F();( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd74f61 (size=0x58)( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd74fb9 (size=0x1cf)( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd75188 (size=0xfc)( - VOID -); - -EFI_STATUS -EFIAPI -int v5; // [esp-4h] [ebp-Ch]( - VOID -); - -EFI_STATUS -EFIAPI -@ 0xffd75284 (size=0x4e)( - VOID -); - -EFI_STATUS -EFIAPI -char **v1; // eax( - VOID -); - -#endif /* __SIINIT_H__ */ +#endif diff --git a/PurleySktPkg/SouthClusterLbg/SiInit/Pei/SiInitPreMem/PchPreMemInit.c b/PurleySktPkg/SouthClusterLbg/SiInit/Pei/SiInitPreMem/PchPreMemInit.c index 9eb430f..bea946f 100644 --- a/PurleySktPkg/SouthClusterLbg/SiInit/Pei/SiInitPreMem/PchPreMemInit.c +++ b/PurleySktPkg/SouthClusterLbg/SiInit/Pei/SiInitPreMem/PchPreMemInit.c @@ -215,7 +215,7 @@ } /* Source: ffd806ac.c */ -int __thiscall sub_FFD806AC(char *this) +int __thiscall PchOnPolicyInstalled(char *this) { char *this_1; // ebx unsigned int v2; // ebp @@ -270,7 +270,7 @@ /* Source: ffd80796.c */ // positive sp value has been detected, the output may be wrong! -int __thiscall sub_FFD80796(int this) +int __thiscall XhciUsb3Tune(int this) { int v2; // ebx int v3; // esi diff --git a/UefiCpuPkg/PiSmmCommunication/PiSmmCommunicationPei/PiSmmCommunicationPei.c b/UefiCpuPkg/PiSmmCommunication/PiSmmCommunicationPei/PiSmmCommunicationPei.c index d5ead01..b5e40b9 100644 --- a/UefiCpuPkg/PiSmmCommunication/PiSmmCommunicationPei/PiSmmCommunicationPei.c +++ b/UefiCpuPkg/PiSmmCommunication/PiSmmCommunicationPei/PiSmmCommunicationPei.c @@ -1,7 +1,7 @@ #include #include -void *internal_memcpy(char *dst, char *src, unsigned int count) +void *CopyMem(char *dst, char *src, unsigned int count) { unsigned int count_1; char *dst_1; @@ -22,7 +22,7 @@ return dst; } -void *internal_memset(void *buf, unsigned int count, char value) +void *SetMem(void *buf, unsigned int count, char value) { memset(buf, value, count); return buf; @@ -38,7 +38,7 @@ return a1; } -void *sub_FFE329A0(void *buf, unsigned int count, int value) +void *SetMem32(void *buf, unsigned int count, int value) { memset32(buf, value, count); return buf; @@ -64,8 +64,8 @@ v3 = v2; if (0) { - sub_FFE32DD6(64, "InitCommunicationContext - SmmConfigurationTable: %x\n", v2[23]); - sub_FFE32DD6(64, "InitCommunicationContext - NumberOfTableEntries: %x\n", v3[22]); + DebugPrint(64, "InitCommunicationContext - SmmConfigurationTable: %x\n", v2[23]); + DebugPrint(64, "InitCommunicationContext - NumberOfTableEntries: %x\n", v3[22]); v10 = v3[22]; i_1 = v3[23]; v11 = 0; @@ -80,8 +80,8 @@ return 0; } - sub_FFE32DD6(64, "InitCommunicationContext - SmmConfigurationTable: %x\n", v2[40]); - sub_FFE32DD6(64, "InitCommunicationContext - NumberOfTableEntries: %x\n", v3[38]); + DebugPrint(64, "InitCommunicationContext - SmmConfigurationTable: %x\n", v2[40]); + DebugPrint(64, "InitCommunicationContext - NumberOfTableEntries: %x\n", v3[38]); v4 = v3[38]; i_1 = v3[40]; v6 = 0; @@ -116,8 +116,8 @@ "GuidHob != ((void *) 0)"); } p_n1397574995 = (int *)*((_DWORD *)v0 + 8); - sub_FFE32DD6(64, "InitCommunicationContext - SmmS3ResumeState: %x\n", p_n1397574995); - sub_FFE32DD6(64, "InitCommunicationContext - Smst: %x\n", *(int *)((char *)p_n1397574995 + 90)); + DebugPrint(64, "InitCommunicationContext - SmmS3ResumeState: %x\n", p_n1397574995); + DebugPrint(64, "InitCommunicationContext - Smst: %x\n", *(int *)((char *)p_n1397574995 + 90)); src = (char *)sub_FFE329BA(*p_n1397574995, p_n1397574995[1]); if (!src) { v5 = sub_FFE32DA5(); @@ -156,7 +156,7 @@ int v15; int v16; - sub_FFE32DD6(64, "PiSmmCommunicationPei Communicate Enter\n"); + DebugPrint(64, "PiSmmCommunicationPei Communicate Enter\n"); if (!a2) return -2147483646; v3 = sub_FFE330D1(); @@ -167,7 +167,7 @@ if ((*(int (**)(int, void *, _DWORD, _DWORD, int *))(*(_DWORD *)v4 + 32))(v4, &unk_FFE33780, 0, 0, &v15) < 0) return -2147483629; if (!*(_BYTE *)(v15 + 16)) { - sub_FFE32DD6(64, "PiSmmCommunicationPei LockState - %x\n", 0); + DebugPrint(64, "PiSmmCommunicationPei LockState - %x\n", 0); return -2147483629; } v5 = sub_FFE32ED1(&unk_FFE337C0); @@ -179,7 +179,7 @@ 155, "GuidHob != ((void *) 0)"); } - sub_FFE32DD6( + DebugPrint( 64, "PiSmmCommunicationPei BufferPtrAddress - 0x%016lx, BufferPtr: 0x%016lx\n", *((_DWORD *)v5 + 8), @@ -187,14 +187,14 @@ v7 = (_DWORD *)*((_DWORD *)v5 + 8); *v7 = a2; v7[1] = 0; - sub_FFE32DD6(64, "PiSmmCommunicationPei CommBuffer - %x\n", a2); + DebugPrint(64, "PiSmmCommunicationPei CommBuffer - %x\n", a2); v13 = *((_BYTE *)v5 + 28); v16 = 1; v12 = v14; v8 = sub_FFE330D1(); v9 = (*v14)(v8, v12, &v13, &v16, 0, 0); if (v9 < 0) { - sub_FFE32DD6(0x80000000, "\nASSERT_EFI_ERROR (Status = %r)\n", v9); + DebugPrint(0x80000000, "\nASSERT_EFI_ERROR (Status = %r)\n", v9); v10 = sub_FFE32DA5(); if (v10) (*(void (**)(const char *, int, const char *))(v10 + 4))( @@ -205,7 +205,7 @@ v11 = (_DWORD *)*((_DWORD *)v5 + 8); *v11 = 0; v11[1] = 0; - sub_FFE32DD6(64, "PiSmmCommunicationPei Communicate Exit\n"); + DebugPrint(64, "PiSmmCommunicationPei Communicate Exit\n"); return 0; } @@ -228,7 +228,7 @@ v0 = sub_FFE330D1(); v1 = (*(int (**)(int, int *))(*(_DWORD *)v0 + 40))(v0, &n17); if (v1 < 0) { - sub_FFE32DD6(0x80000000, "\nASSERT_EFI_ERROR (Status = %r)\n", v1); + DebugPrint(0x80000000, "\nASSERT_EFI_ERROR (Status = %r)\n", v1); v2 = sub_FFE32DA5(); if (v2) (*(void (**)(const char *, int, const char *))(v2 + 4))( @@ -245,7 +245,7 @@ v6 = v13; v7 = *(_BYTE *)(v13 + 16); if (v7) { - sub_FFE32DD6(64, "PiSmmCommunicationPei LockState - %x\n", v7); + DebugPrint(64, "PiSmmCommunicationPei LockState - %x\n", v7); return -2147483633; } while (1) { diff --git a/UefiCpuPkg/PiSmmCommunication/PiSmmCommunicationPei/PiSmmCommunicationPei.h b/UefiCpuPkg/PiSmmCommunication/PiSmmCommunicationPei/PiSmmCommunicationPei.h index bca813c..f0ad85f 100644 --- a/UefiCpuPkg/PiSmmCommunication/PiSmmCommunicationPei/PiSmmCommunicationPei.h +++ b/UefiCpuPkg/PiSmmCommunication/PiSmmCommunicationPei/PiSmmCommunicationPei.h @@ -1,166 +1,9 @@ -/** @file - PiSmmCommunicationPei.h -- Header for PiSmmCommunicationPei - -Copyright (c) HR650X BIOS Decompilation Project -**/ - #ifndef __PISMMCOMMUNICATIONPEI__H__ #define __PISMMCOMMUNICATIONPEI__H__ #include "../uefi_headers/Uefi.h" -// -// Function Prototypes -// - -EFI_STATUS -EFIAPI -internal_memcpy( - VOID -); - -EFI_STATUS -EFIAPI -internal_memset( - VOID -); - -EFI_STATUS -EFIAPI -fn_addr( - VOID -); - -EFI_STATUS -EFIAPI -sub_FFE329A0( - VOID -); - -EFI_STATUS -EFIAPI -_ModuleEntryPoint( - VOID -); - -EFI_STATUS -EFIAPI -sub_FFE329BA( - VOID -); - -EFI_STATUS -EFIAPI -sub_FFE32A96( - VOID -); - -EFI_STATUS -EFIAPI -sub_FFE32B5C( - VOID -); - -EFI_STATUS -EFIAPI -_ModuleEntryPoint_0( - VOID -); - -EFI_STATUS -EFIAPI -sub_FFE32DA5( - VOID -); - -EFI_STATUS -EFIAPI -sub_FFE32DD6( - VOID -); - -EFI_STATUS -EFIAPI -sub_FFE32E00( - VOID -); - -EFI_STATUS -EFIAPI -sub_FFE32E1E( - VOID -); - -EFI_STATUS -EFIAPI -sub_FFE32E8C( - VOID -); - -EFI_STATUS -EFIAPI -sub_FFE32ED1( - VOID -); - -EFI_STATUS -EFIAPI -sub_FFE32F04( - VOID -); - -EFI_STATUS -EFIAPI -sub_FFE32F54( - VOID -); - -EFI_STATUS -EFIAPI -sub_FFE32F72( - VOID -); - -EFI_STATUS -EFIAPI -sub_FFE32FE1( - VOID -); - -EFI_STATUS -EFIAPI -sub_FFE33012( - VOID -); - -EFI_STATUS -EFIAPI -sub_FFE33071( - VOID -); - -EFI_STATUS -EFIAPI -sub_FFE3309D( - VOID -); - -EFI_STATUS -EFIAPI -sub_FFE330D1( - VOID -); - -EFI_STATUS -EFIAPI -sub_FFE33103( - VOID -); - -EFI_STATUS -EFIAPI -sub_FFE33152( - VOID -); +EFI_STATUS EFIAPI PiSmmCommunicationPeiModuleEntryPoint(VOID); +EFI_STATUS EFIAPI PiSmmCommunicationPeiCommunicate(INTN CommunicateSize, INTN CommunicateBuffer); #endif /* __PISMMCOMMUNICATIONPEI__H__ */