diff options
author | Richard Braun <rbraun@sceen.net> | 2012-11-25 23:12:41 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2012-11-27 23:03:06 +0100 |
commit | 3aef6957c38c5f6fcdcadc878ae16fb690485f95 (patch) | |
tree | 4f739c11a9bec9ad1f2e9c8436fac7ee3e6dcf60 /libmachdev/io_req.h | |
parent | e1b0e34210b385d05e50900486262709a9ee3a31 (diff) |
Move DDE to pthreads
Makefiles, headers, types, macros and function calls are renamed where
appropriate. ds_server now takes a void* and returns a void*.
* dde26_test/Makefile: Switch from cthreads to pthreads.
* dde_e100/Makefile: Likewise.
* dde_e100/main.c: Likewise.
* dde26_test/Makefile: Likewise.
* dde_e100/Makefile: Likewise.
* dde_e100/main.c: Likewise.
* dde_e1000/Makefile: Likewise.
* dde_e1000/main.c: Likewise.
* dde_ne2k_pci/Makefile: Likewise.
* dde_ne2k_pci/main.c: Likewise.
* dde_pcnet32/Makefile: Likewise.
* dde_pcnet32/main.c: Likewise.
* dde_pcnet32_test/Makefile: Likewise.
* dde_rtl8139/Makefile: Likewise.
* dde_rtl8139/main.c: Likewise.
* libbpf/Makefile: Likewise.
* libddekit/Makefile: Likewise.
* libddekit/condvar.c: Likewise.
* libddekit/lock.c: Likewise.
* libddekit/pgtab.c: Likewise.
* libddekit/thread.c: Likewise.
* libddekit/timer.c: Likewise.
* libhurd-slab/Makefile: Likewise.
* libhurd-slab/slab.c: Likewise.
* libhurd-slab/slab.h: Likewise.
* libmachdev/Makefile: Likewise.
* libmachdev/dev_hdr.h: Likewise.
* libmachdev/ds_routines.c: Likewise.
* libmachdev/if_hdr.h: Likewise.
* libmachdev/io_req.h: Likewise.
* libmachdev/machdev.h: Likewise.
* libmachdev/net.c: Likewise.
* libmachdev/queue.h: Likewise.
Diffstat (limited to 'libmachdev/io_req.h')
-rw-r--r-- | libmachdev/io_req.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libmachdev/io_req.h b/libmachdev/io_req.h index df8d743c..9c810542 100644 --- a/libmachdev/io_req.h +++ b/libmachdev/io_req.h @@ -32,7 +32,7 @@ #define _IO_REQ_ #include <mach.h> -#include <cthreads.h> +#include <pthread.h> #include "dev_hdr.h" @@ -72,7 +72,7 @@ struct io_req { struct io_req * io_rlink; /* reverse link (for driver header) */ // vm_map_copy_t io_copy; /* vm_map_copy obj. for this op. */ long io_total; /* total op size, for write */ - struct mutex io_req_lock; + pthread_mutex_t io_req_lock; // decl_simple_lock_data(,io_req_lock) /* Lock for this structure */ long io_physrec; /* mapping to the physical block @@ -90,8 +90,8 @@ struct io_req { * happen simultaneously on different processors. */ -#define ior_lock(ior) mutex_lock(&(ior)->io_req_lock) -#define ior_unlock(ior) mutex_unlock(&(ior)->io_req_lock) +#define ior_lock(ior) pthread_mutex_lock(&(ior)->io_req_lock) +#define ior_unlock(ior) pthread_mutex_unlock(&(ior)->io_req_lock) /* * Flags and operations @@ -123,7 +123,7 @@ void iodone(io_req_t); #define io_req_alloc(ior,size) \ MACRO_BEGIN \ (ior) = (io_req_t)malloc(sizeof(struct io_req)); \ - mutex_init(&(ior)->io_req_lock); \ + pthread_mutex_init(&(ior)->io_req_lock, NULL); \ MACRO_END #define io_req_free(ior) \ |