Changeset 9314ee1 in mainline
- Timestamp:
- 2006-09-01T17:00:18Z (18 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 002e613
- Parents:
- 6767c1d
- Location:
- kernel
- Files:
-
- 3 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/sparc64/Makefile.inc
r6767c1d r9314ee1 100 100 arch/$(ARCH)/src/trap/exception.c \ 101 101 arch/$(ARCH)/src/trap/interrupt.c \ 102 arch/$(ARCH)/src/trap/syscall.c \ 102 103 arch/$(ARCH)/src/ddi/ddi.c \ 103 104 arch/$(ARCH)/src/drivers/tick.c \ -
kernel/arch/sparc64/src/trap/trap_table.S
r6767c1d r9314ee1 40 40 #include <arch/trap/interrupt.h> 41 41 #include <arch/trap/exception.h> 42 #include <arch/trap/syscall.h> 42 43 #include <arch/trap/mmu.h> 43 44 #include <arch/mm/mmu.h> … … 230 231 FILL_NORMAL_HANDLER_USERSPACE 231 232 233 /* TT = 0x100, TL = 0, trap_instruction_0 */ 234 .org trap_table + TT_TRAP_INSTRUCTION(0)*ENTRY_SIZE 235 .global trap_instruction_0 236 trap_instruction_0: 237 TRAP_INSTRUCTION 0 238 239 /* TT = 0x101, TL = 0, trap_instruction_1 */ 240 .org trap_table + TT_TRAP_INSTRUCTION(1)*ENTRY_SIZE 241 .global trap_instruction_1 242 trap_instruction_1: 243 TRAP_INSTRUCTION 1 244 245 /* TT = 0x102, TL = 0, trap_instruction_2 */ 246 .org trap_table + TT_TRAP_INSTRUCTION(2)*ENTRY_SIZE 247 .global trap_instruction_2 248 trap_instruction_2: 249 TRAP_INSTRUCTION 2 250 251 /* TT = 0x103, TL = 0, trap_instruction_3 */ 252 .org trap_table + TT_TRAP_INSTRUCTION(3)*ENTRY_SIZE 253 .global trap_instruction_3 254 trap_instruction_3: 255 TRAP_INSTRUCTION 3 256 257 /* TT = 0x104, TL = 0, trap_instruction_4 */ 258 .org trap_table + TT_TRAP_INSTRUCTION(4)*ENTRY_SIZE 259 .global trap_instruction_4 260 trap_instruction_4: 261 TRAP_INSTRUCTION 4 262 263 /* TT = 0x105, TL = 0, trap_instruction_5 */ 264 .org trap_table + TT_TRAP_INSTRUCTION(5)*ENTRY_SIZE 265 .global trap_instruction_5 266 trap_instruction_5: 267 TRAP_INSTRUCTION 5 268 269 /* TT = 0x106, TL = 0, trap_instruction_6 */ 270 .org trap_table + TT_TRAP_INSTRUCTION(6)*ENTRY_SIZE 271 .global trap_instruction_6 272 trap_instruction_6: 273 TRAP_INSTRUCTION 6 274 275 /* TT = 0x107, TL = 0, trap_instruction_7 */ 276 .org trap_table + TT_TRAP_INSTRUCTION(7)*ENTRY_SIZE 277 .global trap_instruction_7 278 trap_instruction_7: 279 TRAP_INSTRUCTION 7 280 281 /* TT = 0x108, TL = 0, trap_instruction_8 */ 282 .org trap_table + TT_TRAP_INSTRUCTION(8)*ENTRY_SIZE 283 .global trap_instruction_8 284 trap_instruction_8: 285 TRAP_INSTRUCTION 8 286 287 /* TT = 0x109, TL = 0, trap_instruction_9 */ 288 .org trap_table + TT_TRAP_INSTRUCTION(9)*ENTRY_SIZE 289 .global trap_instruction_9 290 trap_instruction_9: 291 TRAP_INSTRUCTION 9 292 293 /* TT = 0x10a, TL = 0, trap_instruction_10 */ 294 .org trap_table + TT_TRAP_INSTRUCTION(10)*ENTRY_SIZE 295 .global trap_instruction_10 296 trap_instruction_10: 297 TRAP_INSTRUCTION 10 298 299 /* TT = 0x10b, TL = 0, trap_instruction_11 */ 300 .org trap_table + TT_TRAP_INSTRUCTION(11)*ENTRY_SIZE 301 .global trap_instruction_11 302 trap_instruction_11: 303 TRAP_INSTRUCTION 11 304 305 /* TT = 0x10c, TL = 0, trap_instruction_12 */ 306 .org trap_table + TT_TRAP_INSTRUCTION(12)*ENTRY_SIZE 307 .global trap_instruction_12 308 trap_instruction_12: 309 TRAP_INSTRUCTION 12 310 311 /* TT = 0x10d, TL = 0, trap_instruction_13 */ 312 .org trap_table + TT_TRAP_INSTRUCTION(13)*ENTRY_SIZE 313 .global trap_instruction_13 314 trap_instruction_13: 315 TRAP_INSTRUCTION 13 316 317 /* TT = 0x10e, TL = 0, trap_instruction_14 */ 318 .org trap_table + TT_TRAP_INSTRUCTION(14)*ENTRY_SIZE 319 .global trap_instruction_14 320 trap_instruction_14: 321 TRAP_INSTRUCTION 14 322 323 /* TT = 0x10f, TL = 0, trap_instruction_15 */ 324 .org trap_table + TT_TRAP_INSTRUCTION(15)*ENTRY_SIZE 325 .global trap_instruction_15 326 trap_instruction_15: 327 TRAP_INSTRUCTION 15 328 329 /* TT = 0x110, TL = 0, trap_instruction_16 */ 330 .org trap_table + TT_TRAP_INSTRUCTION(16)*ENTRY_SIZE 331 .global trap_instruction_16 332 trap_instruction_16: 333 TRAP_INSTRUCTION 16 334 335 /* TT = 0x111, TL = 0, trap_instruction_17 */ 336 .org trap_table + TT_TRAP_INSTRUCTION(17)*ENTRY_SIZE 337 .global trap_instruction_17 338 trap_instruction_17: 339 TRAP_INSTRUCTION 17 340 341 /* TT = 0x112, TL = 0, trap_instruction_18 */ 342 .org trap_table + TT_TRAP_INSTRUCTION(18)*ENTRY_SIZE 343 .global trap_instruction_18 344 trap_instruction_18: 345 TRAP_INSTRUCTION 18 346 347 /* TT = 0x113, TL = 0, trap_instruction_19 */ 348 .org trap_table + TT_TRAP_INSTRUCTION(19)*ENTRY_SIZE 349 .global trap_instruction_19 350 trap_instruction_19: 351 TRAP_INSTRUCTION 19 352 353 /* TT = 0x114, TL = 0, trap_instruction_20 */ 354 .org trap_table + TT_TRAP_INSTRUCTION(20)*ENTRY_SIZE 355 .global trap_instruction_20 356 trap_instruction_20: 357 TRAP_INSTRUCTION 20 358 359 /* TT = 0x115, TL = 0, trap_instruction_21 */ 360 .org trap_table + TT_TRAP_INSTRUCTION(21)*ENTRY_SIZE 361 .global trap_instruction_21 362 trap_instruction_21: 363 TRAP_INSTRUCTION 21 364 365 /* TT = 0x116, TL = 0, trap_instruction_22 */ 366 .org trap_table + TT_TRAP_INSTRUCTION(22)*ENTRY_SIZE 367 .global trap_instruction_22 368 trap_instruction_22: 369 TRAP_INSTRUCTION 22 370 371 /* TT = 0x117, TL = 0, trap_instruction_23 */ 372 .org trap_table + TT_TRAP_INSTRUCTION(23)*ENTRY_SIZE 373 .global trap_instruction_23 374 trap_instruction_23: 375 TRAP_INSTRUCTION 23 376 377 /* TT = 0x118, TL = 0, trap_instruction_24 */ 378 .org trap_table + TT_TRAP_INSTRUCTION(24)*ENTRY_SIZE 379 .global trap_instruction_24 380 trap_instruction_24: 381 TRAP_INSTRUCTION 24 382 383 /* TT = 0x119, TL = 0, trap_instruction_25 */ 384 .org trap_table + TT_TRAP_INSTRUCTION(25)*ENTRY_SIZE 385 .global trap_instruction_25 386 trap_instruction_25: 387 TRAP_INSTRUCTION 25 388 389 /* TT = 0x11a, TL = 0, trap_instruction_26 */ 390 .org trap_table + TT_TRAP_INSTRUCTION(26)*ENTRY_SIZE 391 .global trap_instruction_26 392 trap_instruction_26: 393 TRAP_INSTRUCTION 26 394 395 /* TT = 0x11b, TL = 0, trap_instruction_27 */ 396 .org trap_table + TT_TRAP_INSTRUCTION(27)*ENTRY_SIZE 397 .global trap_instruction_27 398 trap_instruction_27: 399 TRAP_INSTRUCTION 27 400 401 /* TT = 0x11c, TL = 0, trap_instruction_28 */ 402 .org trap_table + TT_TRAP_INSTRUCTION(28)*ENTRY_SIZE 403 .global trap_instruction_28 404 trap_instruction_28: 405 TRAP_INSTRUCTION 28 406 407 /* TT = 0x11d, TL = 0, trap_instruction_29 */ 408 .org trap_table + TT_TRAP_INSTRUCTION(29)*ENTRY_SIZE 409 .global trap_instruction_29 410 trap_instruction_29: 411 TRAP_INSTRUCTION 29 412 413 /* TT = 0x11e, TL = 0, trap_instruction_30 */ 414 .org trap_table + TT_TRAP_INSTRUCTION(30)*ENTRY_SIZE 415 .global trap_instruction_30 416 trap_instruction_30: 417 TRAP_INSTRUCTION 30 418 419 /* TT = 0x11f, TL = 0, trap_instruction_31 */ 420 .org trap_table + TT_TRAP_INSTRUCTION(31)*ENTRY_SIZE 421 .global trap_instruction_31 422 trap_instruction_31: 423 TRAP_INSTRUCTION 31 424 232 425 /* 233 426 * Handlers for TL>0. … … 306 499 FILL_NORMAL_HANDLER_KERNEL 307 500 501 #define NOT(x) ((x) == 0) 308 502 309 503 /* Preemptible trap handler for TL=1. … … 324 518 * %g7 Pre-set as address of the userspace window buffer. 325 519 */ 326 . global preemptible_handler327 preemptible_handler: 520 .macro PREEMPTIBLE_HANDLER_TEMPLATE is_syscall 521 .if NOT(\is_syscall) 328 522 rdpr %tstate, %g3 329 523 andcc %g3, TSTATE_PRIV_BIT, %g0 ! if this trap came from the privileged mode... 330 524 bnz 0f ! ...skip setting of kernel stack and primary context 331 525 nop 332 526 .endif 333 527 /* 334 528 * Normal window spills will go to the userspace window buffer. … … 342 536 */ 343 537 save %g6, -PREEMPTIBLE_HANDLER_STACK_FRAME_SIZE, %sp 538 539 .if \is_syscall 540 /* 541 * Copy arguments for the syscall to the new window. 542 */ 543 mov %i0, %o2 544 mov %i1, %o3 545 mov %i2, %o4 546 mov %i3, %o5 547 .endif 344 548 345 549 /* … … 360 564 flush %l0 361 565 566 .if NOT(\is_syscall) 362 567 ba 1f 363 568 nop … … 371 576 */ 372 577 1: 373 578 .endif 374 579 /* 375 580 * Other window spills will go to the userspace window buffer … … 409 614 call %l0 410 615 add %sp, PREEMPTIBLE_HANDLER_STACK_FRAME_SIZE + STACK_BIAS + SAVED_TNPC, %o1 616 617 .if \is_syscall 618 /* 619 * Copy the value returned by the syscall. 620 */ 621 mov %o0, %i0 622 .endif 411 623 412 624 RESTORE_GLOBALS … … 489 701 */ 490 702 0: 703 .if NOT(\is_syscall) 491 704 rdpr %tstate, %g1 492 705 andcc %g1, TSTATE_PRIV_BIT, %g0 ! if we are not returning to userspace..., 493 706 bnz 1f ! ...skip restoring userspace windows 494 707 nop 708 .endif 495 709 496 710 /* … … 573 787 1: 574 788 restore 789 790 .if \is_syscall 791 done 792 .else 575 793 retry 794 .endif 576 795 577 796 /* … … 606 825 wrpr %g1, 0, %cwp ! CWP-- 607 826 827 .if \is_syscall 828 done 829 .else 608 830 retry 831 .endif 832 833 .endm 834 835 .global preemptible_handler 836 preemptible_handler: 837 PREEMPTIBLE_HANDLER_TEMPLATE 0 838 839 .global trap_instruction_handler 840 trap_instruction_handler: 841 PREEMPTIBLE_HANDLER_TEMPLATE 1 -
kernel/generic/src/syscall/syscall.c
r6767c1d r9314ee1 27 27 */ 28 28 29 29 /** @addtogroup generic 30 30 * @{ 31 31 */ … … 160 160 }; 161 161 162 162 /** @} 163 163 */ 164
Note:
See TracChangeset
for help on using the changeset viewer.