📄 aclink.cod
字号:
00010 03a00000 moveq r0, #0
; 94 : }
00014 049de004 ldreq lr, [sp], #4
; 91 : }
; 92 :
; 93 : return(TRUE);
00018 13a00001 movne r0, #1
; 94 : }
0001c 149de004 ldrne lr, [sp], #4
00020 e12fff1e bx lr
00024 |$M40084|
ENDP ; |DeInitializeACLink|
EXPORT |AllocateACLinkResources|
EXPORT |??_C@_1BO@FPLGOPGM@?$AAA?$AAC?$AAL?$AAI?$AAN?$AAK?$AA_?$AAC?$AAO?$AAN?$AAT?$AAR?$AAO?$AAL?$AA?$AA@| [ DATA ] ; `string'
EXPORT |??_C@_1CC@GPDNOKBH@?$AAA?$AAC?$AA9?$AA7?$AA_?$AAS?$AAH?$AAA?$AAR?$AAE?$AAD?$AA_?$AAF?$AAI?$AAL?$AAE?$AA?$AA@| [ DATA ] ; `string'
IMPORT |MmMapIoSpace|
IMPORT |CreateMutexW|
IMPORT |MapViewOfFile|
IMPORT |CreateFileMappingW|
IMPORT |GetLastError|
00000 AREA |.text| { |AllocateACLinkResources| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 AREA |.pdata$$AllocateACLinkResources|, PDATA, SELECTION=5, ASSOC=|.text| { |AllocateACLinkResources| } ; comdat associative
|$T40110| DCD |$L40109|
DCD 0x40007f02
00000 AREA |.rdata| { |??_C@_1CC@GPDNOKBH@?$AAA?$AAC?$AA9?$AA7?$AA_?$AAS?$AAH?$AAA?$AAR?$AAE?$AAD?$AA_?$AAF?$AAI?$AAL?$AAE?$AA?$AA@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_1CC@GPDNOKBH@?$AAA?$AAC?$AA9?$AA7?$AA_?$AAS?$AAH?$AAA?$AAR?$AAE?$AAD?$AA_?$AAF?$AAI?$AAL?$AAE?$AA?$AA@| DCB "A"
DCB 0x0, "C", 0x0, "9", 0x0, "7", 0x0, "_", 0x0, "S", 0x0, "H"
DCB 0x0, "A", 0x0, "R", 0x0, "E", 0x0, "D", 0x0, "_", 0x0, "F"
DCB 0x0, "I", 0x0, "L", 0x0, "E", 0x0, 0x0, 0x0 ; `string'
00000 AREA |.rdata| { |??_C@_1BO@FPLGOPGM@?$AAA?$AAC?$AAL?$AAI?$AAN?$AAK?$AA_?$AAC?$AAO?$AAN?$AAT?$AAR?$AAO?$AAL?$AA?$AA@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_1BO@FPLGOPGM@?$AAA?$AAC?$AAL?$AAI?$AAN?$AAK?$AA_?$AAC?$AAO?$AAN?$AAT?$AAR?$AAO?$AAL?$AA?$AA@| DCB "A"
DCB 0x0, "C", 0x0, "L", 0x0, "I", 0x0, "N", 0x0, "K", 0x0, "_"
DCB 0x0, "C", 0x0, "O", 0x0, "N", 0x0, "T", 0x0, "R", 0x0, "O"
DCB 0x0, "L", 0x0, 0x0, 0x0 ; `string'
; Function compile flags: /Ogsy
00000 AREA |.text| { |AllocateACLinkResources| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 |AllocateACLinkResources| PROC
; 97 : {
00000 |$L40109|
00000 e92d41f0 stmdb sp!, {r4 - r8, lr}
00004 e24dd008 sub sp, sp, #8
00008 |$M40107|
00008 e1a07000 mov r7, r0
; 98 : PHYSICAL_ADDRESS RegPA;
; 99 :
; 100 : if (g_pICRegs == NULL)
0000c e59f41e4 ldr r4, [pc, #0x1E4]
00010 e5943010 ldr r3, [r4, #0x10]
00014 e3530000 cmp r3, #0
00018 1a000006 bne |$L39792|
; 101 : {
; 102 : RegPA.QuadPart = BULVERDE_BASE_REG_PA_INTC;
0001c e3a00101 mov r0, #1, 2
00020 e380060d orr r0, r0, #0xD, 12
00024 e3a01000 mov r1, #0
; 103 : g_pICRegs = (volatile BULVERDE_INTR_REG *) MmMapIoSpace(RegPA, 0x400, FALSE);
00028 e3a03000 mov r3, #0
0002c e3a02b01 mov r2, #1, 22
00030 eb000000 bl MmMapIoSpace
00034 e5840010 str r0, [r4, #0x10]
00038 |$L39792|
; 104 : }
; 105 :
; 106 : if (g_pAc97Regs == NULL)
00038 e5943018 ldr r3, [r4, #0x18]
0003c e3530000 cmp r3, #0
00040 1a000006 bne |$L39795|
; 107 : {
; 108 : RegPA.QuadPart = BULVERDE_BASE_REG_PA_AC97;
00044 e3a00101 mov r0, #1, 2
00048 e3800605 orr r0, r0, #5, 12
0004c e3a01000 mov r1, #0
; 109 : g_pAc97Regs = (volatile BULVERDE_AC97_REG *) MmMapIoSpace(RegPA, 0x400, FALSE);
00050 e3a03000 mov r3, #0
00054 e3a02b01 mov r2, #1, 22
00058 eb000000 bl MmMapIoSpace
0005c e5840018 str r0, [r4, #0x18]
00060 |$L39795|
; 110 : }
; 111 :
; 112 : if (g_pClockRegs == NULL)
00060 e5943008 ldr r3, [r4, #8]
00064 e3530000 cmp r3, #0
00068 1a000006 bne |$L39798|
; 113 : {
; 114 : RegPA.QuadPart = BULVERDE_BASE_REG_PA_CLKMGR;
0006c e3a00441 mov r0, #0x41, 8
00070 e3800603 orr r0, r0, #3, 12
00074 e3a01000 mov r1, #0
; 115 : g_pClockRegs = (volatile BULVERDE_CLKMGR_REG *) MmMapIoSpace(RegPA, 0x400, FALSE);
00078 e3a03000 mov r3, #0
0007c e3a02b01 mov r2, #1, 22
00080 eb000000 bl MmMapIoSpace
00084 e5840008 str r0, [r4, #8]
00088 |$L39798|
; 116 : }
; 117 :
; 118 : if (g_pGPIORegs == NULL)
00088 e594300c ldr r3, [r4, #0xC]
0008c e3530000 cmp r3, #0
00090 1a000006 bne |$L39801|
; 119 : {
; 120 : RegPA.QuadPart = BULVERDE_BASE_REG_PA_GPIO;
00094 e3a00101 mov r0, #1, 2
00098 e380060e orr r0, r0, #0xE, 12
0009c e3a01000 mov r1, #0
; 121 : g_pGPIORegs = (volatile BULVERDE_GPIO_REG *) MmMapIoSpace(RegPA, 0x400, FALSE);
000a0 e3a03000 mov r3, #0
000a4 e3a02b01 mov r2, #1, 22
000a8 eb000000 bl MmMapIoSpace
000ac e584000c str r0, [r4, #0xC]
000b0 |$L39801|
; 122 : }
; 123 :
; 124 : if (g_pOSTRegs == NULL)
000b0 e5943014 ldr r3, [r4, #0x14]
000b4 e3530000 cmp r3, #0
000b8 1a000006 bne |$L39804|
; 125 : {
; 126 : RegPA.QuadPart = BULVERDE_BASE_REG_PA_OST;
000bc e3a00101 mov r0, #1, 2
000c0 e380060a orr r0, r0, #0xA, 12
000c4 e3a01000 mov r1, #0
; 127 : g_pOSTRegs = (volatile BULVERDE_OST_REG *) MmMapIoSpace(RegPA, 0x400, FALSE);
000c8 e3a03000 mov r3, #0
000cc e3a02b01 mov r2, #1, 22
000d0 eb000000 bl MmMapIoSpace
000d4 e5840014 str r0, [r4, #0x14]
000d8 |$L39804|
; 128 : }
; 129 :
; 130 : if (hACLinkControlMutex == NULL)
000d8 e594301c ldr r3, [r4, #0x1C]
000dc e3530000 cmp r3, #0
000e0 1a000004 bne |$L39807|
; 131 : {
; 132 : hACLinkControlMutex = CreateMutex(NULL, FALSE, ACLINK_MUTEX_NAME);
000e4 e59f2108 ldr r2, [pc, #0x108]
000e8 e3a01000 mov r1, #0
000ec e3a00000 mov r0, #0
000f0 eb000000 bl CreateMutexW
000f4 e584001c str r0, [r4, #0x1C]
000f8 |$L39807|
; 133 : }
; 134 :
; 135 : if (NULL == g_pAc97Shared)
000f8 e5942000 ldr r2, [r4]
000fc e3520000 cmp r2, #0
00100 1a000020 bne |$L40092|
; 136 : {
; 137 : HANDLE hShareMap;
; 138 : DWORD dwError;
; 139 : hShareMap = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE,
; 140 : 0, sizeof(AC97_GLOBALS), AC97_SHARED_FILENAME );
00104 e59f20e4 ldr r2, [pc, #0xE4]
00108 e3a0e008 mov lr, #8
0010c e3a03000 mov r3, #0
00110 e58d2004 str r2, [sp, #4]
00114 e3a02004 mov r2, #4
00118 e3a01000 mov r1, #0
0011c e3e00000 mvn r0, #0
00120 e58de000 str lr, [sp]
00124 eb000000 bl CreateFileMappingW
00128 e1a06000 mov r6, r0
; 141 : dwError = GetLastError();
0012c eb000000 bl GetLastError
00130 e1b05000 movs r5, r0
00134 e3a08000 mov r8, #0
; 142 : if((0 == dwError) || (ERROR_ALREADY_EXISTS == dwError))
00138 0a000001 beq |$L39819|
0013c e35500b7 cmp r5, #0xB7
00140 1a00000a bne |$L39818|
00144 |$L39819|
; 143 : {
; 144 : // Get a valid process pointer to the buffer mapped above.
; 145 : g_pAc97Shared = (volatile AC97_GLOBALS *)MapViewOfFile( hShareMap, FILE_MAP_ALL_ACCESS, 0, 0, 0 );
00144 e3a0180f mov r1, #0xF, 16
00148 e381101f orr r1, r1, #0x1F
0014c e3a03000 mov r3, #0
00150 e3a02000 mov r2, #0
00154 e1a00006 mov r0, r6
00158 e58d8000 str r8, [sp]
0015c eb000000 bl MapViewOfFile
00160 e1a03000 mov r3, r0
; 146 : //handle is not needed because mapped view has an internal open handle to the object
; 147 : CloseHandle(hShareMap);
00164 e1a00006 mov r0, r6
00168 e5843000 str r3, [r4]
0016c eb000000 bl CloseHandle
00170 |$L39818|
; 148 : }
; 149 : if ((0 == dwError) && (g_pAc97Shared))
00170 e5942000 ldr r2, [r4]
00174 e3550000 cmp r5, #0
00178 1a000002 bne |$L40092|
0017c e3520000 cmp r2, #0
; 150 : {//touch driver is the first to create file mapping. Initialize it.
; 151 : g_pAc97Shared->acLinkTouchInit = FALSE;
00180 15828000 strne r8, [r2]
; 152 : g_pAc97Shared->acLinkAudioInit = FALSE;
00184 15828004 strne r8, [r2, #4]
00188 |$L40092|
00188 e5943010 ldr r3, [r4, #0x10]
; 153 : }
; 154 : }
; 155 :
; 156 : if (!g_pICRegs || !g_pAc97Regs || !g_pClockRegs || !g_pGPIORegs || !g_pOSTRegs || !hACLinkControlMutex
; 157 : || !g_pAc97Shared)
0018c e3530000 cmp r3, #0
00190 0a000010 beq |$L39823|
00194 e5943018 ldr r3, [r4, #0x18]
00198 e3530000 cmp r3, #0
0019c 0a00000d beq |$L39823|
001a0 e5943008 ldr r3, [r4, #8]
001a4 e3530000 cmp r3, #0
001a8 0a00000a beq |$L39823|
001ac e594300c ldr r3, [r4, #0xC]
001b0 e3530000 cmp r3, #0
001b4 0a000007 beq |$L39823|
001b8 e5943014 ldr r3, [r4, #0x14]
001bc e3530000 cmp r3, #0
001c0 0a000004 beq |$L39823|
001c4 e594301c ldr r3, [r4, #0x1C]
001c8 e3530000 cmp r3, #0
001cc 13520000 cmpne r2, #0
; 162 : }
; 163 :
; 164 : return(TRUE);
001d0 13a00001 movne r0, #1
001d4 1a000002 bne |$L39789|
001d8 |$L39823|
; 158 : {
; 159 : DEBUGMSG(TRUE, (TEXT("ERROR: Failed to allocate AC Link resources.\r\n")));
; 160 : DeAllocateACLinkResources(DevId);
001d8 e1a00007 mov r0, r7
001dc eb000000 bl DeAllocateACLinkResources
; 161 : return(FALSE);
001e0 e3a00000 mov r0, #0
001e4 |$L39789|
; 165 : }
001e4 e28dd008 add sp, sp, #8
001e8 e8bd41f0 ldmia sp!, {r4 - r8, lr}
001ec e12fff1e bx lr
001f0 |$L40112|
001f0 00000000 DCD |??_C@_1CC@GPDNOKBH@?$AAA?$AAC?$AA9?$AA7?$AA_?$AAS?$AAH?$AAA?$AAR?$AAE?$AAD?$AA_?$AAF?$AAI?$AAL?$AAE?$AA?$AA@|
001f4 00000000 DCD |??_C@_1BO@FPLGOPGM@?$AAA?$AAC?$AAL?$AAI?$AAN?$AAK?$AA_?$AAC?$AAO?$AAN?$AAT?$AAR?$AAO?$AAL?$AA?$AA@|
001f8 00000000 DCD |g_pAc97Shared|
001fc |$M40108|
ENDP ; |AllocateACLinkResources|
EXPORT |InitializeACLink|
EXPORT |??_C@_1GM@JICIEKCM@?$AA$?$AA$?$AA$?$AA?5?$AA?5?$AA?5?$AA$?$AA$?$AA$?$AA?5?$AA?5?$AA?5?$AA$?$AA$?$AA$?$AA?5?$AA?5?$AA?5?$AA?5?$AAI@| [ DATA ] ; `string'
IMPORT |XllpOstDelayMicroSeconds|
00000 AREA |.text| { |InitializeACLink| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 AREA |.pdata$$InitializeACLink|, PDATA, SELECTION=5, ASSOC=|.text| { |InitializeACLink| } ; comdat associative
|$T40122| DCD |$L40121|
DCD 0x40002401
00000 AREA |.rdata| { |??_C@_1GM@JICIEKCM@?$AA$?$AA$?$AA$?$AA?5?$AA?5?$AA?5?$AA$?$AA$?$AA$?$AA?5?$AA?5?$AA?5?$AA$?$AA$?$AA$?$AA?5?$AA?5?$AA?5?$AA?5?$AAI@| }, DATA, READONLY, SELECTION=2 ; comdat any
|??_C@_1GM@JICIEKCM@?$AA$?$AA$?$AA$?$AA?5?$AA?5?$AA?5?$AA$?$AA$?$AA$?$AA?5?$AA?5?$AA?5?$AA$?$AA$?$AA$?$AA?5?$AA?5?$AA?5?$AA?5?$AAI@| DCB "$$"
DCB 0x0, "$$", 0x0, "$$", 0x0, " ", 0x0, " ", 0x0, " ", 0x0, "$$"
DCB 0x0, "$$", 0x0, "$$", 0x0, " ", 0x0, " ", 0x0, " ", 0x0, "$$"
DCB 0x0, "$$", 0x0, "$$", 0x0, " ", 0x0, " ", 0x0, " ", 0x0, " "
DCB 0x0, "I", 0x0, "n", 0x0, "i", 0x0, "t", 0x0, "i", 0x0, "a"
DCB 0x0, "l", 0x0, "i", 0x0, "z", 0x0, "e", 0x0, "A", 0x0, "C"
DCB 0x0, "L", 0x0, "i", 0x0, "n", 0x0, "k", 0x0, " ", 0x0, " "
DCB 0x0, " ", 0x0, "s", 0x0, "t", 0x0, "a", 0x0, "t", 0x0, "u"
DCB 0x0, "s", 0x0, ":", 0x0, " ", 0x0, "%", 0x0, "x", 0x0, "."
DCB 0x0, ".", 0x0, ".", 0x0, 0xd, 0x0, 0xa, 0x0, 0x0, 0x0 ; `string'
; Function compile flags: /Ogsy
00000 AREA |.text| { |InitializeACLink| }, CODE, ARM, SELECTION=1 ; comdat noduplicate
00000 |InitializeACLink| PROC
; 51 : {
00000 |$L40121|
00000 e92d4030 stmdb sp!, {r4, r5, lr}
00004 |$M40119|
00004 e1a04001 mov r4, r1
; 52 :
; 53 : // Allocate AC link control resources.
; 54 : //
; 55 : //NKDbgPrintfW(TEXT("before AllocateACLinkResources\r\n"));
; 56 : NKDbgPrintfW(TEXT("$$$ $$$ $$$ InitializeACLink status: %x...\r\n"));
00008 e59f007c ldr r0, [pc, #0x7C]
0000c eb000000 bl NKDbgPrintfW
; 57 :
; 58 : if (!AllocateACLinkResources(DevId))
00010 e1a00004 mov r0, r4
00014 eb000000 bl AllocateACLinkResources
00018 e3500000 cmp r0, #0
; 59 : {
; 60 : return(FALSE);
0001c 0a000013 beq |$L40118|
; 61 : }
; 62 : //NKDbgPrintfW(TEXT("after AllocateACLinkResources\r\n"));
; 63 : // Data structure used by XLLP routines.
; 64 : //
; 65 : g_AC97CtxStruct.pGpioReg = (P_XLLP_GPIO_T) g_pGPIORegs;
00020 e59fe060 ldr lr, [pc, #0x60]
; 66 : g_AC97CtxStruct.pClockReg = (P_XLLP_CLKMGR_T) g_pClockRegs;
; 67 : g_AC97CtxStruct.pAc97Reg = (P_XLLP_AC97_T) g_pAc97Regs;
; 68 : g_AC97CtxStruct.pOstRegs = (P_XLLP_OST_T) g_pOSTRegs;
; 69 : g_AC97CtxStruct.pIntcReg = (P_XLLP_INTC_T) g_pICRegs;
; 70 : g_AC97CtxStruct.maxSetupTimeOutUs = 1000;
00024 e3a04ffa mov r4, #0xFA, 30
; 71 : g_AC97CtxStruct.useSecondaryCodec = 0;
00028 e3a05000 mov r5, #0
0002c e59e3028 ldr r3, [lr, #0x28]
00030 e59e2024 ldr r2, [lr, #0x24]
00034 e59e1034 ldr r1, [lr, #0x34]
00038 e59e0030 ldr r0, [lr, #0x30]
0003c e58e3000 str r3, [lr]
00040 e59e302c ldr r3, [lr, #0x2C]
00044 e58e2004 str r2, [lr, #4]
00048 e58e1008 str r1, [lr, #8]
0004c e58e000c str r0, [lr, #0xC]
00050 e58e3010 str r3, [lr, #0x10]
00054 e58e4014 str r4, [lr, #0x14]
; 72 :
; 73 : XllpOstDelayMicroSeconds((P_XLLP_OST_T) g_pOSTRegs, 1);
00058 e3a01001 mov r1, #1
0005c e58e5018 str r5, [lr, #0x18]
00060 eb000000 bl XllpOstDelayMicroSeconds
; 74 :
; 75 : // Configure the AC97 controller.
; 76 : //
; 77 : //NKDbgPrintfW(TEXT("before ConfigureAC97Control\r\n"));
; 78 : if (!ConfigureAC97Control())
00064 eb000000 bl ConfigureAC97Control
00068 e3500000 cmp r0, #0
0006c 1a000002 bne |$L39780|
00070 |$L40118|
; 79 : {
; 80 : return(FALSE);
00070 e3a00000 mov r0, #0
; 84 : }
00074 e8bd4030 ldmia sp!, {r4, r5, lr}
00078 e12fff1e bx lr
0007c |$L39780|
; 81 : }
; 82 : //NKDbgPrintfW(TEXT("after ConfigureAC97Control\r\n"));
; 83 : return(TRUE);
0007c e3a00001 mov r0, #1
; 84 : }
00080 e8bd4030 ldmia sp!, {r4, r5, lr}
00084 e12fff1e bx lr
00088 |$L40124|
00088 00000000 DCD |g_AC97CtxStruct|
0008c 00000000 DCD |??_C@_1GM@JICIEKCM@?$AA$?$AA$?$AA$?$AA?5?$AA?5?$AA?5?$AA$?$AA$?$AA$?$AA?5?$AA?5?$AA?5?$AA$?$AA$?$AA$?$AA?5?$AA?5?$AA?5?$AA?5?$AAI@|
00090 |$M40120|
ENDP ; |InitializeACLink|
END
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -