// The OS/K Team licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. static inline ushort bswap16(ushort u) { return ((u<<8) | (u>>8)); } static inline char getmempref(ushort len) { return (len==1?'b':(len==2?'w':(len==4?'d':(len==8?'q':'x')))); } #define MEMOFF (1 * 1024 * 1024) #define MEMSIZE (16 * 1024 * 1024) // 16MB #define MAXADDR 0x8000000000000 // 2^48 - 1 #define addr2real(p) ((p) - MEMOFF) #define real2addr(p) ((p) + MEMOFF) // Address of boot firmware stack #define FWSTACK (MEMOFF * 2) // 2MB ulong readstr(ulong addr, ulong maxn, char *buf); ulong writestr(ulong addr, ulong maxn, char *str); ulong readmemzx(ulong addr, uint len); ulong readmemsx(ulong addr, uint len); void writemem(ulong val, ulong addr, uint len);