mirror of
https://github.com/lenticularis39/axpbox.git
synced 2026-01-11 23:53:28 +00:00
transplant dad191fb2f
This commit is contained in:
parent
b74f1ad8be
commit
d26f87b4c0
@ -424,15 +424,32 @@ inline u64 fsqrt64(u64 asig, s32 exp) {
|
||||
|
||||
#define ALIGN_PHYS(a) (phys_address & ~((u64)((a)-1)))
|
||||
|
||||
/* Increase memory access page alignment checking to 8KB instead of
|
||||
4KB, 8KB minimum on AXP. Potentially should be dynamic in future,
|
||||
resolves OpenVMS installation problems. Source:
|
||||
https://www.openvmshobbyist.com/forum/viewthread.php?forum_id=161&thread_id=2801
|
||||
|
||||
https://github.com/gdwnldsKSC/es40/commit/dad191fb2f279164122654aba6da53acc1040d97
|
||||
*/
|
||||
|
||||
#define DATA_PHYS(addr, flags, align) \
|
||||
if ((addr) & (align)) { \
|
||||
u64 a1 = (addr); \
|
||||
u64 a2 = (addr) + (align); \
|
||||
if ((a1 ^ a2) & ~U64(0x1fff)) /*page boundary crossed*/ \
|
||||
pbc = true; \
|
||||
if ((a1 ^ a2) & ~U64(0x1fff)) /* 8K page boundary crossed*/ \
|
||||
{ \
|
||||
state.fault_va = addr; \
|
||||
state.exc_sum = ((REG_1 &0x1f) << 8); \
|
||||
state.mm_stat = (I_GETOP(ins) << 4) | ((flags & ACCESS_WRITE) ? 1 : 0); \
|
||||
printf("unaligned addess %d, %d -> trap! ",flags,align); \
|
||||
printf("exc_sum = 0x%04" PRId64 "x, fault_va = 0x%016" PRId64 \
|
||||
"x, mm_stat = 0x%03" PRId64 "x.\n",state.exc_sum, state.fault_va, \
|
||||
state.mm_stat); \
|
||||
GO_PAL(UNALIGN); \
|
||||
return; \
|
||||
} \
|
||||
} \
|
||||
if (virt2phys(addr, &phys_address, flags, NULL, ins)) \
|
||||
return;
|
||||
DATA_PHYS_NT(addr, flags) // use the define above instead of duplicating
|
||||
|
||||
/**
|
||||
* Normal variant of read action
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user