diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2020-03-31 00:48:19 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2020-03-31 00:48:50 +0200 |
commit | 0b7aac4481ee99f000305e90901951918ae34ccc (patch) | |
tree | 108465fe705b0a624774a5416ca0f1790075013c | |
parent | a8d6d1c97c980e8ab0073943deda257dbd216e14 (diff) |
Fix calling machdevdde
We can not include dde* and machdev* at the same time, they have
conflicting definitions for phys_addr_t, errno values, etc. whatnot.
* main.c: Include "machdev.h". Move initialization calls to...
* machdev.h: ... new file.
* machdev.c: New file.
-rw-r--r-- | machdev.c | 20 | ||||
-rw-r--r-- | machdev.h | 6 | ||||
-rw-r--r-- | main.c | 17 |
3 files changed, 30 insertions, 13 deletions
diff --git a/machdev.c b/machdev.c new file mode 100644 index 000000000..8a2cc2302 --- /dev/null +++ b/machdev.c @@ -0,0 +1,20 @@ +#include "machdev.h" +#include <hurd/machdev.h> +#include <hurd/machdevdde.h> + +void machdev_init(void) +{ + machdevdde_register_net(); + machdev_device_init(); + machdev_trivfs_init(); +} + +void machdev_run1 (void *arg) +{ + machdevdde_server(arg); +} + +void machdev_run2(void) +{ + machdev_trivfs_server(); +} diff --git a/machdev.h b/machdev.h new file mode 100644 index 000000000..043c13aff --- /dev/null +++ b/machdev.h @@ -0,0 +1,6 @@ +#ifndef MACHDEV_H +#define MACHDEV_H +void machdev_init(void); +void machdev_run1(void *arg); +void machdev_run2(void); +#endif /* MACHDEV_H */ @@ -6,18 +6,11 @@ #include <linux/init.h> // initcall() #include <linux/delay.h> // msleep() -#include <hurd/machdev.h> -#include <hurd/machdevdde.h> +#include "machdev.h" #include "check_kernel.h" int using_std = 1; -static void -start_ds_server (void *arg) -{ - machdevdde_server (arg); -} - int main(int argc, char **argv) { check_kernel(); @@ -31,12 +24,10 @@ int main(int argc, char **argv) l4dde26_do_initcalls(); - machdevdde_register_net(); - machdev_device_init(); - machdev_trivfs_init(); + machdev_init(); - ddekit_thread_create (start_ds_server, NULL, "ds_server"); - machdev_trivfs_server(); + ddekit_thread_create (machdev_run1, NULL, "ds_server"); + machdev_run2(); return 0; } |