13cee1f71SJustin Miller $if (_WDMDDK_) 23cee1f71SJustin Miller /** Kernel definitions for ARM64 **/ 33cee1f71SJustin Miller 43cee1f71SJustin Miller /* Interrupt request levels */ 53cee1f71SJustin Miller #define PASSIVE_LEVEL 0 63cee1f71SJustin Miller #define LOW_LEVEL 0 73cee1f71SJustin Miller #define APC_LEVEL 1 83cee1f71SJustin Miller #define DISPATCH_LEVEL 2 93cee1f71SJustin Miller #define CLOCK_LEVEL 13 103cee1f71SJustin Miller #define IPI_LEVEL 14 113cee1f71SJustin Miller #define DRS_LEVEL 14 123cee1f71SJustin Miller #define POWER_LEVEL 14 133cee1f71SJustin Miller #define PROFILE_LEVEL 15 143cee1f71SJustin Miller #define HIGH_LEVEL 15 153cee1f71SJustin Miller 16*4363e74dSJustin Miller #define SharedUserData ((KUSER_SHARED_DATA * const)KI_USER_SHARED_DATA) 17*4363e74dSJustin Miller 18*4363e74dSJustin Miller #define PAGE_SIZE 0x1000 19*4363e74dSJustin Miller #define PAGE_SHIFT 12L 20*4363e74dSJustin Miller 21*4363e74dSJustin Miller #define PAUSE_PROCESSOR YieldProcessor(); 22*4363e74dSJustin Miller 23*4363e74dSJustin Miller /* FIXME: Based on AMD64 but needed to compile apps */ 24*4363e74dSJustin Miller #define KERNEL_STACK_SIZE 12288 25*4363e74dSJustin Miller #define KERNEL_LARGE_STACK_SIZE 61440 26*4363e74dSJustin Miller #define KERNEL_LARGE_STACK_COMMIT KERNEL_STACK_SIZE 27*4363e74dSJustin Miller /* FIXME End */ 28*4363e74dSJustin Miller 29*4363e74dSJustin Miller #define EXCEPTION_READ_FAULT 0 30*4363e74dSJustin Miller #define EXCEPTION_WRITE_FAULT 1 31*4363e74dSJustin Miller #define EXCEPTION_EXECUTE_FAULT 8 32*4363e74dSJustin Miller 333cee1f71SJustin Miller NTSYSAPI 343cee1f71SJustin Miller PKTHREAD 353cee1f71SJustin Miller NTAPI 363cee1f71SJustin Miller KeGetCurrentThread(VOID); 373cee1f71SJustin Miller 383cee1f71SJustin Miller #define DbgRaiseAssertionFailure() __break(0xf001) 393cee1f71SJustin Miller 403cee1f71SJustin Miller $endif (_WDMDDK_) 413cee1f71SJustin Miller $if (_NTDDK_) 423cee1f71SJustin Miller 433cee1f71SJustin Miller #define ARM64_MAX_BREAKPOINTS 8 443cee1f71SJustin Miller #define ARM64_MAX_WATCHPOINTS 2 453cee1f71SJustin Miller 463cee1f71SJustin Miller typedef union NEON128 { 473cee1f71SJustin Miller struct { 483cee1f71SJustin Miller ULONGLONG Low; 493cee1f71SJustin Miller LONGLONG High; 503cee1f71SJustin Miller } DUMMYSTRUCTNAME; 513cee1f71SJustin Miller double D[2]; 523cee1f71SJustin Miller float S[4]; 533cee1f71SJustin Miller USHORT H[8]; 543cee1f71SJustin Miller UCHAR B[16]; 553cee1f71SJustin Miller } NEON128, *PNEON128; 563cee1f71SJustin Miller typedef NEON128 NEON128, *PNEON128; 573cee1f71SJustin Miller 583cee1f71SJustin Miller typedef struct _CONTEXT { 593cee1f71SJustin Miller 603cee1f71SJustin Miller // 613cee1f71SJustin Miller // Control flags. 623cee1f71SJustin Miller // 633cee1f71SJustin Miller 643cee1f71SJustin Miller ULONG ContextFlags; 653cee1f71SJustin Miller 663cee1f71SJustin Miller // 673cee1f71SJustin Miller // Integer registers 683cee1f71SJustin Miller // 693cee1f71SJustin Miller 703cee1f71SJustin Miller ULONG Cpsr; 713cee1f71SJustin Miller union { 723cee1f71SJustin Miller struct { 733cee1f71SJustin Miller ULONG64 X0; 743cee1f71SJustin Miller ULONG64 X1; 753cee1f71SJustin Miller ULONG64 X2; 763cee1f71SJustin Miller ULONG64 X3; 773cee1f71SJustin Miller ULONG64 X4; 783cee1f71SJustin Miller ULONG64 X5; 793cee1f71SJustin Miller ULONG64 X6; 803cee1f71SJustin Miller ULONG64 X7; 813cee1f71SJustin Miller ULONG64 X8; 823cee1f71SJustin Miller ULONG64 X9; 833cee1f71SJustin Miller ULONG64 X10; 843cee1f71SJustin Miller ULONG64 X11; 853cee1f71SJustin Miller ULONG64 X12; 863cee1f71SJustin Miller ULONG64 X13; 873cee1f71SJustin Miller ULONG64 X14; 883cee1f71SJustin Miller ULONG64 X15; 893cee1f71SJustin Miller ULONG64 X16; 903cee1f71SJustin Miller ULONG64 X17; 913cee1f71SJustin Miller ULONG64 X18; 923cee1f71SJustin Miller ULONG64 X19; 933cee1f71SJustin Miller ULONG64 X20; 943cee1f71SJustin Miller ULONG64 X21; 953cee1f71SJustin Miller ULONG64 X22; 963cee1f71SJustin Miller ULONG64 X23; 973cee1f71SJustin Miller ULONG64 X24; 983cee1f71SJustin Miller ULONG64 X25; 993cee1f71SJustin Miller ULONG64 X26; 1003cee1f71SJustin Miller ULONG64 X27; 1013cee1f71SJustin Miller ULONG64 X28; 1023cee1f71SJustin Miller ULONG64 Fp; 1033cee1f71SJustin Miller ULONG64 Lr; 1043cee1f71SJustin Miller } DUMMYSTRUCTNAME; 1053cee1f71SJustin Miller ULONG64 X[31]; 1063cee1f71SJustin Miller } DUMMYUNIONNAME; 1073cee1f71SJustin Miller 1083cee1f71SJustin Miller ULONG64 Sp; 1093cee1f71SJustin Miller ULONG64 Pc; 1103cee1f71SJustin Miller 1113cee1f71SJustin Miller // 1123cee1f71SJustin Miller // Floating Point/NEON Registers 1133cee1f71SJustin Miller // 1143cee1f71SJustin Miller 1153cee1f71SJustin Miller NEON128 V[32]; 1163cee1f71SJustin Miller ULONG Fpcr; 1173cee1f71SJustin Miller ULONG Fpsr; 1183cee1f71SJustin Miller 1193cee1f71SJustin Miller // 1203cee1f71SJustin Miller // Debug registers 1213cee1f71SJustin Miller // 1223cee1f71SJustin Miller 1233cee1f71SJustin Miller ULONG Bcr[ARM64_MAX_BREAKPOINTS]; 1243cee1f71SJustin Miller ULONG64 Bvr[ARM64_MAX_BREAKPOINTS]; 1253cee1f71SJustin Miller ULONG Wcr[ARM64_MAX_WATCHPOINTS]; 1263cee1f71SJustin Miller ULONG64 Wvr[ARM64_MAX_WATCHPOINTS]; 1273cee1f71SJustin Miller 1283cee1f71SJustin Miller } CONTEXT, *PCONTEXT; 1293cee1f71SJustin Miller $endif 130