Changeset 683 for trunk/kernel/kern/chdev.c
- Timestamp:
- Jan 13, 2021, 12:36:17 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/kern/chdev.c
r669 r683 87 87 { 88 88 chdev_t * chdev; 89 kmem_req_t req;90 89 91 90 // allocate memory for chdev 92 req.type = KMEM_KCM; 93 req.order = bits_log2( sizeof(chdev_t) ); 94 req.flags = AF_ZERO | AF_KERNEL; 95 chdev = kmem_alloc( &req ); 91 chdev = kmem_alloc( bits_log2(sizeof(chdev_t)) , AF_ZERO | AF_KERNEL ); 96 92 97 93 if( chdev == NULL ) return NULL; … … 114 110 } // end chdev_create() 115 111 116 /////////////////////////////////// 117 void chdev_print( chdev_t * chdev ) 118 { 119 printk("\n - func = %s" 120 "\n - channel = %d" 121 "\n - base = %l" 112 ///////////////////////////////////// 113 void chdev_display( xptr_t chdev_xp ) 114 { 115 chdev_t * chdev = GET_PTR( chdev_xp ); 116 cxy_t cxy = GET_CXY( chdev_xp ); 117 118 char name[16]; 119 120 hal_remote_memcpy( XPTR( local_cxy, name ), 121 XPTR( cxy , &chdev->name ), 16 ); 122 123 printk("\n - chdev = [%x,%x]" 124 "\n - name = %s" 125 "\n - base = [%x,%x]" 122 126 "\n - cmd = %x" 123 "\n - isr = %x" 124 "\n - chdev = %x\n", 125 chdev_func_str(chdev->func), 126 chdev->channel, 127 chdev->base, 128 chdev->cmd, 129 chdev->isr, 130 chdev ); 131 } 127 "\n - isr = %x\n", 128 cxy, 129 chdev, 130 name, 131 GET_CXY( hal_remote_l64( XPTR( cxy , &chdev->base ))), 132 GET_PTR( hal_remote_l64( XPTR( cxy , &chdev->base ))), 133 hal_remote_lpt( XPTR( cxy , &chdev->cmd )), 134 hal_remote_lpt( XPTR( cxy , &chdev->isr )) ); 135 136 } // end chdev_display() 132 137 133 138 ////////////////////////////////////////////////// … … 450 455 chdev_t * chdev_ptr; 451 456 452 453 "file_xp == XPTR_NULL\n" );457 assert( __FUNCTION__, (file_xp != XPTR_NULL) , 458 "file_xp == XPTR_NULL" ); 454 459 455 460 // get cluster and local pointer on remote file descriptor … … 462 467 inode_ptr = (vfs_inode_t *)hal_remote_lpt( XPTR( file_cxy , &file_ptr->inode ) ); 463 468 464 465 "inode type %d is not FILE_TYPE_DEV\n", inode_type );469 assert( __FUNCTION__, (inode_type == FILE_TYPE_DEV) , 470 "inode type %d is not FILE_TYPE_DEV", inode_type ); 466 471 467 472 // get chdev local pointer from inode extension
Note: See TracChangeset
for help on using the changeset viewer.