[5] | 1 | /* |
---|
| 2 | * chdev.c - channel device descriptor operations implementation. |
---|
| 3 | * |
---|
| 4 | * Authors Alain Greiner (2016) |
---|
| 5 | * |
---|
| 6 | * Copyright (c) UPMC Sorbonne Universites |
---|
| 7 | * |
---|
| 8 | * This file is part of ALMOS-MKH. |
---|
| 9 | * |
---|
| 10 | * ALMOS-MKH.is free software; you can redistribute it and/or modify it |
---|
| 11 | * under the terms of the GNU General Public License as published by |
---|
| 12 | * the Free Software Foundation; version 2.0 of the License. |
---|
| 13 | * |
---|
| 14 | * ALMOS-MKH.is distributed in the hope that it will be useful, but |
---|
| 15 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
| 17 | * General Public License for more details. |
---|
| 18 | * |
---|
| 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, |
---|
| 21 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
---|
| 22 | */ |
---|
| 23 | |
---|
[14] | 24 | #include <kernel_config.h> |
---|
[5] | 25 | #include <hal_types.h> |
---|
| 26 | #include <hal_special.h> |
---|
[407] | 27 | #include <hal_irqmask.h> |
---|
[16] | 28 | #include <printk.h> |
---|
[5] | 29 | #include <boot_info.h> |
---|
| 30 | #include <xlist.h> |
---|
| 31 | #include <kmem.h> |
---|
[407] | 32 | #include <scheduler.h> |
---|
[5] | 33 | #include <thread.h> |
---|
| 34 | #include <rpc.h> |
---|
| 35 | #include <chdev.h> |
---|
[23] | 36 | #include <devfs.h> |
---|
[5] | 37 | |
---|
[317] | 38 | |
---|
| 39 | extern chdev_directory_t chdev_dir; // allocated in kernel_init.c |
---|
| 40 | |
---|
[435] | 41 | #if (CONFIG_DEBUG_SYS_READ & 1) |
---|
| 42 | extern uint32_t enter_chdev_cmd_read; |
---|
| 43 | extern uint32_t exit_chdev_cmd_read; |
---|
| 44 | extern uint32_t enter_chdev_server_read; |
---|
| 45 | extern uint32_t exit_chdev_server_read; |
---|
[407] | 46 | #endif |
---|
[317] | 47 | |
---|
[435] | 48 | #if (CONFIG_DEBUG_SYS_WRITE & 1) |
---|
| 49 | extern uint32_t enter_chdev_cmd_write; |
---|
| 50 | extern uint32_t exit_chdev_cmd_write; |
---|
| 51 | extern uint32_t enter_chdev_server_write; |
---|
| 52 | extern uint32_t exit_chdev_server_write; |
---|
| 53 | #endif |
---|
| 54 | |
---|
[5] | 55 | //////////////////////////////////////////// |
---|
| 56 | char * chdev_func_str( uint32_t func_type ) |
---|
| 57 | { |
---|
| 58 | if ( func_type == DEV_FUNC_RAM ) return "RAM"; |
---|
| 59 | else if( func_type == DEV_FUNC_ROM ) return "ROM"; |
---|
| 60 | else if( func_type == DEV_FUNC_FBF ) return "FBF"; |
---|
| 61 | else if( func_type == DEV_FUNC_IOB ) return "IOB"; |
---|
| 62 | else if( func_type == DEV_FUNC_IOC ) return "IOC"; |
---|
| 63 | else if( func_type == DEV_FUNC_MMC ) return "MMC"; |
---|
| 64 | else if( func_type == DEV_FUNC_DMA ) return "DMA"; |
---|
| 65 | else if( func_type == DEV_FUNC_NIC ) return "NIC"; |
---|
| 66 | else if( func_type == DEV_FUNC_TIM ) return "TIM"; |
---|
| 67 | else if( func_type == DEV_FUNC_TXT ) return "TXT"; |
---|
| 68 | else if( func_type == DEV_FUNC_ICU ) return "ICU"; |
---|
| 69 | else if( func_type == DEV_FUNC_PIC ) return "PIC"; |
---|
[16] | 70 | else return "undefined"; |
---|
[5] | 71 | } |
---|
| 72 | |
---|
| 73 | ///////////////////////////////////////// |
---|
| 74 | chdev_t * chdev_create( uint32_t func, |
---|
| 75 | uint32_t impl, |
---|
| 76 | uint32_t channel, |
---|
| 77 | uint32_t is_rx, |
---|
| 78 | xptr_t base ) |
---|
| 79 | { |
---|
| 80 | chdev_t * chdev; |
---|
| 81 | kmem_req_t req; |
---|
| 82 | |
---|
| 83 | // allocate memory for chdev |
---|
| 84 | req.type = KMEM_DEVICE; |
---|
| 85 | req.flags = AF_ZERO; |
---|
| 86 | chdev = (chdev_t *)kmem_alloc( &req ); |
---|
| 87 | |
---|
| 88 | if( chdev == NULL ) return NULL; |
---|
| 89 | |
---|
| 90 | // initialize waiting threads queue and associated lock |
---|
| 91 | remote_spinlock_init( XPTR( local_cxy , &chdev->wait_lock ) ); |
---|
| 92 | xlist_root_init( XPTR( local_cxy , &chdev->wait_root ) ); |
---|
| 93 | |
---|
| 94 | // initialize attributes |
---|
| 95 | chdev->func = func; |
---|
| 96 | chdev->impl = impl; |
---|
| 97 | chdev->channel = channel; |
---|
| 98 | chdev->is_rx = is_rx; |
---|
| 99 | chdev->base = base; |
---|
| 100 | |
---|
| 101 | return chdev; |
---|
| 102 | |
---|
| 103 | } // end chdev_create() |
---|
| 104 | |
---|
| 105 | /////////////////////////////////// |
---|
| 106 | void chdev_print( chdev_t * chdev ) |
---|
| 107 | { |
---|
| 108 | printk("\n - func = %s" |
---|
| 109 | "\n - channel = %d" |
---|
| 110 | "\n - base = %l" |
---|
| 111 | "\n - cmd = %x" |
---|
| 112 | "\n - isr = %x" |
---|
| 113 | "\n - chdev = %x\n", |
---|
| 114 | chdev_func_str(chdev->func), |
---|
| 115 | chdev->channel, |
---|
| 116 | chdev->base, |
---|
| 117 | chdev->cmd, |
---|
| 118 | chdev->isr, |
---|
| 119 | chdev ); |
---|
| 120 | } |
---|
| 121 | |
---|
[407] | 122 | ////////////////////////////////////////////////// |
---|
| 123 | void chdev_register_command( xptr_t chdev_xp ) |
---|
[5] | 124 | { |
---|
[407] | 125 | thread_t * server_ptr; // local pointer on server thread associated to chdev |
---|
| 126 | core_t * core_ptr; // local pointer on core running the server thread |
---|
| 127 | uint32_t lid; // core running the server thread local index |
---|
| 128 | xptr_t lock_xp; // extended pointer on lock protecting the chdev queue |
---|
[408] | 129 | uint32_t different; // non zero if server thread core != client thread core |
---|
[407] | 130 | uint32_t save_sr; // for critical section |
---|
[5] | 131 | |
---|
[435] | 132 | #if (CONFIG_DEBUG_SYS_READ & 1) |
---|
| 133 | enter_chdev_cmd_read = (uint32_t)hal_get_cycles(); |
---|
[418] | 134 | #endif |
---|
| 135 | |
---|
[435] | 136 | #if (CONFIG_DEBUG_SYS_WRITE & 1) |
---|
| 137 | enter_chdev_cmd_write = (uint32_t)hal_get_cycles(); |
---|
| 138 | #endif |
---|
| 139 | |
---|
[407] | 140 | thread_t * this = CURRENT_THREAD; |
---|
| 141 | |
---|
[433] | 142 | #if CONFIG_DEBUG_CHDEV_REGISTER_COMMAND |
---|
| 143 | uint32_t cycle = (uint32_t)hal_get_cycles(); |
---|
| 144 | if( CONFIG_DEBUG_CHDEV_REGISTER_COMMAND < cycle ) |
---|
| 145 | printk("\n[DBG] %s : client_thread %x (%s) enter / cycle %d\n", |
---|
| 146 | __FUNCTION__, this, thread_type_str(this->type) , cycle ); |
---|
| 147 | #endif |
---|
[407] | 148 | |
---|
[5] | 149 | // get device descriptor cluster and local pointer |
---|
| 150 | cxy_t chdev_cxy = GET_CXY( chdev_xp ); |
---|
| 151 | chdev_t * chdev_ptr = (chdev_t *)GET_PTR( chdev_xp ); |
---|
| 152 | |
---|
| 153 | // build extended pointers on client thread xlist and device root |
---|
[407] | 154 | xptr_t list_xp = XPTR( local_cxy , &this->wait_list ); |
---|
| 155 | xptr_t root_xp = XPTR( chdev_cxy , &chdev_ptr->wait_root ); |
---|
[5] | 156 | |
---|
[407] | 157 | // get local pointer on server thread |
---|
| 158 | server_ptr = (thread_t *)hal_remote_lpt( XPTR( chdev_cxy , &chdev_ptr->server) ); |
---|
[5] | 159 | |
---|
[407] | 160 | // build extended pointer on chdev lock protecting queue |
---|
| 161 | lock_xp = XPTR( chdev_cxy , &chdev_ptr->wait_lock ); |
---|
| 162 | |
---|
| 163 | // get local pointer on core running the server thread |
---|
| 164 | core_ptr = (core_t *)hal_remote_lpt( XPTR( chdev_cxy , &server_ptr->core ) ); |
---|
| 165 | |
---|
| 166 | // get core local index |
---|
| 167 | lid = hal_remote_lw( XPTR( chdev_cxy , &core_ptr->lid ) ); |
---|
| 168 | |
---|
[408] | 169 | // compute server core != thread core |
---|
| 170 | different = (lid != this->core->lid) || (local_cxy != chdev_cxy); |
---|
| 171 | |
---|
| 172 | // enter critical section to make atomic : |
---|
| 173 | // (1) client blocking |
---|
| 174 | // (2) client registration in server queue |
---|
| 175 | // (3) IPI to force server scheduling |
---|
| 176 | // (4) descheduling |
---|
| 177 | // ... in this order |
---|
[407] | 178 | hal_disable_irq( &save_sr ); |
---|
| 179 | |
---|
[408] | 180 | // block current thread |
---|
| 181 | thread_block( CURRENT_THREAD , THREAD_BLOCKED_IO ); |
---|
| 182 | |
---|
[5] | 183 | // register client thread in waiting queue |
---|
[407] | 184 | remote_spinlock_lock( lock_xp ); |
---|
| 185 | xlist_add_last( root_xp , list_xp ); |
---|
| 186 | remote_spinlock_unlock( lock_xp ); |
---|
[5] | 187 | |
---|
[408] | 188 | // send IPI to core running the server thread if required |
---|
| 189 | if( different ) dev_pic_send_ipi( chdev_cxy , lid ); |
---|
[407] | 190 | |
---|
[408] | 191 | // deschedule |
---|
| 192 | assert( thread_can_yield( this ) , __FUNCTION__ , "illegal sched_yield\n" ); |
---|
| 193 | sched_yield("blocked on I/O"); |
---|
[407] | 194 | |
---|
| 195 | // exit critical section |
---|
| 196 | hal_restore_irq( save_sr ); |
---|
| 197 | |
---|
[433] | 198 | #if CONFIG_DEBUG_CHDEV_REGISTER_COMMAND |
---|
| 199 | cycle = (uint32_t)hal_get_cycles(); |
---|
| 200 | if( CONFIG_DEBUG_CHDEV_REGISTER_COMMAND < cycle ) |
---|
[435] | 201 | printk("\n[DBG] %s : client_thread %x (%s) exit / cycle %d\n", |
---|
[433] | 202 | __FUNCTION__, this, thread_type_str(this->type) , cycle ); |
---|
| 203 | #endif |
---|
| 204 | |
---|
[435] | 205 | #if (CONFIG_DEBUG_SYS_READ & 1) |
---|
| 206 | exit_chdev_cmd_read = (uint32_t)hal_get_cycles(); |
---|
[418] | 207 | #endif |
---|
| 208 | |
---|
[435] | 209 | #if (CONFIG_DEBUG_SYS_WRITE & 1) |
---|
| 210 | exit_chdev_cmd_write = (uint32_t)hal_get_cycles(); |
---|
| 211 | #endif |
---|
| 212 | |
---|
[5] | 213 | } // end chdev_register_command() |
---|
| 214 | |
---|
| 215 | /////////////////////////////////////////////// |
---|
| 216 | void chdev_sequencial_server( chdev_t * chdev ) |
---|
| 217 | { |
---|
| 218 | xptr_t client_xp; // extended pointer on waiting thread |
---|
| 219 | cxy_t client_cxy; // cluster of client thread |
---|
| 220 | thread_t * client_ptr; // local pointer on client thread |
---|
[407] | 221 | thread_t * server; // local pointer on server thread |
---|
[5] | 222 | xptr_t root_xp; // extended pointer on device waiting queue root |
---|
[407] | 223 | xptr_t lock_xp; // extended pointer on lock ptotecting chdev queue |
---|
[5] | 224 | |
---|
| 225 | server = CURRENT_THREAD; |
---|
| 226 | |
---|
[433] | 227 | #if CONFIG_DEBUG_CHDEV_SEQUENCIAL_SERVER |
---|
| 228 | uint32_t cycle = (uint32_t)hal_get_cycles(); |
---|
| 229 | if( CONFIG_DEBUG_CHDEV_SEQUENCIAL_SERVER < cycle ) |
---|
| 230 | printk("\n[DBG] %s : server_thread %x enter / chdev = %x / cycle %d\n", |
---|
| 231 | __FUNCTION__ , server , chdev , cycle ); |
---|
| 232 | #endif |
---|
[407] | 233 | |
---|
[5] | 234 | root_xp = XPTR( local_cxy , &chdev->wait_root ); |
---|
[407] | 235 | lock_xp = XPTR( local_cxy , &chdev->wait_lock ); |
---|
[5] | 236 | |
---|
[407] | 237 | // This infinite loop is executed by the DEV thread |
---|
| 238 | // to handle commands registered in the chdev queue. |
---|
[5] | 239 | while( 1 ) |
---|
| 240 | { |
---|
[407] | 241 | // get the lock protecting the waiting queue |
---|
| 242 | remote_spinlock_lock( lock_xp ); |
---|
| 243 | |
---|
[5] | 244 | // check waiting queue state |
---|
[407] | 245 | if( xlist_is_empty( root_xp ) ) // waiting queue empty |
---|
[5] | 246 | { |
---|
| 247 | // release lock |
---|
[407] | 248 | remote_spinlock_unlock( lock_xp ); |
---|
[5] | 249 | |
---|
[408] | 250 | // deschedule |
---|
| 251 | sched_yield("I/O queue empty"); |
---|
[5] | 252 | } |
---|
[407] | 253 | else // waiting queue not empty |
---|
[5] | 254 | { |
---|
[407] | 255 | |
---|
[435] | 256 | #if (CONFIG_DEBUG_SYS_READ & 1) |
---|
| 257 | enter_chdev_server_read = (uint32_t)hal_get_cycles(); |
---|
[407] | 258 | #endif |
---|
[435] | 259 | |
---|
| 260 | #if (CONFIG_DEBUG_SYS_WRITE & 1) |
---|
| 261 | enter_chdev_server_write = (uint32_t)hal_get_cycles(); |
---|
| 262 | #endif |
---|
| 263 | |
---|
[5] | 264 | // release lock |
---|
[407] | 265 | remote_spinlock_unlock( lock_xp ); |
---|
[5] | 266 | |
---|
[407] | 267 | // get extended pointer on first client thread |
---|
| 268 | client_xp = XLIST_FIRST_ELEMENT( root_xp , thread_t , wait_list ); |
---|
[5] | 269 | |
---|
[407] | 270 | // get client thread cluster, local pointer, and identifier |
---|
| 271 | client_cxy = GET_CXY( client_xp ); |
---|
| 272 | client_ptr = (thread_t *)GET_PTR( client_xp ); |
---|
| 273 | |
---|
| 274 | // call driver command function to execute I/O operation |
---|
| 275 | chdev->cmd( client_xp ); |
---|
[5] | 276 | |
---|
[407] | 277 | // remove the client thread from waiting queue |
---|
| 278 | remote_spinlock_lock( lock_xp ); |
---|
| 279 | xlist_unlink( XPTR( client_cxy , &client_ptr->wait_list ) ); |
---|
| 280 | remote_spinlock_unlock( lock_xp ); |
---|
[5] | 281 | |
---|
[418] | 282 | // unblock client thread |
---|
| 283 | thread_unblock( client_xp , THREAD_BLOCKED_IO ); |
---|
| 284 | |
---|
[433] | 285 | #if CONFIG_DEBUG_CHDEV_SEQUENCIAL_SERVER |
---|
| 286 | cycle = (uint32_t)hal_get_cycles(); |
---|
| 287 | if( CONFIG_DEBUG_CHDEV_SEQUENCIAL_SERVER < cycle ) |
---|
| 288 | printk("\n[DBG] %s : server_thread %x complete operation for client %x / cycle %d\n", |
---|
| 289 | __FUNCTION__ , server , client_ptr , cycle ); |
---|
| 290 | #endif |
---|
[5] | 291 | |
---|
[435] | 292 | #if (CONFIG_DEBUG_SYS_READ & 1) |
---|
| 293 | exit_chdev_server_read = (uint32_t)hal_get_cycles(); |
---|
[407] | 294 | #endif |
---|
| 295 | |
---|
[435] | 296 | #if (CONFIG_DEBUG_SYS_WRITE & 1) |
---|
| 297 | exit_chdev_server_write = (uint32_t)hal_get_cycles(); |
---|
| 298 | #endif |
---|
| 299 | |
---|
[407] | 300 | } |
---|
[5] | 301 | } // end while |
---|
| 302 | } // end chdev_sequencial_server() |
---|
| 303 | |
---|
[428] | 304 | //////////////////////////////////////// |
---|
| 305 | xptr_t chdev_from_file( xptr_t file_xp ) |
---|
| 306 | { |
---|
| 307 | cxy_t file_cxy; |
---|
| 308 | vfs_file_t * file_ptr; |
---|
| 309 | uint32_t inode_type; |
---|
| 310 | vfs_inode_t * inode_ptr; |
---|
| 311 | chdev_t * chdev_ptr; |
---|
| 312 | |
---|
| 313 | // get cluster and local pointer on remote file descriptor |
---|
| 314 | // associated inode and chdev are stored in same cluster as the file desc. |
---|
| 315 | file_cxy = GET_CXY( file_xp ); |
---|
| 316 | file_ptr = (vfs_file_t *)GET_PTR( file_xp ); |
---|
| 317 | |
---|
| 318 | // get inode type from file descriptor |
---|
| 319 | inode_type = hal_remote_lw( XPTR( file_cxy , &file_ptr->type ) ); |
---|
| 320 | inode_ptr = (vfs_inode_t *)hal_remote_lpt( XPTR( file_cxy , &file_ptr->inode ) ); |
---|
| 321 | |
---|
| 322 | assert( (inode_type == INODE_TYPE_DEV) , __FUNCTION__ , |
---|
| 323 | "inode type %d is not INODE_TYPE_DEV", inode_type ); |
---|
| 324 | |
---|
| 325 | // get chdev local pointer from inode extension |
---|
| 326 | chdev_ptr = (chdev_t *)hal_remote_lpt( XPTR( file_cxy , &inode_ptr->extend ) ); |
---|
| 327 | |
---|
| 328 | return XPTR( file_cxy , chdev_ptr ); |
---|
| 329 | |
---|
| 330 | } // end chdev_from_file() |
---|
| 331 | |
---|
[317] | 332 | //////////////////////// |
---|
| 333 | void chdev_dir_display() |
---|
| 334 | { |
---|
[428] | 335 | uint32_t i; |
---|
| 336 | cxy_t cxy; |
---|
| 337 | chdev_t * ptr; |
---|
| 338 | uint32_t base; |
---|
| 339 | reg_t save_sr; |
---|
[317] | 340 | |
---|
[428] | 341 | // get pointers on TXT0 chdev |
---|
| 342 | xptr_t txt0_xp = chdev_dir.txt_tx[0]; |
---|
| 343 | cxy_t txt0_cxy = GET_CXY( txt0_xp ); |
---|
| 344 | chdev_t * txt0_ptr = GET_PTR( txt0_xp ); |
---|
[317] | 345 | |
---|
[428] | 346 | // get extended pointer on remote TXT0 chdev lock |
---|
| 347 | xptr_t lock_xp = XPTR( txt0_cxy , &txt0_ptr->wait_lock ); |
---|
[317] | 348 | |
---|
[428] | 349 | // get TXT0 lock in busy waiting mode |
---|
| 350 | remote_spinlock_lock_busy( lock_xp , &save_sr ); |
---|
[317] | 351 | |
---|
[428] | 352 | // header |
---|
| 353 | nolock_printk("\n***** external chdevs directory *****\n"); |
---|
[317] | 354 | |
---|
[428] | 355 | // IOB |
---|
| 356 | cxy = GET_CXY( chdev_dir.iob ); |
---|
| 357 | ptr = GET_PTR( chdev_dir.iob ); |
---|
| 358 | base = (uint32_t)hal_remote_lwd( XPTR( cxy , &ptr->base ) ); |
---|
| 359 | nolock_printk(" - iob : cxy = %X / ptr = %X / base = %X\n", cxy, ptr, base); |
---|
[407] | 360 | |
---|
[428] | 361 | // PIC |
---|
| 362 | cxy = GET_CXY( chdev_dir.pic ); |
---|
| 363 | ptr = GET_PTR( chdev_dir.pic ); |
---|
| 364 | base = (uint32_t)hal_remote_lwd( XPTR( cxy , &ptr->base ) ); |
---|
| 365 | nolock_printk(" - pic : cxy = %X / ptr = %X / base = %X\n", cxy, ptr, base); |
---|
[407] | 366 | |
---|
[428] | 367 | // TXT |
---|
| 368 | for( i = 0 ; i < LOCAL_CLUSTER->nb_txt_channels ; i++ ) |
---|
| 369 | { |
---|
| 370 | cxy = GET_CXY( chdev_dir.txt_rx[i] ); |
---|
| 371 | ptr = GET_PTR( chdev_dir.txt_rx[i] ); |
---|
| 372 | base = (uint32_t)hal_remote_lwd( XPTR( cxy , &ptr->base ) ); |
---|
| 373 | nolock_printk(" - txt_rx[%d] : cxy = %X / ptr = %X / base = %X\n", i, cxy, ptr, base); |
---|
[407] | 374 | |
---|
[428] | 375 | cxy = GET_CXY( chdev_dir.txt_tx[i] ); |
---|
| 376 | ptr = GET_PTR( chdev_dir.txt_tx[i] ); |
---|
| 377 | base = (uint32_t)hal_remote_lwd( XPTR( cxy , &ptr->base ) ); |
---|
| 378 | nolock_printk(" - txt_tx[%d] : cxy = %X / ptr = %X / base = %X\n", i, cxy, ptr, base); |
---|
| 379 | } |
---|
[317] | 380 | |
---|
[428] | 381 | // IOC |
---|
| 382 | for( i = 0 ; i < LOCAL_CLUSTER->nb_ioc_channels ; i++ ) |
---|
| 383 | { |
---|
| 384 | cxy = GET_CXY( chdev_dir.ioc[i] ); |
---|
| 385 | ptr = GET_PTR( chdev_dir.ioc[i] ); |
---|
| 386 | base = (uint32_t)hal_remote_lwd( XPTR( cxy , &ptr->base ) ); |
---|
| 387 | nolock_printk(" - ioc[%d] : cxy = %X / ptr = %X / base = %X\n", i, cxy, ptr, base); |
---|
| 388 | } |
---|
[317] | 389 | |
---|
[428] | 390 | // FBF |
---|
| 391 | for( i = 0 ; i < LOCAL_CLUSTER->nb_fbf_channels ; i++ ) |
---|
| 392 | { |
---|
| 393 | cxy = GET_CXY( chdev_dir.fbf[i] ); |
---|
| 394 | ptr = GET_PTR( chdev_dir.fbf[i] ); |
---|
| 395 | base = (uint32_t)hal_remote_lwd( XPTR( cxy , &ptr->base ) ); |
---|
| 396 | nolock_printk(" - fbf[%d] : cxy = %X / ptr = %X / base = %X\n", i, cxy, ptr, base); |
---|
| 397 | } |
---|
[317] | 398 | |
---|
[428] | 399 | // NIC |
---|
| 400 | for( i = 0 ; i < LOCAL_CLUSTER->nb_nic_channels ; i++ ) |
---|
| 401 | { |
---|
| 402 | cxy = GET_CXY( chdev_dir.nic_rx[i] ); |
---|
| 403 | ptr = GET_PTR( chdev_dir.nic_rx[i] ); |
---|
| 404 | base = (uint32_t)hal_remote_lwd( XPTR( cxy , &ptr->base ) ); |
---|
| 405 | nolock_printk(" - nic_rx[%d] : cxy = %X / ptr = %X / base = %X\n", i, cxy, ptr, base); |
---|
[317] | 406 | |
---|
[428] | 407 | cxy = GET_CXY( chdev_dir.nic_tx[i] ); |
---|
| 408 | ptr = GET_PTR( chdev_dir.nic_tx[i] ); |
---|
| 409 | base = (uint32_t)hal_remote_lwd( XPTR( cxy , &ptr->base ) ); |
---|
| 410 | nolock_printk(" - nic_tx[%d] : cxy = %X / ptr = %X / base = %X\n", i, cxy, ptr, base); |
---|
| 411 | } |
---|
[317] | 412 | |
---|
[428] | 413 | // release lock |
---|
| 414 | remote_spinlock_unlock_busy( lock_xp , save_sr ); |
---|
| 415 | |
---|
[317] | 416 | } // end chdev_dir_display() |
---|
| 417 | |
---|