From 3aef6957c38c5f6fcdcadc878ae16fb690485f95 Mon Sep 17 00:00:00 2001 From: Richard Braun Date: Sun, 25 Nov 2012 23:12:41 +0100 Subject: 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. --- libmachdev/io_req.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'libmachdev/io_req.h') 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 -#include +#include #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) \ -- cgit v1.2.3