1
0
mirror of https://github.com/Interlisp/maiko.git synced 2026-01-15 07:54:13 +00:00

Add NativeAligned4FromStackOffset() and LPageFromNative() before using them

This commit is contained in:
Nick Briggs 2022-08-29 18:13:41 -07:00
parent a448bd0329
commit 889adcaa35

View File

@ -74,6 +74,18 @@ static inline DLword *NativeAligned2FromStackOffset(DLword StackOffset)
return Stackspace + StackOffset;
}
static inline LispPTR *NativeAligned4FromStackOffset(DLword StackOffset)
{
return (LispPTR *)(Stackspace + StackOffset);
}
static inline LispPTR LPageFromNative(void *NAddr)
{
if ((uintptr_t)NAddr & 1) {
printf("Misaligned pointer in LPageFromNative %p\n", NAddr);
}
return (((DLword *)NAddr) - Lisp_world) >> 8;
}
/* translate 68k ptr to Lisp DLword address */
#define LADDR_from_68k(ptr68k) ((LispPTR)(((UNSIGNED)(ptr68k) - (UNSIGNED)Lisp_world) >>1))