Changeset 201 for trunk/kernel
- Timestamp:
- Jul 13, 2017, 1:48:45 PM (7 years ago)
- Location:
- trunk/kernel/devices
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/devices/dev_pic.c
r200 r201 8 8 * This file is part of ALMOS-MKH. 9 9 * 10 * ALMOS-MKH .is free software; you can redistribute it and/or modify it10 * ALMOS-MKH is free software; you can redistribute it and/or modify it 11 11 * under the terms of the GNU General Public License as published by 12 12 * the Free Software Foundation; version 2.0 of the License. 13 13 * 14 * ALMOS-MKH .is distributed in the hope that it will be useful, but14 * ALMOS-MKH is distributed in the hope that it will be useful, but 15 15 * WITHOUT ANY WARRANTY; without even the implied warranty of 16 16 * MERCHANTABILITY or FITNESS FOR A PARTPICLAR PURPOSE. See the GNU … … 18 18 * 19 19 * You should have received a copy of the GNU General Public License 20 * along with ALMOS-MKH .; if not, write to the Free Software Foundation,20 * along with ALMOS-MKH; if not, write to the Free Software Foundation, 21 21 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 22 22 */ … … 39 39 void dev_pic_init( chdev_t * pic ) 40 40 { 41 // get implementation 41 // get implementation 42 42 uint32_t impl = pic->impl; 43 43 … … 70 70 71 71 // get pointer on extend_init function 72 pic_init_t * f = hal_remote_lpt( XPTR( pic_cxy , &pic_ptr->ext.pic.extend_init ) ); 72 pic_init_t * f = hal_remote_lpt( XPTR( pic_cxy , &pic_ptr->ext.pic.extend_init ) ); 73 73 74 74 // call relevant driver function … … 81 81 { 82 82 // get pointer on PIC chdev 83 chdev_t * pic = (chdev_t *)GET_PTR( chdev_dir.pic ); 83 chdev_t * pic_ptr = (chdev_t *)GET_PTR( chdev_dir.pic ); 84 cxy_t pic_cxy = GET_CXY( chdev_dir.pic ); 85 86 // get pointer on bind_irq function 87 pic_bind_t * f = hal_remote_lpt( XPTR( pic_cxy , &pic_ptr->ext.pic.bind_irq ) ); 84 88 85 89 // call relevant driver function 86 pic->ext.pic.bind_irq( lid , src_chdev );87 } 90 f( lid , src_chdev ); 91 } 88 92 89 93 /////////////////////////////////////// … … 92 96 { 93 97 // get pointer on PIC chdev 94 chdev_t * pic = (chdev_t *)GET_PTR( chdev_dir.pic ); 98 chdev_t * pic_ptr = (chdev_t *)GET_PTR( chdev_dir.pic ); 99 cxy_t pic_cxy = GET_CXY( chdev_dir.pic ); 100 101 // get pointer on enable_irq function 102 pic_enable_t * f = hal_remote_lpt( XPTR( pic_cxy , &pic_ptr->ext.pic.enable_irq ) ); 95 103 96 104 // call relevant driver function 97 pic->ext.pic.enable_irq( lid , src_chdev );105 f( lid , src_chdev ); 98 106 } 99 107 … … 103 111 { 104 112 // get pointer on PIC chdev 105 chdev_t * pic = (chdev_t *)GET_PTR( chdev_dir.pic ); 113 chdev_t * pic_ptr = (chdev_t *)GET_PTR( chdev_dir.pic ); 114 cxy_t pic_cxy = GET_CXY( chdev_dir.pic ); 115 116 // get pointer on disable_irq function 117 pic_disable_t * f = hal_remote_lpt( XPTR( pic_cxy , &pic_ptr->ext.pic.disable_irq ) ); 106 118 107 119 // call relevant driver function 108 pic->ext.pic.disable_irq( lid , src_chdev );120 f( lid , src_chdev ); 109 121 } 110 122 … … 113 125 { 114 126 // get pointer on PIC chdev 115 chdev_t * pic = (chdev_t *)GET_PTR( chdev_dir.pic ); 127 chdev_t * pic_ptr = (chdev_t *)GET_PTR( chdev_dir.pic ); 128 cxy_t pic_cxy = GET_CXY( chdev_dir.pic ); 129 130 // get pointer on enable_timer function 131 pic_timer_t * f = hal_remote_lpt( XPTR( pic_cxy , &pic_ptr->ext.pic.enable_timer ) ); 116 132 117 133 // call relevant driver function 118 pic->ext.pic.enable_timer( period );134 f( period ); 119 135 } 120 136 … … 124 140 { 125 141 // get pointer on PIC chdev 126 chdev_t * pic = (chdev_t *)GET_PTR( chdev_dir.pic ); 142 chdev_t * pic_ptr = (chdev_t *)GET_PTR( chdev_dir.pic ); 143 cxy_t pic_cxy = GET_CXY( chdev_dir.pic ); 144 145 // get pointer on send_ipi function 146 pic_ipi_t * f = hal_remote_lpt( XPTR( pic_cxy , &pic_ptr->ext.pic.send_ipi ) ); 127 147 128 148 // call relevant driver function 129 pic->ext.pic.send_ipi( cxy , lid );149 f( cxy , lid ); 130 150 } 131 151 132 -
trunk/kernel/devices/dev_pic.h
r188 r201 84 84 85 85 typedef void (pic_bind_t) ( lid_t lid , struct chdev_s * src_chdev ); 86 typedef void (pic_enable_t) ( struct chdev_s * src_chdev );87 typedef void (pic_disable_t) ( struct chdev_s * src_chdev );86 typedef void (pic_enable_t) ( lid_t lid , struct chdev_s * src_chdev ); 87 typedef void (pic_disable_t) ( lid_t lid , struct chdev_s * src_chdev ); 88 88 typedef void (pic_timer_t) ( uint32_t period ); 89 89 typedef void (pic_ipi_t) ( cxy_t cxy , lid_t lid );
Note: See TracChangeset
for help on using the changeset viewer.