Changeset da68871a in mainline for kernel/generic/src
- Timestamp:
- 2012-08-08T08:46:22Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 30c0826
- Parents:
- bc216a0 (diff), 1d01cca (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- kernel/generic/src
- Files:
-
- 1 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/console/kconsole.c
rbc216a0 rda68871a 43 43 #include <console/chardev.h> 44 44 #include <console/cmd.h> 45 #include <console/prompt.h> 45 46 #include <print.h> 46 47 #include <panic.h> … … 202 203 * 203 204 */ 204 NO_TRACE static int cmdtab_compl(char *input, size_t size )205 NO_TRACE static int cmdtab_compl(char *input, size_t size, indev_t *indev) 205 206 { 206 207 const char *name = input; 207 208 208 209 size_t found = 0; 210 211 /* 212 * Maximum Match Length: Length of longest matching common 213 * substring in case more than one match is found. 214 */ 215 size_t max_match_len = size; 216 size_t max_match_len_tmp = size; 217 size_t input_len = str_length(input); 209 218 link_t *pos = NULL; 210 219 const char *hint; 211 220 char *output = malloc(MAX_CMDLINE, 0); 221 size_t hints_to_show = MAX_TAB_HINTS - 1; 222 size_t total_hints_shown = 0; 223 bool continue_showing_hints = true; 212 224 213 225 output[0] = 0; … … 219 231 pos = pos->next; 220 232 found++; 233 } 234 235 /* 236 * If the number of possible completions is more than MAX_TAB_HINTS, 237 * ask the user whether to display them or not. 238 */ 239 if (found > MAX_TAB_HINTS) { 240 printf("\n"); 241 continue_showing_hints = 242 console_prompt_display_all_hints(indev, found); 221 243 } 222 244 … … 226 248 while (cmdtab_search_one(name, &pos)) { 227 249 cmd_info_t *hlp = list_get_instance(pos, cmd_info_t, link); 228 printf("%s (%s)\n", hlp->name, hlp->description); 250 251 if (continue_showing_hints) { 252 printf("%s (%s)\n", hlp->name, hlp->description); 253 --hints_to_show; 254 ++total_hints_shown; 255 256 if ((hints_to_show == 0) && (total_hints_shown != found)) { 257 /* Ask user to continue */ 258 continue_showing_hints = 259 console_prompt_more_hints(indev, &hints_to_show); 260 } 261 } 262 229 263 pos = pos->next; 230 } 264 265 for (max_match_len_tmp = 0; 266 (output[max_match_len_tmp] == 267 hlp->name[input_len + max_match_len_tmp]) && 268 (max_match_len_tmp < max_match_len); ++max_match_len_tmp); 269 270 max_match_len = max_match_len_tmp; 271 } 272 273 /* Keep only the characters common in all completions */ 274 output[max_match_len] = 0; 231 275 } 232 276 … … 281 325 continue; 282 326 283 /* Find the beginning of the word 284 and copy it to tmp */ 327 /* 328 * Find the beginning of the word 329 * and copy it to tmp 330 */ 285 331 size_t beg; 286 332 for (beg = position - 1; (beg > 0) && (!isspace(current[beg])); … … 295 341 if (beg == 0) { 296 342 /* Command completion */ 297 found = cmdtab_compl(tmp, STR_BOUNDS(MAX_CMDLINE) );343 found = cmdtab_compl(tmp, STR_BOUNDS(MAX_CMDLINE), indev); 298 344 } else { 299 345 /* Symbol completion */ 300 found = symtab_compl(tmp, STR_BOUNDS(MAX_CMDLINE) );346 found = symtab_compl(tmp, STR_BOUNDS(MAX_CMDLINE), indev); 301 347 } 302 348 303 349 if (found == 0) 304 350 continue; 305 306 if (found > 1) { 307 /* No unique hint, list was printed */ 308 printf("%s> ", prompt); 309 printf("%ls", current); 310 print_cc('\b', wstr_length(current) - position); 311 continue; 312 } 313 314 /* We have a hint */ 315 351 352 /* 353 * We have hints, possibly many. In case of more than one hint, 354 * tmp will contain the common prefix. 355 */ 316 356 size_t off = 0; 317 357 size_t i = 0; … … 319 359 if (!wstr_linsert(current, ch, position + i, MAX_CMDLINE)) 320 360 break; 361 321 362 i++; 322 363 } 364 365 if (found > 1) { 366 /* No unique hint, list was printed */ 367 printf("%s> ", prompt); 368 printf("%ls", current); 369 position += str_length(tmp); 370 print_cc('\b', wstr_length(current) - position); 371 continue; 372 } 373 374 /* We have a hint */ 323 375 324 376 printf("%ls", current + position); … … 541 593 /** Parse command line. 542 594 * 543 * @param cmdline Command line as read from input device. 595 * @param cmdline Command line as read from input device. 544 596 * @param size Size (in bytes) of the string. 545 597 * -
kernel/generic/src/debug/symtab.c
rbc216a0 rda68871a 43 43 #include <typedefs.h> 44 44 #include <errno.h> 45 #include <console/prompt.h> 45 46 46 47 /** Get name of a symbol that seems most likely to correspond to address. … … 209 210 * 210 211 */ 211 int symtab_compl(char *input, size_t size )212 int symtab_compl(char *input, size_t size, indev_t *indev) 212 213 { 213 214 #ifdef CONFIG_SYMTAB … … 227 228 char output[MAX_SYMBOL_NAME]; 228 229 230 /* 231 * Maximum Match Length: Length of longest matching common substring in 232 * case more than one match is found. 233 */ 234 size_t max_match_len = size; 235 size_t max_match_len_tmp = size; 236 size_t input_len = str_length(input); 237 char *sym_name; 238 size_t hints_to_show = MAX_TAB_HINTS - 1; 239 size_t total_hints_shown = 0; 240 bool continue_showing_hints = true; 241 229 242 output[0] = 0; 243 244 while ((hint = symtab_search_one(name, &pos))) 245 pos++; 246 247 pos = 0; 230 248 231 249 while ((hint = symtab_search_one(name, &pos))) { … … 235 253 pos++; 236 254 found++; 255 } 256 257 /* 258 * If the number of possible completions is more than MAX_TAB_HINTS, 259 * ask the user whether to display them or not. 260 */ 261 if (found > MAX_TAB_HINTS) { 262 printf("\n"); 263 continue_showing_hints = 264 console_prompt_display_all_hints(indev, found); 237 265 } 238 266 … … 241 269 pos = 0; 242 270 while (symtab_search_one(name, &pos)) { 243 printf("%s\n", symbol_table[pos].symbol_name);271 sym_name = symbol_table[pos].symbol_name; 244 272 pos++; 273 274 if (continue_showing_hints) { 275 /* We are still showing hints */ 276 printf("%s\n", sym_name); 277 --hints_to_show; 278 ++total_hints_shown; 279 280 if ((hints_to_show == 0) && (total_hints_shown != found)) { 281 /* Ask the user to continue */ 282 continue_showing_hints = 283 console_prompt_more_hints(indev, &hints_to_show); 284 } 285 } 286 287 for (max_match_len_tmp = 0; 288 (output[max_match_len_tmp] == 289 sym_name[input_len + max_match_len_tmp]) && 290 (max_match_len_tmp < max_match_len); ++max_match_len_tmp); 291 292 max_match_len = max_match_len_tmp; 245 293 } 294 295 /* Keep only the characters common in all completions */ 296 output[max_match_len] = 0; 246 297 } 247 298 -
kernel/generic/src/interrupt/interrupt.c
rbc216a0 rda68871a 50 50 #include <panic.h> 51 51 #include <print.h> 52 #include <stdarg.h> 52 53 #include <symtab.h> 53 54 #include <proc/thread.h> … … 163 164 } 164 165 165 /** Terminate thread and task if exception came from userspace. 166 * 167 */ 168 NO_TRACE void fault_if_from_uspace(istate_t *istate, const char *fmt, ...) 169 { 170 if (!istate_from_uspace(istate)) 171 return; 172 166 static NO_TRACE void fault_from_uspace_core(istate_t *istate, const char *fmt, va_list args) 167 { 173 168 printf("Task %s (%" PRIu64 ") killed due to an exception at " 174 169 "program counter %p.\n", TASK->name, TASK->taskid, … … 179 174 180 175 printf("Kill message: "); 176 vprintf(fmt, args); 177 printf("\n"); 178 179 task_kill_self(true); 180 } 181 182 /** Terminate thread and task after the exception came from userspace. 183 * 184 */ 185 NO_TRACE void fault_from_uspace(istate_t *istate, const char *fmt, ...) 186 { 187 va_list args; 188 189 va_start(args, fmt); 190 fault_from_uspace_core(istate, fmt, args); 191 va_end(args); 192 } 193 194 /** Terminate thread and task if exception came from userspace. 195 * 196 */ 197 NO_TRACE void fault_if_from_uspace(istate_t *istate, const char *fmt, ...) 198 { 199 if (!istate_from_uspace(istate)) 200 return; 181 201 182 202 va_list args; 183 203 va_start(args, fmt); 184 vprintf(fmt, args);204 fault_from_uspace_core(istate, fmt, args); 185 205 va_end(args); 186 printf("\n");187 188 task_kill_self(true);189 206 } 190 207 -
kernel/generic/src/ipc/irq.c
rbc216a0 rda68871a 39 39 * when interrupt is detected. The application may provide a simple 'top-half' 40 40 * handler as part of its registration, which can perform simple operations 41 * (read/write port/memory, add information to notification ipcmessage).41 * (read/write port/memory, add information to notification IPC message). 42 42 * 43 43 * The structure of a notification message is as follows: 44 44 * - IMETHOD: interface and method as registered by 45 45 * the SYS_IRQ_REGISTER syscall 46 * - ARG1: payload modified by a 'top-half' handler 47 * - ARG2: payload modified by a 'top-half' handler 48 * - ARG3: payload modified by a 'top-half' handler 49 * - ARG4: payload modified by a 'top-half' handler 50 * - ARG5: payload modified by a 'top-half' handler 46 * - ARG1: payload modified by a 'top-half' handler (scratch[1]) 47 * - ARG2: payload modified by a 'top-half' handler (scratch[2]) 48 * - ARG3: payload modified by a 'top-half' handler (scratch[3]) 49 * - ARG4: payload modified by a 'top-half' handler (scratch[4]) 50 * - ARG5: payload modified by a 'top-half' handler (scratch[5]) 51 51 * - in_phone_hash: interrupt counter (may be needed to assure correct order 52 52 * in multithreaded drivers) … … 87 87 static void ranges_unmap(irq_pio_range_t *ranges, size_t rangecount) 88 88 { 89 size_t i; 90 91 for (i = 0; i < rangecount; i++) { 89 for (size_t i = 0; i < rangecount; i++) { 92 90 #ifdef IO_SPACE_BOUNDARY 93 91 if ((void *) ranges[i].base >= IO_SPACE_BOUNDARY) … … 100 98 irq_cmd_t *cmds, size_t cmdcount) 101 99 { 102 uintptr_t *pbase;103 size_t i, j;104 105 100 /* Copy the physical base addresses aside. */ 106 pbase = malloc(rangecount * sizeof(uintptr_t), 0);107 for ( i = 0; i < rangecount; i++)101 uintptr_t *pbase = malloc(rangecount * sizeof(uintptr_t), 0); 102 for (size_t i = 0; i < rangecount; i++) 108 103 pbase[i] = ranges[i].base; 109 104 110 105 /* Map the PIO ranges into the kernel virtual address space. */ 111 for ( i = 0; i < rangecount; i++) {106 for (size_t i = 0; i < rangecount; i++) { 112 107 #ifdef IO_SPACE_BOUNDARY 113 108 if ((void *) ranges[i].base < IO_SPACE_BOUNDARY) … … 122 117 } 123 118 } 124 119 125 120 /* Rewrite the pseudocode addresses from physical to kernel virtual. */ 126 for ( i = 0; i < cmdcount; i++) {121 for (size_t i = 0; i < cmdcount; i++) { 127 122 uintptr_t addr; 128 123 size_t size; 129 124 130 125 /* Process only commands that use an address. */ 131 126 switch (cmds[i].cmd) { 132 127 case CMD_PIO_READ_8: 133 134 128 case CMD_PIO_WRITE_8: 129 case CMD_PIO_WRITE_A_8: 135 130 size = 1; 136 131 break; 137 138 139 132 case CMD_PIO_READ_16: 133 case CMD_PIO_WRITE_16: 134 case CMD_PIO_WRITE_A_16: 140 135 size = 2; 141 136 break; 142 143 144 137 case CMD_PIO_READ_32: 138 case CMD_PIO_WRITE_32: 139 case CMD_PIO_WRITE_A_32: 145 140 size = 4; 146 141 break; … … 149 144 continue; 150 145 } 151 146 152 147 addr = (uintptr_t) cmds[i].addr; 153 148 149 size_t j; 154 150 for (j = 0; j < rangecount; j++) { 155 156 151 /* Find the matching range. */ 157 152 if (!iswithin(pbase[j], ranges[j].size, addr, size)) 158 153 continue; 159 154 160 155 /* Switch the command to a kernel virtual address. */ 161 156 addr -= pbase[j]; 162 157 addr += ranges[j].base; 163 158 164 159 cmds[i].addr = (void *) addr; 165 160 break; 166 161 } 167 162 168 163 if (j == rangecount) { 169 164 /* … … 176 171 } 177 172 } 178 173 179 174 free(pbase); 175 return EOK; 176 } 177 178 /** Statically check the top-half pseudocode 179 * 180 * Check the top-half pseudocode for invalid or unsafe 181 * constructs. 182 * 183 */ 184 static int code_check(irq_cmd_t *cmds, size_t cmdcount) 185 { 186 for (size_t i = 0; i < cmdcount; i++) { 187 /* 188 * Check for accepted ranges. 189 */ 190 if (cmds[i].cmd >= CMD_LAST) 191 return EINVAL; 192 193 if (cmds[i].srcarg >= IPC_CALL_LEN) 194 return EINVAL; 195 196 if (cmds[i].dstarg >= IPC_CALL_LEN) 197 return EINVAL; 198 199 switch (cmds[i].cmd) { 200 case CMD_PREDICATE: 201 /* 202 * Check for control flow overflow. 203 * Note that jumping just beyond the last 204 * command is a correct behaviour. 205 */ 206 if (i + cmds[i].value > cmdcount) 207 return EINVAL; 208 209 break; 210 default: 211 break; 212 } 213 } 214 180 215 return EOK; 181 216 } … … 207 242 irq_pio_range_t *ranges = NULL; 208 243 irq_cmd_t *cmds = NULL; 209 244 210 245 irq_code_t *code = malloc(sizeof(*code), 0); 211 246 int rc = copy_from_uspace(code, ucode, sizeof(*code)); … … 222 257 if (rc != EOK) 223 258 goto error; 224 259 225 260 cmds = malloc(sizeof(code->cmds[0]) * code->cmdcount, 0); 226 261 rc = copy_from_uspace(cmds, code->cmds, … … 228 263 if (rc != EOK) 229 264 goto error; 230 265 266 rc = code_check(cmds, code->cmdcount); 267 if (rc != EOK) 268 goto error; 269 231 270 rc = ranges_map_and_apply(ranges, code->rangecount, cmds, 232 271 code->cmdcount); 233 272 if (rc != EOK) 234 273 goto error; 235 274 236 275 code->ranges = ranges; 237 276 code->cmds = cmds; 238 277 239 278 return code; 240 279 241 280 error: 242 281 if (cmds) 243 282 free(cmds); 283 244 284 if (ranges) 245 285 free(ranges); 286 246 287 free(code); 247 288 return NULL; … … 250 291 /** Register an answerbox as a receiving end for IRQ notifications. 251 292 * 252 * @param box Receiving answerbox. 253 * @param inr IRQ number. 254 * @param devno Device number. 255 * @param imethod Interface and method to be associated with the 256 * notification. 257 * @param ucode Uspace pointer to top-half pseudocode. 258 * @return EOK on success or a negative error code. 293 * @param box Receiving answerbox. 294 * @param inr IRQ number. 295 * @param devno Device number. 296 * @param imethod Interface and method to be associated with the 297 * notification. 298 * @param ucode Uspace pointer to top-half pseudocode. 299 * 300 * @return EOK on success or a negative error code. 259 301 * 260 302 */ … … 266 308 (sysarg_t) devno 267 309 }; 268 310 269 311 if ((inr < 0) || (inr > last_inr)) 270 312 return ELIMIT; … … 329 371 /** Unregister task from IRQ notification. 330 372 * 331 * @param box Answerbox associated with the notification. 332 * @param inr IRQ number. 333 * @param devno Device number. 334 * @return EOK on success or a negative error code. 373 * @param box Answerbox associated with the notification. 374 * @param inr IRQ number. 375 * @param devno Device number. 376 * 377 * @return EOK on success or a negative error code. 378 * 335 379 */ 336 380 int ipc_irq_unregister(answerbox_t *box, inr_t inr, devno_t devno) … … 340 384 (sysarg_t) devno 341 385 }; 342 386 343 387 if ((inr < 0) || (inr > last_inr)) 344 388 return ELIMIT; … … 436 480 /* Remove from the hash table. */ 437 481 hash_table_remove(&irq_uspace_hash_table, key, 2); 438 482 439 483 /* 440 484 * Release both locks so that we can free the pseudo code. … … 442 486 irq_spinlock_unlock(&box->irq_lock, false); 443 487 irq_spinlock_unlock(&irq_uspace_hash_table_lock, true); 444 488 445 489 code_free(irq->notif_cfg.code); 446 490 free(irq); … … 492 536 493 537 for (size_t i = 0; i < code->cmdcount; i++) { 494 uint32_t dstval;495 496 538 uintptr_t srcarg = code->cmds[i].srcarg; 497 539 uintptr_t dstarg = code->cmds[i].dstarg; 498 540 499 if (srcarg >= IPC_CALL_LEN)500 break;501 502 if (dstarg >= IPC_CALL_LEN)503 break;504 505 541 switch (code->cmds[i].cmd) { 506 542 case CMD_PIO_READ_8: 507 dstval = pio_read_8((ioport8_t *) code->cmds[i].addr); 508 if (dstarg) 509 scratch[dstarg] = dstval; 543 scratch[dstarg] = 544 pio_read_8((ioport8_t *) code->cmds[i].addr); 510 545 break; 511 546 case CMD_PIO_READ_16: 512 dstval = pio_read_16((ioport16_t *) code->cmds[i].addr); 513 if (dstarg) 514 scratch[dstarg] = dstval; 547 scratch[dstarg] = 548 pio_read_16((ioport16_t *) code->cmds[i].addr); 515 549 break; 516 550 case CMD_PIO_READ_32: 517 dstval = pio_read_32((ioport32_t *) code->cmds[i].addr); 518 if (dstarg) 519 scratch[dstarg] = dstval; 551 scratch[dstarg] = 552 pio_read_32((ioport32_t *) code->cmds[i].addr); 520 553 break; 521 554 case CMD_PIO_WRITE_8: … … 532 565 break; 533 566 case CMD_PIO_WRITE_A_8: 534 if (srcarg) { 535 pio_write_8((ioport8_t *) code->cmds[i].addr, 536 (uint8_t) scratch[srcarg]); 537 } 567 pio_write_8((ioport8_t *) code->cmds[i].addr, 568 (uint8_t) scratch[srcarg]); 538 569 break; 539 570 case CMD_PIO_WRITE_A_16: 540 if (srcarg) { 541 pio_write_16((ioport16_t *) code->cmds[i].addr, 542 (uint16_t) scratch[srcarg]); 543 } 571 pio_write_16((ioport16_t *) code->cmds[i].addr, 572 (uint16_t) scratch[srcarg]); 544 573 break; 545 574 case CMD_PIO_WRITE_A_32: 546 if (srcarg) { 547 pio_write_32((ioport32_t *) code->cmds[i].addr, 548 (uint32_t) scratch[srcarg]); 549 } 550 break; 551 case CMD_BTEST: 552 if ((srcarg) && (dstarg)) { 553 dstval = scratch[srcarg] & code->cmds[i].value; 554 scratch[dstarg] = dstval; 555 } 575 pio_write_32((ioport32_t *) code->cmds[i].addr, 576 (uint32_t) scratch[srcarg]); 577 break; 578 case CMD_LOAD: 579 scratch[dstarg] = code->cmds[i].value; 580 break; 581 case CMD_AND: 582 scratch[dstarg] = scratch[srcarg] & 583 code->cmds[i].value; 556 584 break; 557 585 case CMD_PREDICATE: 558 if ( (srcarg) && (!scratch[srcarg])) {586 if (scratch[srcarg] == 0) 559 587 i += code->cmds[i].value; 560 continue; 561 } 588 562 589 break; 563 590 case CMD_ACCEPT: … … 582 609 { 583 610 ASSERT(irq); 584 611 585 612 ASSERT(interrupts_disabled()); 586 613 ASSERT(irq_spinlock_locked(&irq->lock)); -
kernel/generic/src/lib/str.c
rbc216a0 rda68871a 457 457 * 458 458 * Do a char-by-char comparison of two NULL-terminated strings. 459 * The strings are considered equal iff they consist of the same 460 * characters on the minimum of their lengths. 459 * The strings are considered equal iff their length is equal 460 * and both strings consist of the same sequence of characters. 461 * 462 * A string S1 is less than another string S2 if it has a character with 463 * lower value at the first character position where the strings differ. 464 * If the strings differ in length, the shorter one is treated as if 465 * padded by characters with a value of zero. 461 466 * 462 467 * @param s1 First string to compare. 463 468 * @param s2 Second string to compare. 464 469 * 465 * @return 0 if the strings are equal, -1 if first is smaller,466 * 1 if second smaller.470 * @return 0 if the strings are equal, -1 if the first is less than the second, 471 * 1 if the second is less than the first. 467 472 * 468 473 */ … … 495 500 * 496 501 * Do a char-by-char comparison of two NULL-terminated strings. 497 * The strings are considered equal iff they consist of the same 498 * characters on the minimum of their lengths and the length limit. 502 * The strings are considered equal iff 503 * min(str_length(s1), max_len) == min(str_length(s2), max_len) 504 * and both strings consist of the same sequence of characters, 505 * up to max_len characters. 506 * 507 * A string S1 is less than another string S2 if it has a character with 508 * lower value at the first character position where the strings differ. 509 * If the strings differ in length, the shorter one is treated as if 510 * padded by characters with a value of zero. Only the first max_len 511 * characters are considered. 499 512 * 500 513 * @param s1 First string to compare. … … 502 515 * @param max_len Maximum number of characters to consider. 503 516 * 504 * @return 0 if the strings are equal, -1 if first is smaller,505 * 1 if second smaller.517 * @return 0 if the strings are equal, -1 if the first is less than the second, 518 * 1 if the second is less than the first. 506 519 * 507 520 */ -
kernel/generic/src/mm/as.c
rbc216a0 rda68871a 665 665 666 666 page_table_lock(as, false); 667 668 /*669 * Start TLB shootdown sequence.670 */671 ipl_t ipl = tlb_shootdown_start(TLB_INVL_PAGES, as->asid,672 area->base + P2SZ(pages), area->pages - pages);673 667 674 668 /* … … 726 720 } 727 721 722 /* 723 * Start TLB shootdown sequence. 724 * 725 * The sequence is rather short and can be 726 * repeated multiple times. The reason is that 727 * we don't want to have used_space_remove() 728 * inside the sequence as it may use a blocking 729 * memory allocation for its B+tree. Blocking 730 * while holding the tlblock spinlock is 731 * forbidden and would hit a kernel assertion. 732 */ 733 734 ipl_t ipl = tlb_shootdown_start(TLB_INVL_PAGES, 735 as->asid, area->base + P2SZ(pages), 736 area->pages - pages); 737 728 738 for (; i < size; i++) { 729 739 pte_t *pte = page_mapping_find(as, … … 743 753 page_mapping_remove(as, ptr + P2SZ(i)); 744 754 } 755 756 /* 757 * Finish TLB shootdown sequence. 758 */ 759 760 tlb_invalidate_pages(as->asid, 761 area->base + P2SZ(pages), 762 area->pages - pages); 763 764 /* 765 * Invalidate software translation caches 766 * (e.g. TSB on sparc64, PHT on ppc32). 767 */ 768 as_invalidate_translation_cache(as, 769 area->base + P2SZ(pages), 770 area->pages - pages); 771 tlb_shootdown_finalize(ipl); 745 772 } 746 773 } 747 748 /*749 * Finish TLB shootdown sequence.750 */751 752 tlb_invalidate_pages(as->asid, area->base + P2SZ(pages),753 area->pages - pages);754 755 /*756 * Invalidate software translation caches757 * (e.g. TSB on sparc64, PHT on ppc32).758 */759 as_invalidate_translation_cache(as, area->base + P2SZ(pages),760 area->pages - pages);761 tlb_shootdown_finalize(ipl);762 763 774 page_table_unlock(as, false); 764 775 } else { -
kernel/generic/src/mm/tlb.c
rbc216a0 rda68871a 162 162 163 163 size_t i; 164 for (i = 0; i < CPU->tlb_messages_count; CPU->tlb_messages_count--) {164 for (i = 0; i < CPU->tlb_messages_count; i++) { 165 165 tlb_invalidate_type_t type = CPU->tlb_messages[i].type; 166 166 asid_t asid = CPU->tlb_messages[i].asid; … … 188 188 } 189 189 190 CPU->tlb_messages_count = 0; 190 191 irq_spinlock_unlock(&CPU->lock, false); 191 192 CPU->tlb_active = true;
Note:
See TracChangeset
for help on using the changeset viewer.