| [158] | 1 | /////////////////////////////////////////////////////////////////////////////////// |
|---|
| 2 | // File : common.c |
|---|
| 3 | // Date : 01/04/2012 |
|---|
| 4 | // Author : alain greiner and joel porquet |
|---|
| 5 | // Copyright (c) UPMC-LIP6 |
|---|
| 6 | /////////////////////////////////////////////////////////////////////////////////// |
|---|
| 7 | // The common.c and common.h files are part of the GIET nano-kernel. |
|---|
| 8 | // They contains various utilities functions. |
|---|
| 9 | /////////////////////////////////////////////////////////////////////////////////// |
|---|
| 10 | |
|---|
| [165] | 11 | #include <sys_handler.h> |
|---|
| [158] | 12 | #include <common.h> |
|---|
| [189] | 13 | #include <ctx_handler.h> |
|---|
| [158] | 14 | #include <drivers.h> |
|---|
| [207] | 15 | #include <hwr_mapping.h> |
|---|
| [158] | 16 | #include <stdarg.h> |
|---|
| 17 | |
|---|
| [189] | 18 | /////////////////////////////////////////////////////////////////////////////////// |
|---|
| 19 | // Global variables |
|---|
| 20 | /////////////////////////////////////////////////////////////////////////////////// |
|---|
| 21 | |
|---|
| 22 | // current context cache TODO |
|---|
| 23 | |
|---|
| 24 | // SR save (used by _it_mask() / it_restore() |
|---|
| 25 | unsigned int _status_register_save; |
|---|
| 26 | |
|---|
| 27 | /////////////////////////////////////////////////////////////////////////////////// |
|---|
| 28 | // _get_sched() |
|---|
| 29 | // Access CP0 and returns scheduler physical address. |
|---|
| 30 | /////////////////////////////////////////////////////////////////////////////////// |
|---|
| 31 | inline unsigned int _get_sched() |
|---|
| 32 | { |
|---|
| 33 | unsigned int ret; |
|---|
| 34 | asm volatile ( "mfc0 %0, $22" |
|---|
| 35 | : "=r"(ret) ); |
|---|
| 36 | return ret; |
|---|
| 37 | } |
|---|
| 38 | /////////////////////////////////////////////////////////////////////////////////// |
|---|
| 39 | // _get_ptpr() |
|---|
| 40 | // Access CP2 and returns PTPR register. |
|---|
| 41 | /////////////////////////////////////////////////////////////////////////////////// |
|---|
| 42 | inline unsigned int _get_ptpr() |
|---|
| 43 | { |
|---|
| 44 | unsigned int ret; |
|---|
| 45 | asm volatile ( "mfc2 %0, $0" |
|---|
| 46 | : "=r"(ret) ); |
|---|
| 47 | return ret; |
|---|
| 48 | } |
|---|
| 49 | /////////////////////////////////////////////////////////////////////////////////// |
|---|
| 50 | // _get_epc() |
|---|
| 51 | // Access CP0 and returns EPC register. |
|---|
| 52 | /////////////////////////////////////////////////////////////////////////////////// |
|---|
| 53 | inline unsigned int _get_epc() |
|---|
| 54 | { |
|---|
| 55 | unsigned int ret; |
|---|
| 56 | asm volatile ( "mfc0 %0, $14" |
|---|
| 57 | : "=r"(ret) ); |
|---|
| 58 | return ret; |
|---|
| 59 | } |
|---|
| 60 | /////////////////////////////////////////////////////////////////////////////////// |
|---|
| 61 | // _get_bar() |
|---|
| 62 | // Access CP0 and returns BAR register. |
|---|
| 63 | /////////////////////////////////////////////////////////////////////////////////// |
|---|
| 64 | inline unsigned int _get_bvar() |
|---|
| 65 | { |
|---|
| 66 | unsigned int ret; |
|---|
| 67 | asm volatile ( "mfc0 %0, $8" |
|---|
| 68 | : "=r"(ret) ); |
|---|
| 69 | return ret; |
|---|
| 70 | } |
|---|
| 71 | /////////////////////////////////////////////////////////////////////////////////// |
|---|
| 72 | // _get_cr() |
|---|
| 73 | // Access CP0 and returns CR register. |
|---|
| 74 | /////////////////////////////////////////////////////////////////////////////////// |
|---|
| 75 | inline unsigned int _get_cause() |
|---|
| 76 | { |
|---|
| 77 | unsigned int ret; |
|---|
| 78 | asm volatile ( "mfc0 %0, $13" |
|---|
| 79 | : "=r"(ret) ); |
|---|
| 80 | return ret; |
|---|
| 81 | } |
|---|
| 82 | /////////////////////////////////////////////////////////////////////////////////// |
|---|
| 83 | // _get_sr() |
|---|
| 84 | // Access CP0 and returns SR register. |
|---|
| 85 | /////////////////////////////////////////////////////////////////////////////////// |
|---|
| 86 | inline unsigned int _get_sr() |
|---|
| 87 | { |
|---|
| 88 | unsigned int ret; |
|---|
| 89 | asm volatile ( "mfc0 %0, $12" |
|---|
| 90 | : "=r"(ret) ); |
|---|
| 91 | return ret; |
|---|
| 92 | } |
|---|
| 93 | /////////////////////////////////////////////////////////////////////////////////// |
|---|
| 94 | // _it_mask() |
|---|
| 95 | // Access CP0 and mask IRQs |
|---|
| 96 | /////////////////////////////////////////////////////////////////////////////////// |
|---|
| 97 | inline void _it_mask() |
|---|
| 98 | { |
|---|
| 99 | unsigned int sr_value; |
|---|
| 100 | asm volatile( "li $3, 0xFFFFFFFE \n" |
|---|
| 101 | "mfc0 %0, $12 \n" |
|---|
| 102 | "and $3, $3, %0 \n" |
|---|
| 103 | "mtc0 $3, $12 \n" |
|---|
| 104 | : "=r"(sr_value) : : "$3" ); |
|---|
| 105 | _status_register_save = sr_value; |
|---|
| 106 | } |
|---|
| 107 | /////////////////////////////////////////////////////////////////////////////////// |
|---|
| 108 | // _it_enable() |
|---|
| 109 | // Access CP0 and enable IRQs |
|---|
| 110 | /////////////////////////////////////////////////////////////////////////////////// |
|---|
| 111 | inline void _it_restore() |
|---|
| 112 | { |
|---|
| 113 | unsigned int sr_value = _status_register_save; |
|---|
| 114 | asm volatile( "mtc0 %0, $12 \n" |
|---|
| 115 | : : "r"(sr_value) ); |
|---|
| 116 | } |
|---|
| [158] | 117 | //////////////////////////////////////////////////////////////////////////// |
|---|
| [189] | 118 | // _get_lock() |
|---|
| 119 | // Takes a lock with an ll/sc atomic access. |
|---|
| 120 | // A pseudo random delay is introduced before retry in case of miss |
|---|
| 121 | // (delay average value = 100 cycles) |
|---|
| [165] | 122 | //////////////////////////////////////////////////////////////////////////// |
|---|
| 123 | inline void _get_lock( unsigned int* plock ) |
|---|
| 124 | { |
|---|
| [189] | 125 | register unsigned int delay = ( _proctime() ^ _procid()<<4 ) & 0xFF; |
|---|
| [165] | 126 | |
|---|
| 127 | asm volatile ( |
|---|
| 128 | "_lock_llsc: \n" |
|---|
| 129 | "ll $2, 0(%0) \n" /* $2 <= _ioc_lock current value */ |
|---|
| 130 | "bnez $2, _lock_delay \n" /* delay if _ioc_lock already taken */ |
|---|
| 131 | "li $3, 1 \n" /* $3 <= argument for sc */ |
|---|
| 132 | "sc $3, 0(%0) \n" /* try to set _ioc_lock */ |
|---|
| 133 | "bnez $3, _lock_ok \n" /* exit if atomic */ |
|---|
| 134 | "_lock_delay: \n" |
|---|
| 135 | "move $4, %1 \n" /* $4 <= delay */ |
|---|
| 136 | "_lock_loop: \n" |
|---|
| 137 | "addi $4, $4, -1 \n" /* $4 <= $4 - 1 */ |
|---|
| 138 | "beqz $4, _lock_loop \n" /* test end delay */ |
|---|
| 139 | "j _lock_llsc \n" /* retry */ |
|---|
| 140 | "_lock_ok: \n" |
|---|
| 141 | : |
|---|
| 142 | :"r"(plock), "r"(delay) |
|---|
| 143 | :"$2", "$3", "$4"); |
|---|
| 144 | } |
|---|
| 145 | |
|---|
| 146 | //////////////////////////////////////////////////////////////////////////// |
|---|
| 147 | // _release_lock() |
|---|
| 148 | //////////////////////////////////////////////////////////////////////////// |
|---|
| 149 | inline void _release_lock( unsigned int* plock ) |
|---|
| 150 | { |
|---|
| 151 | *plock = 0; |
|---|
| 152 | } |
|---|
| 153 | |
|---|
| 154 | //////////////////////////////////////////////////////////////////////////// |
|---|
| [189] | 155 | // _puts() |
|---|
| [207] | 156 | // display a string on TTY0 / used for system code debug and log |
|---|
| [158] | 157 | //////////////////////////////////////////////////////////////////////////// |
|---|
| [207] | 158 | void _puts(char* buffer) |
|---|
| [158] | 159 | { |
|---|
| [215] | 160 | unsigned int* tty_address = (unsigned int*) &seg_tty_base; |
|---|
| [158] | 161 | unsigned int n; |
|---|
| 162 | |
|---|
| 163 | for ( n=0; n<100; n++) |
|---|
| 164 | { |
|---|
| 165 | if (buffer[n] == 0) break; |
|---|
| [207] | 166 | tty_address[TTY_WRITE] = (unsigned int)buffer[n]; |
|---|
| [158] | 167 | } |
|---|
| 168 | } |
|---|
| 169 | //////////////////////////////////////////////////////////////////////////// |
|---|
| [207] | 170 | // _putx() |
|---|
| [189] | 171 | // display an int (hexa) on TTY0 / used for system code debug and log |
|---|
| [158] | 172 | //////////////////////////////////////////////////////////////////////////// |
|---|
| [207] | 173 | void _putx(unsigned int val) |
|---|
| [158] | 174 | { |
|---|
| 175 | static const char HexaTab[] = "0123456789ABCDEF"; |
|---|
| 176 | char buf[11]; |
|---|
| 177 | unsigned int c; |
|---|
| 178 | |
|---|
| 179 | buf[0] = '0'; |
|---|
| 180 | buf[1] = 'x'; |
|---|
| 181 | buf[10] = 0; |
|---|
| 182 | |
|---|
| 183 | for ( c = 0 ; c < 8 ; c++ ) |
|---|
| 184 | { |
|---|
| 185 | buf[9-c] = HexaTab[val&0xF]; |
|---|
| 186 | val = val >> 4; |
|---|
| 187 | } |
|---|
| 188 | _puts(buf); |
|---|
| 189 | } |
|---|
| 190 | //////////////////////////////////////////////////////////////////////////// |
|---|
| [189] | 191 | // _putd() |
|---|
| 192 | // display an int (decimal) on TTY0 / used for system code debug and log |
|---|
| 193 | //////////////////////////////////////////////////////////////////////////// |
|---|
| 194 | void _putd(unsigned int val) |
|---|
| 195 | { |
|---|
| 196 | static const char DecTab[] = "0123456789"; |
|---|
| 197 | char buf[11]; |
|---|
| 198 | unsigned int i; |
|---|
| 199 | unsigned int first; |
|---|
| 200 | |
|---|
| 201 | buf[10] = 0; |
|---|
| 202 | |
|---|
| 203 | for (i = 0; i < 10; i++) |
|---|
| 204 | { |
|---|
| 205 | if ((val != 0) || (i == 0)) |
|---|
| 206 | { |
|---|
| 207 | buf[9-i] = DecTab[val % 10]; |
|---|
| 208 | first = 9-i; |
|---|
| 209 | } |
|---|
| 210 | else |
|---|
| 211 | { |
|---|
| 212 | break; |
|---|
| 213 | } |
|---|
| 214 | val /= 10; |
|---|
| 215 | } |
|---|
| 216 | _puts( &buf[first] ); |
|---|
| 217 | } |
|---|
| 218 | //////////////////////////////////////////////////////////////////////////// |
|---|
| 219 | // _strncmp() |
|---|
| [158] | 220 | // compare two strings s1 & s2 (no more than n characters) |
|---|
| 221 | //////////////////////////////////////////////////////////////////////////// |
|---|
| 222 | unsigned int _strncmp(const char* s1, |
|---|
| 223 | const char* s2, |
|---|
| 224 | unsigned int n) |
|---|
| 225 | { |
|---|
| 226 | unsigned int i; |
|---|
| 227 | for ( i=0 ; i<n ; i++) |
|---|
| 228 | { |
|---|
| 229 | if ( s1[i] != s2[i] ) return 1; |
|---|
| 230 | if ( s1[i] == 0 ) break; |
|---|
| 231 | } |
|---|
| 232 | return 0; |
|---|
| 233 | } |
|---|
| 234 | //////////////////////////////////////////////////////////////////////////// |
|---|
| [189] | 235 | // _dcache_buf_invalidate() |
|---|
| [158] | 236 | // Invalidate all data cache lines corresponding to a memory |
|---|
| 237 | // buffer (identified by an address and a size). |
|---|
| 238 | //////////////////////////////////////////////////////////////////////////// |
|---|
| 239 | void _dcache_buf_invalidate(const void *buffer, |
|---|
| 240 | unsigned int size) |
|---|
| 241 | { |
|---|
| 242 | unsigned int i; |
|---|
| 243 | unsigned int tmp; |
|---|
| 244 | unsigned int line_size; |
|---|
| 245 | |
|---|
| [166] | 246 | // compute data cache line size based on config register (bits 12:10) |
|---|
| [158] | 247 | asm volatile("mfc0 %0, $16, 1" : "=r"(tmp)); |
|---|
| 248 | tmp = ((tmp>>10) & 0x7); |
|---|
| 249 | line_size = 2 << tmp; |
|---|
| 250 | |
|---|
| [166] | 251 | // iterate on cache lines |
|---|
| [158] | 252 | for (i = 0; i < size; i += line_size) |
|---|
| 253 | { |
|---|
| 254 | asm volatile( |
|---|
| 255 | " cache %0, %1" |
|---|
| 256 | ::"i" (0x11), "R" (*((unsigned char*)buffer+i)) |
|---|
| 257 | ); |
|---|
| 258 | } |
|---|
| 259 | } |
|---|
| [189] | 260 | //////////////////////////////////////////////////////////////////////////// |
|---|
| 261 | // _physical_read_access() |
|---|
| 262 | // This function makes a physical read access to a 32 bits word in memory, |
|---|
| 263 | // after a temporary DTLB desactivation. |
|---|
| 264 | //////////////////////////////////////////////////////////////////////////// |
|---|
| 265 | unsigned int _physical_read_access(unsigned int* paddr) |
|---|
| [158] | 266 | { |
|---|
| [189] | 267 | unsigned int value; |
|---|
| [158] | 268 | |
|---|
| [189] | 269 | asm volatile( "li $3, 0xFFFFFFFE \n" |
|---|
| 270 | "mfc0 $2, $12 \n" /* $2 <= SR */ |
|---|
| 271 | "and $3, $3, $2 \n" |
|---|
| 272 | "mtc0 $3, $12 \n" /* interrupt masked */ |
|---|
| 273 | "li $3, 0xB \n" |
|---|
| 274 | "mtc2 $3, $1 \n" /* DTLB off */ |
|---|
| 275 | |
|---|
| 276 | "lw %0, 0(%1) \n" /* entry <= *pslot */ |
|---|
| 277 | |
|---|
| 278 | "li $3, 0xF \n" |
|---|
| 279 | "mtc2 $3, $1 \n" /* DTLB on */ |
|---|
| 280 | "mtc0 $2, $12 \n" /* restore SR */ |
|---|
| 281 | : "=r"(value) |
|---|
| 282 | : "r"(paddr) |
|---|
| 283 | : "$2", "$3" ); |
|---|
| 284 | return value; |
|---|
| [158] | 285 | } |
|---|
| [189] | 286 | //////////////////////////////////////////////////////////////////////////// |
|---|
| 287 | // _physical_write_access() |
|---|
| 288 | // This function makes a physical write access to a 32 bits word in memory, |
|---|
| 289 | // after a temporary DTLB desactivation. |
|---|
| 290 | //////////////////////////////////////////////////////////////////////////// |
|---|
| 291 | void _physical_write_access(unsigned int* paddr, unsigned int value) |
|---|
| [158] | 292 | { |
|---|
| [189] | 293 | asm volatile( "li $3, 0xFFFFFFFE \n" |
|---|
| 294 | "mfc0 $2, $12 \n" /* $26 <= SR */ |
|---|
| 295 | "and $3, $3, $2 \n" |
|---|
| 296 | "mtc0 $3, $12 \n" /* interrupt masked */ |
|---|
| 297 | "li $3, 0xB \n" |
|---|
| 298 | "mtc2 $3, $1 \n" /* DTLB off */ |
|---|
| 299 | |
|---|
| 300 | "sw %0, 0(%1) \n" /* entry <= *pslot */ |
|---|
| [158] | 301 | |
|---|
| [189] | 302 | "li $3, 0xF \n" |
|---|
| 303 | "mtc2 $3, $1 \n" /* DTLB on */ |
|---|
| 304 | "mtc0 $2, $12 \n" /* restore SR */ |
|---|
| 305 | : |
|---|
| 306 | : "r"(value), "r"(paddr) |
|---|
| 307 | : "$2", "$3" ); |
|---|
| [158] | 308 | } |
|---|
| [189] | 309 | //////////////////////////////////////////////////////////////////////////// |
|---|
| 310 | // _get_tasks_number() |
|---|
| 311 | // This function returns the number of tasks allocated to processor. |
|---|
| 312 | //////////////////////////////////////////////////////////////////////////// |
|---|
| 313 | unsigned int _get_tasks_number() |
|---|
| [166] | 314 | { |
|---|
| [189] | 315 | static_scheduler_t* psched = (static_scheduler_t*)_get_sched(); |
|---|
| 316 | return _physical_read_access( &(psched->tasks) ); |
|---|
| [166] | 317 | } |
|---|
| [189] | 318 | //////////////////////////////////////////////////////////////////////////// |
|---|
| 319 | // _get_current_task_id() |
|---|
| 320 | // This function returns the index of the currently running task. |
|---|
| 321 | //////////////////////////////////////////////////////////////////////////// |
|---|
| 322 | unsigned int _get_current_task_id() |
|---|
| [158] | 323 | { |
|---|
| [189] | 324 | static_scheduler_t* psched = (static_scheduler_t*)_get_sched(); |
|---|
| 325 | return _physical_read_access( &(psched->current) ); |
|---|
| [158] | 326 | } |
|---|
| [199] | 327 | //////////////////////////////////////////////////////////////////////////// |
|---|
| 328 | // _set_current_task_id() |
|---|
| 329 | // This function returns the index of the currently running task. |
|---|
| 330 | //////////////////////////////////////////////////////////////////////////// |
|---|
| 331 | void _set_current_task_id( unsigned int value ) |
|---|
| 332 | { |
|---|
| 333 | static_scheduler_t* psched = (static_scheduler_t*)_get_sched(); |
|---|
| 334 | _physical_write_access( &(psched->current), value ); |
|---|
| 335 | } |
|---|
| [189] | 336 | /////////////////////////////////////////////////////////////////////////////// |
|---|
| [199] | 337 | // _get_context_slot() |
|---|
| 338 | // This function returns a slot content for the task defined by task_id. |
|---|
| [189] | 339 | /////////////////////////////////////////////////////////////////////////////// |
|---|
| [199] | 340 | unsigned int _get_context_slot( unsigned int task_id, |
|---|
| 341 | unsigned int slot_id ) |
|---|
| [158] | 342 | { |
|---|
| [189] | 343 | static_scheduler_t* psched = (static_scheduler_t*)_get_sched(); |
|---|
| [199] | 344 | return _physical_read_access( &(psched->context[task_id][slot_id]) ); |
|---|
| [158] | 345 | } |
|---|
| [199] | 346 | /////////////////////////////////////////////////////////////////////////////// |
|---|
| 347 | // _set_context_slot() |
|---|
| 348 | // This function returns a slot content for the task defined by task_id. |
|---|
| 349 | /////////////////////////////////////////////////////////////////////////////// |
|---|
| 350 | void _set_context_slot( unsigned int task_id, |
|---|
| 351 | unsigned int slot_id, |
|---|
| 352 | unsigned int value ) |
|---|
| 353 | { |
|---|
| 354 | static_scheduler_t* psched = (static_scheduler_t*)_get_sched(); |
|---|
| 355 | _physical_write_access( &(psched->context[task_id][slot_id]), value ); |
|---|
| 356 | } |
|---|
| 357 | //////////////////////////////////////////////////////////////////////////////// |
|---|
| [189] | 358 | // _get_interrupt_vector_entry() |
|---|
| 359 | // This function returns the interrupt_vector entry defined by argument index. |
|---|
| 360 | //////////////////////////////////////////////////////////////////////////////// |
|---|
| 361 | unsigned int _get_interrupt_vector_entry( unsigned int index ) |
|---|
| [158] | 362 | { |
|---|
| [189] | 363 | static_scheduler_t* psched = (static_scheduler_t*)_get_sched(); |
|---|
| 364 | return _physical_read_access( &(psched->interrupt_vector[index]) ); |
|---|
| [158] | 365 | } |
|---|
| [165] | 366 | |
|---|
| [158] | 367 | ///////////////////////////////////////////////////////////////////////////// |
|---|
| 368 | // access functions to mapping_info data structure |
|---|
| 369 | ///////////////////////////////////////////////////////////////////////////// |
|---|
| 370 | mapping_cluster_t* _get_cluster_base( mapping_header_t* header ) |
|---|
| 371 | { |
|---|
| 372 | return (mapping_cluster_t*) ((char*)header + |
|---|
| 373 | MAPPING_HEADER_SIZE); |
|---|
| 374 | } |
|---|
| 375 | ///////////////////////////////////////////////////////////////////////////// |
|---|
| 376 | mapping_pseg_t* _get_pseg_base( mapping_header_t* header ) |
|---|
| 377 | { |
|---|
| 378 | return (mapping_pseg_t*) ((char*)header + |
|---|
| 379 | MAPPING_HEADER_SIZE + |
|---|
| 380 | MAPPING_CLUSTER_SIZE*header->clusters); |
|---|
| 381 | } |
|---|
| 382 | ///////////////////////////////////////////////////////////////////////////// |
|---|
| 383 | mapping_vspace_t* _get_vspace_base( mapping_header_t* header ) |
|---|
| 384 | { |
|---|
| 385 | return (mapping_vspace_t*) ((char*)header + |
|---|
| 386 | MAPPING_HEADER_SIZE + |
|---|
| 387 | MAPPING_CLUSTER_SIZE*header->clusters + |
|---|
| 388 | MAPPING_PSEG_SIZE*header->psegs); |
|---|
| 389 | } |
|---|
| 390 | ///////////////////////////////////////////////////////////////////////////// |
|---|
| 391 | mapping_vseg_t* _get_vseg_base( mapping_header_t* header ) |
|---|
| 392 | { |
|---|
| 393 | return (mapping_vseg_t*) ((char*)header + |
|---|
| 394 | MAPPING_HEADER_SIZE + |
|---|
| 395 | MAPPING_CLUSTER_SIZE*header->clusters + |
|---|
| 396 | MAPPING_PSEG_SIZE*header->psegs + |
|---|
| 397 | MAPPING_VSPACE_SIZE*header->vspaces); |
|---|
| 398 | } |
|---|
| 399 | ///////////////////////////////////////////////////////////////////////////// |
|---|
| [160] | 400 | mapping_vobj_t* _get_vobj_base( mapping_header_t* header ) |
|---|
| 401 | { |
|---|
| 402 | return (mapping_vobj_t*) ((char*)header + |
|---|
| 403 | MAPPING_HEADER_SIZE + |
|---|
| 404 | MAPPING_CLUSTER_SIZE*header->clusters + |
|---|
| 405 | MAPPING_PSEG_SIZE*header->psegs + |
|---|
| 406 | MAPPING_VSPACE_SIZE*header->vspaces + |
|---|
| 407 | MAPPING_VSEG_SIZE*header->vsegs ); |
|---|
| 408 | } |
|---|
| 409 | ///////////////////////////////////////////////////////////////////////////// |
|---|
| [158] | 410 | mapping_task_t* _get_task_base( mapping_header_t* header ) |
|---|
| 411 | { |
|---|
| 412 | return (mapping_task_t*) ((char*)header + |
|---|
| 413 | MAPPING_HEADER_SIZE + |
|---|
| 414 | MAPPING_CLUSTER_SIZE*header->clusters + |
|---|
| 415 | MAPPING_PSEG_SIZE*header->psegs + |
|---|
| 416 | MAPPING_VSPACE_SIZE*header->vspaces + |
|---|
| [160] | 417 | MAPPING_VOBJ_SIZE*header->vobjs + |
|---|
| [158] | 418 | MAPPING_VSEG_SIZE*header->vsegs); |
|---|
| 419 | } |
|---|
| 420 | |
|---|