2 #include <reg-82801b.h>
7 static uint16_t _get_PMBASE()
9 static long pmbase = -1;
12 pmbase = pci_read32(ICH2_LPC_BUS, ICH2_LPC_DEV, ICH2_LPC_FN, ICH2_LPC_PCI_PMBASE) & ICH2_PMBASE_MASK;
23 extern unsigned int poke(unsigned long addr, unsigned long * value);
25 int main(int argc, char **argv)
28 packet_t * packet = (packet_t *)memalign(4096, sizeof(packet_t));
30 packet->signature = 0x1BADD00D;
32 strcpy(packet->data, "hello, world!");
40 res = poke(_get_PMBASE() + 0x04, (void *)packet);
41 printf("returned %p\n", res);
44 printf("%s\n", packet->data);
45 printf("%s\n", packet->data+41);
46 printf("%s\n", packet->data+82);
47 printf("%s\n", packet->data+123);