4 #ifndef __ALPHA_ALPHA_CPU_H__ 5 #define __ALPHA_ALPHA_CPU_H__ 68 #define apcb_backup_ksp apcb_unique 74 #define ALPHA_PCB_FLAGS_FEN 0x0000000000000001 75 #define ALPHA_PCB_FLAGS_PME 0x4000000000000000 88 #define ALPHA_HWFRAME_PS 0 89 #define ALPHA_HWFRAME_PC 1 90 #define ALPHA_HWFRAME_GP 2 91 #define ALPHA_HWFRAME_A0 3 92 #define ALPHA_HWFRAME_A1 4 93 #define ALPHA_HWFRAME_A2 5 95 #define ALPHA_HWFRAME_SIZE 6 103 #define ALPHA_PSL_USERMODE 0x0008 104 #define ALPHA_PSL_IPL_MASK 0x0007 106 #define ALPHA_PSL_IPL_0 0x0000 107 #define ALPHA_PSL_IPL_SOFT 0x0001 108 #define ALPHA_PSL_IPL_IO 0x0004 109 #define ALPHA_PSL_IPL_CLOCK 0x0005 110 #define ALPHA_PSL_IPL_HIGH 0x0006 112 #define ALPHA_PSL_MUST_BE_ZERO 0xfffffffffffffff0 115 #define ALPHA_PSL_USERSET ALPHA_PSL_USERMODE 116 #define ALPHA_PSL_USERCLR (ALPHA_PSL_MUST_BE_ZERO | ALPHA_PSL_IPL_MASK) 122 #define ALPHA_INTR_XPROC 0 123 #define ALPHA_INTR_CLOCK 1 124 #define ALPHA_INTR_ERROR 2 125 #define ALPHA_INTR_DEVICE 3 126 #define ALPHA_INTR_PERF 4 127 #define ALPHA_INTR_PASSIVE 5 136 #define ALPHA_MCES_IMP \ 138 #define ALPHA_MCES_RSVD \ 140 #define ALPHA_MCES_DSC \ 142 #define ALPHA_MCES_DPC \ 144 #define ALPHA_MCES_PCE \ 146 #define ALPHA_MCES_SCE \ 148 #define ALPHA_MCES_MIP \ 168 #define ALPHA_LOGOUT_FLAGS_RETRY 0x80000000 169 #define ALPHA_LOGOUT_FLAGS_SE 0x40000000 170 #define ALPHA_LOGOUT_FLAGS_SBZ 0x3fffffff 172 #define ALPHA_LOGOUT_NOT_BUILT \ 173 (struct alpha_logout_area *)0xffffffffffffffff) 175 #define ALPHA_LOGOUT_PAL_AREA(lap) \ 176 (unsigned long *)((unsigned char *)(lap) + 16) 177 #define ALPHA_LOGOUT_PAL_SIZE(lap) \ 178 ((lap)->la_cpu_offset - 16) 179 #define ALPHA_LOGOUT_CPU_AREA(lap) \ 180 (unsigned long *)((unsigned char *)(lap) + (lap)->la_cpu_offset) 181 #define ALPHA_LOGOUT_CPU_SIZE(lap) \ 182 ((lap)->la_system_offset - (lap)->la_cpu_offset) 183 #define ALPHA_LOGOUT_SYSTEM_AREA(lap) \ 184 (unsigned long *)((unsigned char *)(lap) + (lap)->la_system_offset) 185 #define ALPHA_LOGOUT_SYSTEM_SIZE(lap) \ 186 ((lap)->la_frame_size - (lap)->la_system_offset) 189 #define ALPHA_SYS_ERROR 0x620 190 #define ALPHA_PROC_ERROR 0x630 191 #define ALPHA_SYS_MCHECK 0x660 192 #define ALPHA_PROC_MCHECK 0x670 203 #define ALPHA_PGSHIFT 13 204 #define ALPHA_PGBYTES (1 << ALPHA_PGSHIFT) 206 #define ALPHA_USEG_BASE 0 207 #define ALPHA_USEG_END 0x000003ffffffffffULL 209 #define ALPHA_K0SEG_BASE 0xfffffc0000000000ULL 210 #define ALPHA_K0SEG_END 0xfffffdffffffffffULL 211 #define ALPHA_K1SEG_BASE 0xfffffe0000000000ULL 212 #define ALPHA_K1SEG_END 0xffffffffffffffffULL 214 #define ALPHA_K0SEG_TO_PHYS(x) ((x) & ~ALPHA_K0SEG_BASE) 215 #define ALPHA_PHYS_TO_K0SEG(x) ((x) | ALPHA_K0SEG_BASE) 217 #define ALPHA_PTE_VALID 0x0001 219 #define ALPHA_PTE_FAULT_ON_READ 0x0002 220 #define ALPHA_PTE_FAULT_ON_WRITE 0x0004 221 #define ALPHA_PTE_FAULT_ON_EXECUTE 0x0008 223 #define ALPHA_PTE_ASM 0x0010 224 #define ALPHA_PTE_GRANULARITY 0x0060 226 #define ALPHA_PTE_PROT 0xff00 227 #define ALPHA_PTE_KR 0x0100 228 #define ALPHA_PTE_UR 0x0200 229 #define ALPHA_PTE_KW 0x1000 230 #define ALPHA_PTE_UW 0x2000 232 #define ALPHA_PTE_WRITE (ALPHA_PTE_KW | ALPHA_PTE_UW) 234 #define ALPHA_PTE_SOFTWARE 0x00000000ffff0000 235 #define ALPHA_PTE_PALCODE (~ALPHA_PTE_SOFTWARE) 237 #define ALPHA_PTE_PFN 0xffffffff00000000 239 #define ALPHA_PTE_TO_PFN(pte) ((pte) >> 32) 240 #define ALPHA_PTE_FROM_PFN(pfn) ((pfn) << 32) 248 #define ALPHA_KENTRY_INT 0 249 #define ALPHA_KENTRY_ARITH 1 250 #define ALPHA_KENTRY_MM 2 251 #define ALPHA_KENTRY_IF 3 252 #define ALPHA_KENTRY_UNA 4 253 #define ALPHA_KENTRY_SYS 5 259 #define ALPHA_MMCSR_INVALTRANS 0 260 #define ALPHA_MMCSR_ACCESS 1 261 #define ALPHA_MMCSR_FOR 2 262 #define ALPHA_MMCSR_FOE 3 263 #define ALPHA_MMCSR_FOW 4 269 #define ALPHA_IF_CODE_BPT 0 270 #define ALPHA_IF_CODE_BUGCHK 1 271 #define ALPHA_IF_CODE_GENTRAP 2 272 #define ALPHA_IF_CODE_FEN 3 273 #define ALPHA_IF_CODE_OPDEC 4 281 #define ALPHA_TBIA() alpha_pal_tbi(-2, 0) 282 #define ALPHA_TBIAP() alpha_pal_tbi(-1, 0) 283 #define ALPHA_TBISI(va) alpha_pal_tbi(1, (va)) 284 #define ALPHA_TBISD(va) alpha_pal_tbi(2, (va)) 285 #define ALPHA_TBIS(va) alpha_pal_tbi(3, (va)) 293 #define ALPHA_AMASK_BWX 0x0001 294 #define ALPHA_AMASK_FIX 0x0002 295 #define ALPHA_AMASK_CIX 0x0004 296 #define ALPHA_AMASK_MVI 0x0100 297 #define ALPHA_AMASK_PAT 0x0200 298 #define ALPHA_AMASK_PMI 0x1000 300 #define ALPHA_AMASK_ALL (ALPHA_AMASK_BWX|ALPHA_AMASK_FIX| \ 301 ALPHA_AMASK_CIX|ALPHA_AMASK_MVI| \ 302 ALPHA_AMASK_PAT|ALPHA_AMASK_PMI) 304 #define ALPHA_AMASK_BITS \ 305 "\20\17PMI\12PAT\11MVI\3CIX\2FIX\1BWX" 311 #define ALPHA_IMPLVER_EV4 0 312 #define ALPHA_IMPLVER_EV5 1 313 #define ALPHA_IMPLVER_EV6 2 314 #define ALPHA_IMPLVER_EV7 3 327 #define ALPHA_WHAMI_MAXID 63 328 #define ALPHA_MAXPROCS (ALPHA_WHAMI_MAXID + 1) 333 const char *alpha_dsr_sysname(
void);
338 unsigned long alpha_amask(
unsigned long);
339 unsigned long alpha_implver(
void);
347 static __inline
unsigned long 352 __asm
volatile(
"rpcc %0" :
"=r" (v0));
356 #define alpha_mb() __asm volatile("mb" : : : "memory") 357 #define alpha_wmb() __asm volatile("mb" : : : "memory") 361 #if defined(_KERNEL) || defined(_STANDALONE) 366 #include <machine/pal.h> 368 void alpha_pal_cflush(
unsigned long);
370 unsigned long _alpha_pal_swpipl(
unsigned long);
371 void alpha_pal_wrent(
void *,
unsigned long);
372 void alpha_pal_wrvptptr(
unsigned long);
374 #define alpha_pal_draina() __asm volatile("call_pal %0 # PAL_draina" \ 375 : : "i" (PAL_draina) : "memory") 377 #define alpha_pal_imb() __asm volatile("call_pal %0 # PAL_imb" \ 378 : : "i" (PAL_imb) : "memory") 380 static __inline
unsigned long 381 alpha_pal_rdmces(
void)
383 register unsigned long v0 __asm(
"$0");
385 __asm
volatile(
"call_pal %1 # PAL_OSF1_rdmces" 387 :
"i" (PAL_OSF1_rdmces)
389 :
"$1",
"$22",
"$23",
"$24",
"$25");
394 static __inline
unsigned long 397 register unsigned long v0 __asm(
"$0");
399 __asm
volatile(
"call_pal %1 # PAL_OSF1_rdps" 401 :
"i" (PAL_OSF1_rdps)
403 :
"$1",
"$22",
"$23",
"$24",
"$25");
408 static __inline
unsigned long 409 alpha_pal_rdunique(
void)
411 register unsigned long v0 __asm(
"$0");
413 __asm
volatile(
"call_pal %1 # PAL_rdunique" 415 :
"i" (PAL_rdunique));
420 static __inline
unsigned long 421 alpha_pal_rdusp(
void)
423 register unsigned long v0 __asm(
"$0");
425 __asm
volatile(
"call_pal %1 # PAL_OSF1_rdusp" 427 :
"i" (PAL_OSF1_rdusp)
429 :
"$1",
"$22",
"$23",
"$24",
"$25");
434 static __inline
unsigned long 435 alpha_pal_rdval(
void)
437 register unsigned long v0 __asm(
"$0");
439 __asm
volatile(
"call_pal %1 # PAL_OSF1_rdval" 441 :
"i" (PAL_OSF1_rdval)
443 :
"$1",
"$22",
"$23",
"$24",
"$25");
448 static __inline
unsigned long 449 alpha_pal_swpctx(
unsigned long ctx)
451 register unsigned long a0 __asm(
"$16") = ctx;
452 register unsigned long v0 __asm(
"$0");
454 __asm
volatile(
"call_pal %2 # PAL_OSF1_swpctx" 455 :
"=r" (a0),
"=r" (v0)
456 :
"i" (PAL_OSF1_swpctx),
"0" (a0)
458 :
"$1",
"$22",
"$23",
"$24",
"$25",
"memory");
463 static __inline
unsigned long 464 alpha_pal_swpipl(
unsigned long ipl)
466 register unsigned long a0 __asm(
"$16") = ipl;
467 register unsigned long v0 __asm(
"$0");
469 __asm
volatile(
"call_pal %2 # PAL_OSF1_swpipl" 470 :
"=r" (a0),
"=r" (v0)
471 :
"i" (PAL_OSF1_swpipl),
"0" (a0)
473 :
"$1",
"$22",
"$23",
"$24",
"$25",
"memory");
479 alpha_pal_tbi(
unsigned long op, vaddr_t va)
481 register unsigned long a0 __asm(
"$16") =
op;
482 register unsigned long a1 __asm(
"$17") = va;
484 __asm
volatile(
"call_pal %2 # PAL_OSF1_tbi" 485 :
"=r" (a0),
"=r" (a1)
486 :
"i" (PAL_OSF1_tbi),
"0" (a0),
"1" (a1)
488 :
"$1",
"$22",
"$23",
"$24",
"$25");
491 static __inline
unsigned long 492 alpha_pal_whami(
void)
494 register unsigned long v0 __asm(
"$0");
496 __asm
volatile(
"call_pal %1 # PAL_OSF1_whami" 498 :
"i" (PAL_OSF1_whami)
500 :
"$1",
"$22",
"$23",
"$24",
"$25");
506 alpha_pal_wrfen(
unsigned long onoff)
508 register unsigned long a0 __asm(
"$16") = onoff;
510 __asm
volatile(
"call_pal %1 # PAL_OSF1_wrfen" 512 :
"i" (PAL_OSF1_wrfen),
"0" (a0)
514 :
"$1",
"$22",
"$23",
"$24",
"$25");
518 alpha_pal_wripir(
unsigned long cpu_id)
520 register unsigned long a0 __asm(
"$16") = cpu_id;
522 __asm
volatile(
"call_pal %1 # PAL_ipir" 524 :
"i" (PAL_ipir),
"0" (a0)
526 :
"$1",
"$22",
"$23",
"$24",
"$25");
530 alpha_pal_wrunique(
unsigned long unique)
532 register unsigned long a0 __asm(
"$16") = unique;
534 __asm
volatile(
"call_pal %1 # PAL_wrunique" 536 :
"i" (PAL_wrunique),
"0" (a0));
540 alpha_pal_wrusp(
unsigned long usp)
542 register unsigned long a0 __asm(
"$16") = usp;
544 __asm
volatile(
"call_pal %1 # PAL_OSF1_wrusp" 546 :
"i" (PAL_OSF1_wrusp),
"0" (a0)
548 :
"$1",
"$22",
"$23",
"$24",
"$25");
552 alpha_pal_wrmces(
unsigned long mces)
554 register unsigned long a0 __asm(
"$16") = mces;
556 __asm
volatile(
"call_pal %1 # PAL_OSF1_wrmces" 558 :
"i" (PAL_OSF1_wrmces),
"0" (a0)
560 :
"$1",
"$22",
"$23",
"$24",
"$25");
564 alpha_pal_wrval(
unsigned long val)
566 register unsigned long a0 __asm(
"$16") = val;
568 __asm
volatile(
"call_pal %1 # PAL_OSF1_wrval" 570 :
"i" (PAL_OSF1_wrval),
"0" (a0)
572 :
"$1",
"$22",
"$23",
"$24",
"$25");
uint32_t la_system_offset
unsigned long alpha_pt_entry_t