Changeset 565 for trunk/kernel/devices/dev_iob.c
- Timestamp:
- Oct 4, 2018, 11:48:51 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/devices/dev_iob.c
r457 r565 2 2 * dev_iob.c - IOB (bridge to external I/O) generic device API implementation. 3 3 * 4 * Authors Alain Greiner (201 7)4 * Authors Alain Greiner (2016,2017,2018) 5 5 * 6 6 * Copyright (c) UPMC Sorbonne Universites … … 25 25 #include <hal_kernel_types.h> 26 26 #include <hal_special.h> 27 #include <remote_ spinlock.h>27 #include <remote_busylock.h> 28 28 #include <chdev.h> 29 29 #include <printk.h> … … 50 50 // get IOB chdev descriptor cluster and local pointer 51 51 cxy_t dev_cxy = GET_CXY( dev_xp ); 52 chdev_t * dev_ptr = (chdev_t *)GET_PTR( dev_xp );52 chdev_t * dev_ptr = GET_PTR( dev_xp ); 53 53 54 54 // get pointer on set_active function … … 56 56 57 57 // call relevant driver function 58 remote_ spinlock_lock( XPTR( dev_cxy , &dev_ptr->wait_lock ) );58 remote_busylock_acquire( XPTR( dev_cxy , &dev_ptr->wait_lock ) ); 59 59 f( dev_xp , 1 ); 60 remote_ spinlock_unlock( XPTR( dev_cxy , &dev_ptr->wait_lock ) );60 remote_busylock_release( XPTR( dev_cxy , &dev_ptr->wait_lock ) ); 61 61 } 62 62 … … 66 66 // get IOB chdev descriptor cluster and local pointer 67 67 cxy_t dev_cxy = GET_CXY( dev_xp ); 68 chdev_t * dev_ptr = (chdev_t *)GET_PTR( dev_xp );68 chdev_t * dev_ptr = GET_PTR( dev_xp ); 69 69 70 70 // get pointer on set_active function … … 72 72 73 73 // call driver function 74 remote_ spinlock_lock( XPTR( dev_cxy , &dev_ptr->wait_lock ) );74 remote_busylock_acquire( XPTR( dev_cxy , &dev_ptr->wait_lock ) ); 75 75 f( dev_xp , 0 ); 76 remote_ spinlock_unlock( XPTR( dev_cxy , &dev_ptr->wait_lock ) );76 remote_busylock_release( XPTR( dev_cxy , &dev_ptr->wait_lock ) ); 77 77 } 78 78 … … 83 83 // get IOB chdev descriptor cluster and local pointer 84 84 cxy_t dev_cxy = GET_CXY( dev_xp ); 85 chdev_t * dev_ptr = (chdev_t *)GET_PTR( dev_xp );85 chdev_t * dev_ptr = GET_PTR( dev_xp ); 86 86 87 87 // get pointer on set_ptpr function … … 89 89 90 90 // call driver function 91 remote_ spinlock_lock( XPTR( dev_cxy , &dev_ptr->wait_lock ) );91 remote_busylock_acquire( XPTR( dev_cxy , &dev_ptr->wait_lock ) ); 92 92 f( dev_xp , wdata ); 93 remote_ spinlock_unlock( XPTR( dev_cxy , &dev_ptr->wait_lock ) );93 remote_busylock_release( XPTR( dev_cxy , &dev_ptr->wait_lock ) ); 94 94 95 95 } … … 101 101 // get IOB chdev descriptor cluster and local pointer 102 102 cxy_t dev_cxy = GET_CXY( dev_xp ); 103 chdev_t * dev_ptr = (chdev_t *)GET_PTR( dev_xp );103 chdev_t * dev_ptr = GET_PTR( dev_xp ); 104 104 105 105 // get pointer on inval_page function … … 107 107 108 108 // call driver function 109 remote_ spinlock_lock( XPTR( dev_cxy , &dev_ptr->wait_lock ) );109 remote_busylock_acquire( XPTR( dev_cxy , &dev_ptr->wait_lock ) ); 110 110 f( dev_xp , vpn ); 111 remote_ spinlock_unlock( XPTR( dev_cxy , &dev_ptr->wait_lock ) );111 remote_busylock_release( XPTR( dev_cxy , &dev_ptr->wait_lock ) ); 112 112 } 113 113 … … 120 120 // get IOB chdev descriptor cluster and local pointer 121 121 cxy_t dev_cxy = GET_CXY( dev_xp ); 122 chdev_t * dev_ptr = (chdev_t *)GET_PTR( dev_xp );122 chdev_t * dev_ptr = GET_PTR( dev_xp ); 123 123 124 124 // get pointer on the functions … … 128 128 129 129 // call driver function 130 remote_ spinlock_lock( XPTR( dev_cxy , &dev_ptr->wait_lock ) );130 remote_busylock_acquire( XPTR( dev_cxy , &dev_ptr->wait_lock ) ); 131 131 *error = f_get_error( dev_xp ); 132 132 *srcid = f_get_srcid( dev_xp ); 133 133 *bvar = f_get_bvar( dev_xp ); 134 remote_ spinlock_unlock( XPTR( dev_cxy , &dev_ptr->wait_lock ) );134 remote_busylock_release( XPTR( dev_cxy , &dev_ptr->wait_lock ) ); 135 135 } 136 136
Note: See TracChangeset
for help on using the changeset viewer.