Changeset 1067 in vbox for trunk/src/VBox/Additions/linux/module
- Timestamp:
- Feb 26, 2007 8:14:08 PM (18 years ago)
- Location:
- trunk/src/VBox/Additions/linux/module
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/linux/module/cmc.c
r1 r1067 19 19 */ 20 20 21 #if 022 #ifndef bool /* Linux 2.6.19 C++ nightmare */23 #define bool bool_type24 #define true true_type25 #define false false_type26 #define _Bool int27 #define bool_cmc_c28 #endif29 #include <linux/autoconf.h>30 #include <linux/version.h>31 #if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 0)32 # undef ALIGN33 #endif34 #ifndef KBUILD_STR35 # if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 16)36 # define KBUILD_STR(s) s37 # else38 # define KBUILD_STR(s) #s39 # endif40 #endif41 /* Make (at least) RHEL3U5 happy. */42 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0)43 // # define EXPORT_SYMTAB44 #endif45 #include <linux/module.h>46 #include <linux/kernel.h>47 #include <linux/fs.h>48 #include <linux/mm.h>49 #include <linux/wait.h>50 #include <linux/pci.h>51 #include <linux/delay.h>52 #include <linux/interrupt.h>53 #include <linux/completion.h>54 #include <asm/uaccess.h>55 #ifdef bool_cmc_c56 #undef bool57 #undef true58 #undef false59 #undef _Bool60 #undef bool_cmc_c61 #endif62 #endif63 64 21 #include "the-linux-kernel.h" 65 66 // What is this for?67 // bird: see comment on the other #undef.68 #undef ALIGN69 22 #include "vboxmod.h" 70 /* #include "waitcompat.h" */71 23 72 24 /** … … 75 27 */ 76 28 static DECLVBGL(void) 77 vboxadd_hgcm_callback ( 78 VMMDevHGCMRequestHeader *pHeader, 79 void *pvData, 80 uint32_t u32Data 81 ) 29 vboxadd_hgcm_callback (VMMDevHGCMRequestHeader *pHeader, void *pvData, uint32_t u32Data) 82 30 { 83 31 VBoxDevice *dev = pvData; 84 85 32 wait_event (dev->eventq, pHeader->fu32Flags & VBOX_HGCM_REQ_DONE); 86 33 } 87 34 88 static int vboxadd_hgcm_connect ( 89 VBoxDevice *dev, 90 VBoxGuestHGCMConnectInfo *info 91 ) 35 static int vboxadd_hgcm_connect (VBoxDevice *dev, VBoxGuestHGCMConnectInfo *info) 92 36 { 93 int rc = VbglHGCMConnect (info, vboxadd_hgcm_callback, dev, 0); 94 return rc; 37 return VbglHGCMConnect (info, vboxadd_hgcm_callback, dev, 0); 95 38 } 96 39 97 static int vboxadd_hgcm_disconnect ( 98 VBoxDevice *dev, 99 VBoxGuestHGCMDisconnectInfo *info 100 ) 40 static int vboxadd_hgcm_disconnect (VBoxDevice *dev, VBoxGuestHGCMDisconnectInfo *info) 101 41 { 102 int rc = VbglHGCMDisconnect (info, vboxadd_hgcm_callback, dev, 0); 103 return rc; 42 return VbglHGCMDisconnect (info, vboxadd_hgcm_callback, dev, 0); 104 43 } 105 44 106 static int vboxadd_hgcm_call ( 107 VBoxDevice *dev, 108 VBoxGuestHGCMCallInfo *info 109 ) 45 static int vboxadd_hgcm_call (VBoxDevice *dev, VBoxGuestHGCMCallInfo *info) 110 46 { 111 int rc = VbglHGCMCall (info, vboxadd_hgcm_callback, dev, 0); 112 return rc; 47 return VbglHGCMCall (info, vboxadd_hgcm_callback, dev, 0); 113 48 } 114 49 … … 143 78 vboxadd_cmc_ctl_guest_filter_mask (uint32_t or_mask, uint32_t not_mask) 144 79 { 145 146 80 int rc; 81 VMMDevCtlGuestFilterMask *req; 147 82 148 149 83 rc = VbglGRAlloc ((VMMDevRequestHeader**) &req, sizeof (*req), 84 VMMDevReq_CtlGuestFilterMask); 150 85 151 if (VBOX_FAILURE (rc)) { 152 elog ("VbglGRAlloc (CtlGuestFilterMask) failed rc=%d\n", rc); 153 return -1; 154 } 86 if (VBOX_FAILURE (rc)) 87 { 88 elog ("VbglGRAlloc (CtlGuestFilterMask) failed rc=%d\n", rc); 89 return -1; 90 } 155 91 156 157 92 req->u32OrMask = or_mask; 93 req->u32NotMask = not_mask; 158 94 159 rc = VbglGRPerform (&req->header); 160 VbglGRFree (&req->header); 161 if (VBOX_FAILURE (rc)) { 162 elog ("VbglGRPerform (CtlGuestFilterMask) failed rc=%d\n", rc); 163 return -1; 164 } 165 return 0; 95 rc = VbglGRPerform (&req->header); 96 VbglGRFree (&req->header); 97 if (VBOX_FAILURE (rc)) 98 { 99 elog ("VbglGRPerform (CtlGuestFilterMask) failed rc=%d\n", rc); 100 return -1; 101 } 102 return 0; 166 103 } 167 104 -
trunk/src/VBox/Additions/linux/module/vboxmod.c
r1 r1067 20 20 */ 21 21 22 #if 023 #ifndef bool /* Linux 2.6.19 C++ nightmare */24 # define bool bool_type25 # define true true_type26 # define false false_type27 # define _Bool int28 # define bool_vboxmod_c29 #endif30 #include <linux/autoconf.h>31 #include <linux/version.h>32 #if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 0)33 # undef ALIGN34 #endif35 #ifndef KBUILD_STR36 # if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 16)37 # define KBUILD_STR(s) s38 # else39 # define KBUILD_STR(s) #s40 # endif41 #endif42 /* Make (at least) RHEL3U5 happy. */43 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0)44 // # define EXPORT_SYMTAB45 #endif46 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 7)47 # if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 29) \48 || LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 0)49 # define msecs_to_jiffies(x) (((x) * 1000) / HZ)50 # endif51 #else52 # include <linux/time.h>53 # include <linux/jiffies.h>54 #endif55 #include <linux/module.h>56 #include <linux/kernel.h>57 #include <linux/fs.h>58 #include <linux/mm.h>59 #include <linux/pci.h>60 #include <linux/wait.h>61 #include <linux/delay.h>62 #include <linux/interrupt.h>63 #include <linux/completion.h>64 #include <asm/uaccess.h>65 #ifdef bool_vboxmod_c66 # undef bool67 # undef true68 # undef false69 # undef _Bool70 # undef bool_vboxmod_c71 #endif72 #endif73 74 22 #include "the-linux-kernel.h" 75 23 76 24 /* #define IRQ_DEBUG */ 77 // What is this for?78 // bird: It used to fix a clash between ALIGN in iprt/cdefs.h and system headers.79 // Since I changed that a while back it should be obsoleted by now. Could80 // you please verify that this is actually the case (i.e. no ALIGN references81 // the code or any (of our) headers involved with it) and remove the #undef?82 #undef ALIGN83 25 84 26 #include "vboxmod.h" … … 92 34 93 35 /* Runtime assert implementation for Linux ring 0 */ 94 RTDECL(void) AssertMsg1( 95 const char *pszExpr, 96 unsigned uLine, 97 const char *pszFile, 98 const char *pszFunction 99 ) 36 RTDECL(void) AssertMsg1(const char *pszExpr, unsigned uLine, 37 const char *pszFile, const char *pszFunction) 100 38 { 101 39 elog ("!!Assertion Failed!!\n" … … 180 118 */ 181 119 static void 182 vboxadd_wait_for_event_helper ( 183 VBoxDevice *dev, 184 long timeout, 185 uint32_t in_mask, 186 uint32_t * out_mask 187 ) 120 vboxadd_wait_for_event_helper (VBoxDevice *dev, long timeout, 121 uint32_t in_mask, uint32_t * out_mask) 188 122 { 189 123 BUG ();
Note:
See TracChangeset
for help on using the changeset viewer.