kaluga/octopus: make it compile for arm
authorKornilios Kourtis <kkourt@inf.ethz.ch>
Tue, 26 Mar 2013 19:11:56 +0000 (20:11 +0100)
committerKornilios Kourtis <kkourt@inf.ethz.ch>
Tue, 9 Apr 2013 08:25:16 +0000 (10:25 +0200)
lib/octopus/client/pubsub.c
lib/octopus/client/trigger.c
usr/kaluga/Hakefile
usr/kaluga/start_pci.c

index 6ba5dbc..0849664 100644 (file)
@@ -34,13 +34,9 @@ void subscription_handler(struct octopus_binding *b, subscription_t id,
 {
 
     // XXX: Probably send some offset around and use 32bit in flounder?
-#if defined(__i386__)
-    subscription_handler_fn handler_fn = (subscription_handler_fn) (uint32_t)fn;
-    void* state = (void*) (uint32_t)st;
-#else
-    subscription_handler_fn handler_fn = (subscription_handler_fn) fn;
-    void* state = (void*) st;
-#endif
+    // XXX: The casting to uintptr_t is for 32-bit archs
+    subscription_handler_fn handler_fn = (subscription_handler_fn)(uintptr_t)fn;
+    void* state = (void*)(uintptr_t)st;
 
     if (handler_fn != NULL) {
         handler_fn(mode, record, state);
@@ -87,13 +83,8 @@ errval_t oct_subscribe(subscription_handler_fn function, const void *state,
     uint64_t fl_function = 0;
     uint64_t fl_state = 0;
 
-#if defined(__i386__)
-    fl_function = (uint64_t)(uint32_t)function;
-    fl_state = (uint64_t)(uint32_t)state;
-#else
-    fl_function = (uint64_t)function;
-    fl_state = (uint64_t)state;
-#endif
+    fl_function = (uint64_t)(uintptr_t)function;
+    fl_state = (uint64_t)(uintptr_t)state;
 
     err = cl->call_seq.subscribe(cl, buf, fl_function,
             fl_state, id, &error_code); // XXX: Sending Pointer as uint64
index 74bb796..38e839f 100644 (file)
@@ -28,14 +28,9 @@ void trigger_handler(struct octopus_binding* b, octopus_trigger_id_t id,
 {
     assert(t != 0);
 
-// XXX:
-#if defined(__i386__)
-    trigger_handler_fn trigger_fn = (trigger_handler_fn) (uint32_t)t;
-    void* state = (void*) (uint32_t)st;
-#else
-    trigger_handler_fn trigger_fn = (trigger_handler_fn) t;
-    void* state = (void*) st;
-#endif
+    // XXX: The casting to uintptr_t is for 32-bit archs
+    trigger_handler_fn trigger_fn = (trigger_handler_fn) (uintptr_t)t;
+    void* state = (void*) (uintptr_t)st;
 
     if (trigger_fn != NULL) {
         trigger_fn(mode, record, state);
@@ -55,13 +50,8 @@ octopus_trigger_t oct_mktrigger(errval_t in_case, octopus_binding_type_t send_to
                 .m = mode,
                 .send_to = send_to,
                 // TODO: bad uint64_t here!
-#if defined(__i386__)
-                .trigger = (uint64_t)(uint32_t) fn,
-                .st = (uint64_t)(uint32_t) state
-#else
-                .trigger = (uint64_t) fn,
-                .st = (uint64_t) state
-#endif
+                .trigger = (uint64_t)(uintptr_t) fn,
+                .st = (uint64_t)(uintptr_t) state
             };
 }
 
index 88d1ce4..4366b6d 100644 (file)
@@ -18,5 +18,5 @@
                       flounderTHCStubs = [ "octopus" ],
                       addLibraries = libDeps [ "skb", "octopus", "vfs", 
                                                "spawndomain", "elf" ],
-                      architectures = [ "x86_64", "x86_32" ] }
+                      architectures = [ "x86_64", "x86_32", "armv7" ] }
 ]
index 2c58c46..f44d87e 100644 (file)
@@ -37,12 +37,8 @@ static void spawnd_up_event(octopus_mode_t mode, char* spawnd_record, void* st)
 
     // Pass the iref as state, this tells pci_change_event that we
     // don't need to look again for the spawnd iref
-#if defined(__i386__)
     // XXX: Pointer
-    pci_change_event(OCT_ON_SET, st, (void*)(uint32_t)iref);
-#else
-    pci_change_event(OCT_ON_SET, st, (void*)iref);
-#endif
+    pci_change_event(OCT_ON_SET, st, (void*)(uintptr_t)iref);
     free(spawnd_record);
 }