Print this page
104 Bring back lx brand


 615         / Interrupts will be turned on by the 'sti' executed just before
 616         / sysexit. The following ensures that restoring the user's EFLAGS
 617         / doesn't enable interrupts too soon.
 618         andl    $_BITNOT(PS_IE), REGOFF_EFL(%esp)
 619 
 620         MSTATE_TRANSITION(LMS_SYSTEM, LMS_USER)
 621 
 622         cli
 623 
 624         SYSCALL_POP
 625 
 626         popl    %edx                    / sysexit: %edx -> %eip
 627         addl    $4, %esp                / get CS off the stack
 628         popfl                           / EFL
 629         popl    %ecx                    / sysexit: %ecx -> %esp
 630         sti
 631         sysexit
 632         SET_SIZE(sys_sysenter)
 633         SET_SIZE(brand_sys_sysenter)
 634 



 635 /*




























 636  * Declare a uintptr_t which covers the entire pc range of syscall
 637  * handlers for the stack walkers that need this.
 638  */
 639         .align  CPTRSIZE
 640         .globl  _allsyscalls_size
 641         .type   _allsyscalls_size, @object
 642 _allsyscalls_size:
 643         .NWORD  . - _allsyscalls
 644         SET_SIZE(_allsyscalls_size)
 645 
 646 #endif  /* __lint */
 647 
 648 /*
 649  * These are the thread context handlers for lwps using sysenter/sysexit.
 650  */
 651 
 652 #if defined(__lint)
 653 
 654 /*ARGSUSED*/
 655 void




 615         / Interrupts will be turned on by the 'sti' executed just before
 616         / sysexit. The following ensures that restoring the user's EFLAGS
 617         / doesn't enable interrupts too soon.
 618         andl    $_BITNOT(PS_IE), REGOFF_EFL(%esp)
 619 
 620         MSTATE_TRANSITION(LMS_SYSTEM, LMS_USER)
 621 
 622         cli
 623 
 624         SYSCALL_POP
 625 
 626         popl    %edx                    / sysexit: %edx -> %eip
 627         addl    $4, %esp                / get CS off the stack
 628         popfl                           / EFL
 629         popl    %ecx                    / sysexit: %ecx -> %esp
 630         sti
 631         sysexit
 632         SET_SIZE(sys_sysenter)
 633         SET_SIZE(brand_sys_sysenter)
 634 
 635 #endif  /* __lint */
 636 
 637 #if defined(__lint)
 638 /*
 639  * System call via an int80.  This entry point is only used by the Linux
 640  * application environment.  Unlike the sysenter path, there is no default
 641  * action to take if no callback is registered for this process.
 642  */
 643 void
 644 sys_int80()
 645 {}
 646 
 647 #else   /* __lint */
 648 
 649         ENTRY_NP(brand_sys_int80)
 650         BRAND_CALLBACK(BRAND_CB_INT80)
 651 
 652         ALTENTRY(sys_int80)
 653         /*
 654          * We hit an int80, but this process isn't of a brand with an int80
 655          * handler.  Bad process!  Make it look as if the INT failed.
 656          * Modify %eip to point before the INT, push the expected error
 657          * code and fake a GP fault.
 658          * 
 659          */
 660         subl    $2, (%esp)      /* int insn 2-bytes */
 661         pushl   $_CONST(_MUL(T_INT80, GATE_DESC_SIZE) + 2)
 662         jmp     gptrap                  / GP fault
 663         SET_SIZE(sys_int80)
 664         SET_SIZE(brand_sys_int80)
 665 
 666 /*
 667  * Declare a uintptr_t which covers the entire pc range of syscall
 668  * handlers for the stack walkers that need this.
 669  */
 670         .align  CPTRSIZE
 671         .globl  _allsyscalls_size
 672         .type   _allsyscalls_size, @object
 673 _allsyscalls_size:
 674         .NWORD  . - _allsyscalls
 675         SET_SIZE(_allsyscalls_size)
 676 
 677 #endif  /* __lint */
 678 
 679 /*
 680  * These are the thread context handlers for lwps using sysenter/sysexit.
 681  */
 682 
 683 #if defined(__lint)
 684 
 685 /*ARGSUSED*/
 686 void