[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 | /////////////////////////////////////////////////////////////////////////////////// |
---|
[228] | 19 | // Global variables |
---|
[189] | 20 | /////////////////////////////////////////////////////////////////////////////////// |
---|
| 21 | |
---|
| 22 | // SR save (used by _it_mask() / it_restore() |
---|
[231] | 23 | unsigned int _status_register_save[NB_CLUSTERS*NB_PROCS_MAX]; |
---|
[189] | 24 | |
---|
| 25 | /////////////////////////////////////////////////////////////////////////////////// |
---|
[228] | 26 | // _get_sched() |
---|
[238] | 27 | // Access CP0 and returns a pointer (virtual address) on the calling |
---|
| 28 | // processor scheduler (taking into account the processor local index). |
---|
[189] | 29 | /////////////////////////////////////////////////////////////////////////////////// |
---|
[238] | 30 | static_scheduler_t* _get_sched() |
---|
| 31 | { |
---|
| 32 | static_scheduler_t* psched; |
---|
| 33 | unsigned int vaddr; |
---|
| 34 | unsigned int lpid = _procid() % NB_PROCS_MAX; |
---|
| 35 | |
---|
[228] | 36 | asm volatile( |
---|
[238] | 37 | "mfc0 %0, $22 \n" |
---|
| 38 | : "=r"(vaddr) ); |
---|
| 39 | |
---|
| 40 | psched = (static_scheduler_t*)vaddr; |
---|
| 41 | return (psched + lpid); |
---|
[189] | 42 | } |
---|
[228] | 43 | |
---|
[189] | 44 | /////////////////////////////////////////////////////////////////////////////////// |
---|
[228] | 45 | // _get_ptpr() |
---|
[189] | 46 | // Access CP2 and returns PTPR register. |
---|
| 47 | /////////////////////////////////////////////////////////////////////////////////// |
---|
[238] | 48 | inline unsigned int _get_ptpr() |
---|
| 49 | { |
---|
[189] | 50 | unsigned int ret; |
---|
[228] | 51 | asm volatile( |
---|
| 52 | "mfc2 %0, $0" |
---|
| 53 | : "=r"(ret)); |
---|
[189] | 54 | return ret; |
---|
| 55 | } |
---|
[228] | 56 | |
---|
[189] | 57 | /////////////////////////////////////////////////////////////////////////////////// |
---|
[228] | 58 | // _get_epc() |
---|
[189] | 59 | // Access CP0 and returns EPC register. |
---|
| 60 | /////////////////////////////////////////////////////////////////////////////////// |
---|
[238] | 61 | inline unsigned int _get_epc() |
---|
| 62 | { |
---|
[189] | 63 | unsigned int ret; |
---|
[228] | 64 | asm volatile("mfc0 %0, $14" |
---|
| 65 | : "=r"(ret)); |
---|
[189] | 66 | return ret; |
---|
| 67 | } |
---|
[228] | 68 | |
---|
[189] | 69 | /////////////////////////////////////////////////////////////////////////////////// |
---|
[228] | 70 | // _get_bar() |
---|
[189] | 71 | // Access CP0 and returns BAR register. |
---|
| 72 | /////////////////////////////////////////////////////////////////////////////////// |
---|
[238] | 73 | inline unsigned int _get_bvar() |
---|
| 74 | { |
---|
[189] | 75 | unsigned int ret; |
---|
[228] | 76 | asm volatile( |
---|
| 77 | "mfc0 %0, $8" |
---|
| 78 | : "=r"(ret)); |
---|
[189] | 79 | return ret; |
---|
| 80 | } |
---|
[228] | 81 | |
---|
[189] | 82 | /////////////////////////////////////////////////////////////////////////////////// |
---|
[228] | 83 | // _get_cr() |
---|
[189] | 84 | // Access CP0 and returns CR register. |
---|
| 85 | /////////////////////////////////////////////////////////////////////////////////// |
---|
[238] | 86 | inline unsigned int _get_cause() |
---|
| 87 | { |
---|
[189] | 88 | unsigned int ret; |
---|
[228] | 89 | asm volatile("mfc0 %0, $13" |
---|
| 90 | : "=r"(ret)); |
---|
[189] | 91 | return ret; |
---|
| 92 | } |
---|
[228] | 93 | |
---|
[189] | 94 | /////////////////////////////////////////////////////////////////////////////////// |
---|
[228] | 95 | // _get_sr() |
---|
[189] | 96 | // Access CP0 and returns SR register. |
---|
| 97 | /////////////////////////////////////////////////////////////////////////////////// |
---|
[238] | 98 | inline unsigned int _get_sr() |
---|
| 99 | { |
---|
[189] | 100 | unsigned int ret; |
---|
[228] | 101 | asm volatile( |
---|
| 102 | "mfc0 %0, $12" |
---|
| 103 | : "=r"(ret)); |
---|
[189] | 104 | return ret; |
---|
| 105 | } |
---|
[228] | 106 | |
---|
[189] | 107 | /////////////////////////////////////////////////////////////////////////////////// |
---|
| 108 | // _it_mask() |
---|
| 109 | // Access CP0 and mask IRQs |
---|
[231] | 110 | // This function uses a global _status_register_save array |
---|
| 111 | // This function is NOT USED and NOT TESTED |
---|
[189] | 112 | /////////////////////////////////////////////////////////////////////////////////// |
---|
[238] | 113 | inline void _it_mask() |
---|
| 114 | { |
---|
[228] | 115 | unsigned int sr_value; |
---|
[231] | 116 | unsigned int proc_id; |
---|
[228] | 117 | asm volatile( |
---|
| 118 | "li $3, 0xFFFFFFFE \n" |
---|
| 119 | "mfc0 %0, $12 \n" |
---|
| 120 | "and $3, $3, %0 \n" |
---|
| 121 | "mtc0 $3, $12 \n" |
---|
[231] | 122 | "mfc0 %1, $15, 1 \n" |
---|
| 123 | : "=r"(sr_value), "=r"(proc_id) |
---|
[228] | 124 | : |
---|
| 125 | : "$3"); |
---|
[231] | 126 | _status_register_save[proc_id] = sr_value; |
---|
[189] | 127 | } |
---|
[228] | 128 | |
---|
[189] | 129 | /////////////////////////////////////////////////////////////////////////////////// |
---|
[228] | 130 | // _it_restore() |
---|
[189] | 131 | // Access CP0 and enable IRQs |
---|
[231] | 132 | // This function uses a global _status_register_save array |
---|
| 133 | // This function is NOT USED and NOT TESTED |
---|
[189] | 134 | /////////////////////////////////////////////////////////////////////////////////// |
---|
[238] | 135 | inline void _it_restore() |
---|
| 136 | { |
---|
[231] | 137 | unsigned int proc_id; |
---|
| 138 | // get the processor id to index the _status_register_save table |
---|
| 139 | asm volatile("mfc0 %0, $15, 1" : "=r" (proc_id)); |
---|
| 140 | // restore the saved value into the status register |
---|
| 141 | asm volatile("mtc0 %0, $12" : : "r" (_status_register_save[proc_id])); |
---|
| 142 | } |
---|
| 143 | |
---|
| 144 | /////////////////////////////////////////////////////////////////////////////////// |
---|
| 145 | // _it_disable() |
---|
| 146 | // Access CP0 and disables IRQs |
---|
| 147 | /////////////////////////////////////////////////////////////////////////////////// |
---|
[238] | 148 | inline void _it_disable() |
---|
| 149 | { |
---|
[228] | 150 | asm volatile( |
---|
[231] | 151 | "li $3, 0xFFFFFFFE \n" |
---|
| 152 | "mfc0 $4, $12 \n" |
---|
| 153 | "and $3, $3, $4 \n" |
---|
| 154 | "mtc0 $3, $12 \n" |
---|
| 155 | ::: "$3", "$4"); |
---|
[189] | 156 | } |
---|
[228] | 157 | |
---|
[231] | 158 | /////////////////////////////////////////////////////////////////////////////////// |
---|
| 159 | // _it_enable() |
---|
| 160 | // Access CP0 and enables IRQs |
---|
| 161 | /////////////////////////////////////////////////////////////////////////////////// |
---|
[238] | 162 | inline void _it_enable() |
---|
| 163 | { |
---|
[231] | 164 | asm volatile( |
---|
| 165 | "li $3, 0x00000001 \n" |
---|
| 166 | "mfc0 $4, $12 \n" |
---|
| 167 | "or $3, $3, $4 \n" |
---|
| 168 | "mtc0 $3, $12 \n" |
---|
| 169 | ::: "$3", "$4"); |
---|
| 170 | } |
---|
[228] | 171 | |
---|
[158] | 172 | //////////////////////////////////////////////////////////////////////////// |
---|
[189] | 173 | // _get_lock() |
---|
| 174 | // Takes a lock with an ll/sc atomic access. |
---|
| 175 | // A pseudo random delay is introduced before retry in case of miss |
---|
| 176 | // (delay average value = 100 cycles) |
---|
[165] | 177 | //////////////////////////////////////////////////////////////////////////// |
---|
[238] | 178 | inline void _get_lock(unsigned int * plock) |
---|
| 179 | { |
---|
[228] | 180 | register unsigned int delay = ( _proctime() ^ _procid() << 4) & 0xFF; |
---|
[165] | 181 | |
---|
| 182 | asm volatile ( |
---|
| 183 | "_lock_llsc: \n" |
---|
| 184 | "ll $2, 0(%0) \n" /* $2 <= _ioc_lock current value */ |
---|
| 185 | "bnez $2, _lock_delay \n" /* delay if _ioc_lock already taken */ |
---|
| 186 | "li $3, 1 \n" /* $3 <= argument for sc */ |
---|
| 187 | "sc $3, 0(%0) \n" /* try to set _ioc_lock */ |
---|
| 188 | "bnez $3, _lock_ok \n" /* exit if atomic */ |
---|
| 189 | "_lock_delay: \n" |
---|
| 190 | "move $4, %1 \n" /* $4 <= delay */ |
---|
| 191 | "_lock_loop: \n" |
---|
| 192 | "addi $4, $4, -1 \n" /* $4 <= $4 - 1 */ |
---|
| 193 | "beqz $4, _lock_loop \n" /* test end delay */ |
---|
| 194 | "j _lock_llsc \n" /* retry */ |
---|
| 195 | "_lock_ok: \n" |
---|
| 196 | : |
---|
| 197 | :"r"(plock), "r"(delay) |
---|
| 198 | :"$2", "$3", "$4"); |
---|
| 199 | } |
---|
| 200 | |
---|
| 201 | //////////////////////////////////////////////////////////////////////////// |
---|
| 202 | // _release_lock() |
---|
| 203 | //////////////////////////////////////////////////////////////////////////// |
---|
[238] | 204 | inline void _release_lock(unsigned int * plock) |
---|
| 205 | { |
---|
[221] | 206 | asm volatile ( |
---|
[228] | 207 | "sync\n" /* necessary because of the consistency model in tsar */ |
---|
| 208 | ); |
---|
[165] | 209 | *plock = 0; |
---|
| 210 | } |
---|
| 211 | |
---|
| 212 | //////////////////////////////////////////////////////////////////////////// |
---|
[189] | 213 | // _puts() |
---|
[207] | 214 | // display a string on TTY0 / used for system code debug and log |
---|
[158] | 215 | //////////////////////////////////////////////////////////////////////////// |
---|
[238] | 216 | void _puts(char * buffer) |
---|
| 217 | { |
---|
[228] | 218 | unsigned int * tty_address = (unsigned int *) &seg_tty_base; |
---|
[158] | 219 | unsigned int n; |
---|
| 220 | |
---|
[238] | 221 | for (n = 0; n < 100; n++) |
---|
| 222 | { |
---|
| 223 | if (buffer[n] == 0) break; |
---|
[228] | 224 | tty_address[TTY_WRITE] = (unsigned int) buffer[n]; |
---|
[158] | 225 | } |
---|
| 226 | } |
---|
[228] | 227 | |
---|
[158] | 228 | //////////////////////////////////////////////////////////////////////////// |
---|
[207] | 229 | // _putx() |
---|
[238] | 230 | // display a 32 bits unsigned int as an hexadecimal string on TTY0 |
---|
[158] | 231 | //////////////////////////////////////////////////////////////////////////// |
---|
[238] | 232 | void _putx(unsigned int val) |
---|
| 233 | { |
---|
[228] | 234 | static const char HexaTab[] = "0123456789ABCDEF"; |
---|
| 235 | char buf[11]; |
---|
| 236 | unsigned int c; |
---|
[158] | 237 | |
---|
[228] | 238 | buf[0] = '0'; |
---|
| 239 | buf[1] = 'x'; |
---|
[158] | 240 | buf[10] = 0; |
---|
| 241 | |
---|
[238] | 242 | for (c = 0; c < 8; c++) |
---|
| 243 | { |
---|
[228] | 244 | buf[9 - c] = HexaTab[val & 0xF]; |
---|
[158] | 245 | val = val >> 4; |
---|
| 246 | } |
---|
| 247 | _puts(buf); |
---|
| 248 | } |
---|
[228] | 249 | |
---|
[238] | 250 | //////////////////////////////////////////////////////////////////////////// |
---|
| 251 | // _putl() |
---|
| 252 | // display a 64 bits unsigned long as an hexadecimal string on TTY0 |
---|
| 253 | //////////////////////////////////////////////////////////////////////////// |
---|
| 254 | void _putl(paddr_t val) |
---|
| 255 | { |
---|
| 256 | static const char HexaTab[] = "0123456789ABCDEF"; |
---|
| 257 | char buf[19]; |
---|
| 258 | unsigned int c; |
---|
[228] | 259 | |
---|
[238] | 260 | buf[0] = '0'; |
---|
| 261 | buf[1] = 'x'; |
---|
| 262 | buf[18] = 0; |
---|
| 263 | |
---|
| 264 | for (c = 0; c < 16; c++) |
---|
| 265 | { |
---|
| 266 | buf[17 - c] = HexaTab[(unsigned int)val & 0xF]; |
---|
| 267 | val = val >> 4; |
---|
| 268 | } |
---|
| 269 | _puts(buf); |
---|
| 270 | } |
---|
| 271 | |
---|
[158] | 272 | //////////////////////////////////////////////////////////////////////////// |
---|
[189] | 273 | // _putd() |
---|
| 274 | // display an int (decimal) on TTY0 / used for system code debug and log |
---|
| 275 | //////////////////////////////////////////////////////////////////////////// |
---|
[228] | 276 | void _putd(unsigned int val) { |
---|
| 277 | static const char DecTab[] = "0123456789"; |
---|
| 278 | char buf[11]; |
---|
| 279 | unsigned int i; |
---|
| 280 | unsigned int first; |
---|
[189] | 281 | |
---|
| 282 | buf[10] = 0; |
---|
| 283 | |
---|
[228] | 284 | for (i = 0; i < 10; i++) { |
---|
| 285 | if ((val != 0) || (i == 0)) { |
---|
| 286 | buf[9 - i] = DecTab[val % 10]; |
---|
| 287 | first = 9 - i; |
---|
[189] | 288 | } |
---|
[228] | 289 | else { |
---|
[189] | 290 | break; |
---|
| 291 | } |
---|
| 292 | val /= 10; |
---|
| 293 | } |
---|
[228] | 294 | _puts(&buf[first]); |
---|
[189] | 295 | } |
---|
[228] | 296 | |
---|
[189] | 297 | //////////////////////////////////////////////////////////////////////////// |
---|
| 298 | // _strncmp() |
---|
[158] | 299 | // compare two strings s1 & s2 (no more than n characters) |
---|
| 300 | //////////////////////////////////////////////////////////////////////////// |
---|
[228] | 301 | unsigned int _strncmp(const char * s1, const char * s2, unsigned int n) { |
---|
[158] | 302 | unsigned int i; |
---|
[228] | 303 | for (i = 0; i < n; i++) { |
---|
| 304 | if (s1[i] != s2[i]) { |
---|
| 305 | return 1; |
---|
| 306 | } |
---|
| 307 | if (s1[i] == 0) { |
---|
| 308 | break; |
---|
| 309 | } |
---|
[158] | 310 | } |
---|
| 311 | return 0; |
---|
| 312 | } |
---|
[228] | 313 | |
---|
[158] | 314 | //////////////////////////////////////////////////////////////////////////// |
---|
[228] | 315 | // _dcache_buf_invalidate() |
---|
[158] | 316 | // Invalidate all data cache lines corresponding to a memory |
---|
| 317 | // buffer (identified by an address and a size). |
---|
| 318 | //////////////////////////////////////////////////////////////////////////// |
---|
[228] | 319 | void _dcache_buf_invalidate(const void * buffer, unsigned int size) { |
---|
[158] | 320 | unsigned int i; |
---|
| 321 | unsigned int tmp; |
---|
| 322 | unsigned int line_size; |
---|
| 323 | |
---|
[166] | 324 | // compute data cache line size based on config register (bits 12:10) |
---|
[228] | 325 | asm volatile("mfc0 %0, $16, 1" : "=r" (tmp)); |
---|
| 326 | tmp = ((tmp >> 10) & 0x7); |
---|
[158] | 327 | line_size = 2 << tmp; |
---|
| 328 | |
---|
[166] | 329 | // iterate on cache lines |
---|
[228] | 330 | for (i = 0; i < size; i += line_size) { |
---|
[158] | 331 | asm volatile( |
---|
| 332 | " cache %0, %1" |
---|
[228] | 333 | : |
---|
| 334 | :"i" (0x11), "R" (*((unsigned char *) buffer + i)) |
---|
[158] | 335 | ); |
---|
| 336 | } |
---|
| 337 | } |
---|
[228] | 338 | |
---|
[238] | 339 | ///////////////////////////////////////////////////////////////////////////// |
---|
| 340 | // _get_task_slot() |
---|
| 341 | // This function returns the content of a context slot |
---|
| 342 | // for the task identified by the ltid argument (local index). |
---|
| 343 | ///////////////////////////////////////////////////////////////////////////// |
---|
| 344 | unsigned int _get_task_slot( unsigned int ltid, |
---|
| 345 | unsigned int slot ) |
---|
| 346 | { |
---|
| 347 | static_scheduler_t* psched = _get_sched(); |
---|
| 348 | return psched->context[ltid][slot]; |
---|
[158] | 349 | } |
---|
[228] | 350 | |
---|
[238] | 351 | ///////////////////////////////////////////////////////////////////////////// |
---|
| 352 | // _set_task_slot() |
---|
| 353 | // This function updates the content of a context slot |
---|
| 354 | // for the task identified by the ltid argument (local index). |
---|
| 355 | ///////////////////////////////////////////////////////////////////////////// |
---|
| 356 | void _set_task_slot( unsigned int ltid, |
---|
| 357 | unsigned int slot, |
---|
| 358 | unsigned int value ) |
---|
| 359 | { |
---|
| 360 | static_scheduler_t* psched = _get_sched(); |
---|
| 361 | psched->context[ltid][slot] = value; |
---|
[158] | 362 | } |
---|
[228] | 363 | |
---|
[238] | 364 | ///////////////////////////////////////////////////////////////////////////// |
---|
| 365 | // _get_context_slot() |
---|
| 366 | // This function returns the content of a context slot |
---|
| 367 | // for the running task (defined by the scheduler current field). |
---|
| 368 | ///////////////////////////////////////////////////////////////////////////// |
---|
| 369 | unsigned int _get_context_slot( unsigned int slot ) |
---|
| 370 | { |
---|
| 371 | static_scheduler_t* psched = _get_sched(); |
---|
| 372 | unsigned int task_id = psched->current; |
---|
| 373 | return psched->context[task_id][slot]; |
---|
[166] | 374 | } |
---|
[228] | 375 | |
---|
[238] | 376 | ///////////////////////////////////////////////////////////////////////////// |
---|
| 377 | // _set_context_slot() |
---|
| 378 | // This function updates the content of a context slot for the running task. |
---|
| 379 | ///////////////////////////////////////////////////////////////////////////// |
---|
| 380 | void _set_context_slot( unsigned int slot, |
---|
| 381 | unsigned int value ) |
---|
| 382 | { |
---|
| 383 | static_scheduler_t* psched = _get_sched(); |
---|
| 384 | unsigned int task_id = psched->current; |
---|
| 385 | psched->context[task_id][slot] = value; |
---|
[158] | 386 | } |
---|
[228] | 387 | |
---|
[158] | 388 | ///////////////////////////////////////////////////////////////////////////// |
---|
[228] | 389 | // access functions to mapping_info data structure |
---|
[158] | 390 | ///////////////////////////////////////////////////////////////////////////// |
---|
[238] | 391 | mapping_cluster_t * _get_cluster_base(mapping_header_t * header) |
---|
| 392 | { |
---|
[228] | 393 | return (mapping_cluster_t *) ((char *) header + |
---|
| 394 | MAPPING_HEADER_SIZE); |
---|
[158] | 395 | } |
---|
| 396 | ///////////////////////////////////////////////////////////////////////////// |
---|
[238] | 397 | mapping_pseg_t * _get_pseg_base(mapping_header_t * header) |
---|
| 398 | { |
---|
[228] | 399 | return (mapping_pseg_t *) ((char *) header + |
---|
| 400 | MAPPING_HEADER_SIZE + |
---|
| 401 | MAPPING_CLUSTER_SIZE * header->clusters); |
---|
[158] | 402 | } |
---|
| 403 | ///////////////////////////////////////////////////////////////////////////// |
---|
[238] | 404 | mapping_vspace_t * _get_vspace_base(mapping_header_t * header) |
---|
| 405 | { |
---|
[228] | 406 | return (mapping_vspace_t *) ((char *) header + |
---|
| 407 | MAPPING_HEADER_SIZE + |
---|
| 408 | MAPPING_CLUSTER_SIZE * header->clusters + |
---|
| 409 | MAPPING_PSEG_SIZE * header->psegs); |
---|
[158] | 410 | } |
---|
[228] | 411 | |
---|
| 412 | |
---|
[158] | 413 | ///////////////////////////////////////////////////////////////////////////// |
---|
[228] | 414 | mapping_vseg_t * _get_vseg_base(mapping_header_t * header) |
---|
[158] | 415 | { |
---|
[228] | 416 | return (mapping_vseg_t *) ((char *) header + |
---|
| 417 | MAPPING_HEADER_SIZE + |
---|
| 418 | MAPPING_CLUSTER_SIZE * header->clusters + |
---|
| 419 | MAPPING_PSEG_SIZE * header->psegs + |
---|
| 420 | MAPPING_VSPACE_SIZE * header->vspaces); |
---|
[158] | 421 | } |
---|
[228] | 422 | |
---|
| 423 | |
---|
[158] | 424 | ///////////////////////////////////////////////////////////////////////////// |
---|
[238] | 425 | mapping_vobj_t * _get_vobj_base(mapping_header_t * header) |
---|
| 426 | { |
---|
[228] | 427 | return (mapping_vobj_t *) ((char *) header + |
---|
| 428 | MAPPING_HEADER_SIZE + |
---|
| 429 | MAPPING_CLUSTER_SIZE * header->clusters + |
---|
| 430 | MAPPING_PSEG_SIZE * header->psegs + |
---|
| 431 | MAPPING_VSPACE_SIZE * header->vspaces + |
---|
| 432 | MAPPING_VSEG_SIZE * header->vsegs ); |
---|
[160] | 433 | } |
---|
[228] | 434 | |
---|
| 435 | |
---|
[160] | 436 | ///////////////////////////////////////////////////////////////////////////// |
---|
[238] | 437 | mapping_task_t * _get_task_base(mapping_header_t * header) |
---|
| 438 | { |
---|
[228] | 439 | return (mapping_task_t *) ((char *) header + |
---|
| 440 | MAPPING_HEADER_SIZE + |
---|
| 441 | MAPPING_CLUSTER_SIZE * header->clusters + |
---|
| 442 | MAPPING_PSEG_SIZE * header->psegs + |
---|
| 443 | MAPPING_VSPACE_SIZE * header->vspaces + |
---|
| 444 | MAPPING_VOBJ_SIZE * header->vobjs + |
---|
| 445 | MAPPING_VSEG_SIZE * header->vsegs); |
---|
[158] | 446 | } |
---|
| 447 | |
---|
[228] | 448 | |
---|
| 449 | // Local Variables: |
---|
| 450 | // tab-width: 4 |
---|
| 451 | // c-basic-offset: 4 |
---|
| 452 | // c-file-offsets:((innamespace . 0)(inline-open . 0)) |
---|
| 453 | // indent-tabs-mode: nil |
---|
| 454 | // End: |
---|
| 455 | // vim: filetype=c:expandtab:shiftwidth=4:tabstop=4:softtabstop=4 |
---|
| 456 | |
---|