22 lines
931 B
C
22 lines
931 B
C
#include "vt1200_xlib.h"
|
|
|
|
/* The ROM's indirect displacements are bit offsets (xhello.asm):
|
|
Display.screens at bit 0x480, Screen.root at bit 0x40. C struct offsets
|
|
are bytes, so assert the byte offsets and return the ROM's bit offsets. */
|
|
_Static_assert(__builtin_offsetof(Display, screens) == 0x90,
|
|
"Display.screens must be at byte 0x90 (bit 0x480)");
|
|
_Static_assert(__builtin_offsetof(Screen, root) == 0x8,
|
|
"Screen.root must be at byte 0x8 (bit 0x40)");
|
|
|
|
int layout_screens(void) {
|
|
return (int)__builtin_offsetof(Display, screens) * 8;
|
|
}
|
|
int layout_root(void) {
|
|
return (int)__builtin_offsetof(Screen, root) * 8;
|
|
}
|
|
|
|
/* Exercise the real access path: vt1200_root() follows Display.screens (bit
|
|
0x480) and reads Screen.root (bit 0x40). The align-1 loads this generates
|
|
must select MOVE directly (see m3-unaligned.ll). */
|
|
unsigned int root_probe(Display *d) { return vt1200_root(d); }
|