]> Joshua Wise's Git repositories - netwatch.git/blobdiff - tools/poke-rls.c
add some more structured packet handling
[netwatch.git] / tools / poke-rls.c
index 01de181bf1e5497ca8e248a8fd7277bef32cf0a3..6946fb75fbe42d480670abb10c1f1c41e82190ca 100644 (file)
@@ -14,12 +14,21 @@ static uint16_t _get_PMBASE()
        return pmbase;
 }
 
        return pmbase;
 }
 
+typedef struct {
+       uint32_t signature;
+       uint32_t type;
+       uint8_t data[];
+} packet_t;
 
 
-extern unsigned int poke(unsigned long addr);
+extern unsigned int poke(unsigned long addr, unsigned long * value);
 
 int main(int argc, char **argv)
 {
        unsigned int res;
 
 int main(int argc, char **argv)
 {
        unsigned int res;
+       packet_t * packet = (packet_t *)memalign(4096, sizeof(packet_t));
+
+       packet->signature = 0x1BADD00D;
+       packet->type = 0xF00FC7C8;
 
        if (iopl(3) < 0)
        {
 
        if (iopl(3) < 0)
        {
@@ -27,6 +36,6 @@ int main(int argc, char **argv)
                return 1;
        }
        
                return 1;
        }
        
-       res = poke(_get_PMBASE() + 0x04);
-       printf("found %p\n", res);
+       res = poke(_get_PMBASE() + 0x04, (void *)packet);
+       printf("returned %p\n", res);
 }
 }
This page took 0.026592 seconds and 4 git commands to generate.