Mercurial > illumos > illumos-gate
comparison usr/src/uts/intel/ia32/os/archdep.c @ 12613:4c5722bc28dc
PSARC/2010/169 EOF lx brand
6959264 EOF lx brand
author | Surya Prakki <Surya.Prakki@Sun.COM> |
---|---|
date | Fri, 11 Jun 2010 12:07:14 -0700 |
parents | 8e4cf0dbd8ca |
children | ab9ae749152f |
comparison
equal
deleted
inserted
replaced
12612:29da3d2c2ccb | 12613:4c5722bc28dc |
---|---|
17 * information: Portions Copyright [yyyy] [name of copyright owner] | 17 * information: Portions Copyright [yyyy] [name of copyright owner] |
18 * | 18 * |
19 * CDDL HEADER END | 19 * CDDL HEADER END |
20 */ | 20 */ |
21 /* | 21 /* |
22 * Copyright 2009 Sun Microsystems, Inc. All rights reserved. | 22 * Copyright (c) 1992, 2010, Oracle and/or its affiliates. All rights reserved. |
23 * Use is subject to license terms. | |
24 */ | 23 */ |
25 | 24 |
26 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ | 25 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ |
27 /* All Rights Reserved */ | 26 /* All Rights Reserved */ |
28 | 27 |
602 | 601 |
603 /*ARGSUSED*/ | 602 /*ARGSUSED*/ |
604 static greg_t | 603 static greg_t |
605 fix_segreg(greg_t sr, int iscs, model_t datamodel) | 604 fix_segreg(greg_t sr, int iscs, model_t datamodel) |
606 { | 605 { |
607 kthread_t *t = curthread; | |
608 | |
609 switch (sr &= 0xffff) { | 606 switch (sr &= 0xffff) { |
610 | 607 |
611 case 0: | 608 case 0: |
612 if (iscs == IS_CS) | 609 if (iscs == IS_CS) |
613 return (0 | SEL_UPL); | 610 return (0 | SEL_UPL); |
637 case LWPGS_SEL: | 634 case LWPGS_SEL: |
638 case SEL_UPL: | 635 case SEL_UPL: |
639 return (sr); | 636 return (sr); |
640 default: | 637 default: |
641 break; | 638 break; |
642 } | |
643 | |
644 /* | |
645 * Allow this process's brand to do any necessary segment register | |
646 * manipulation. | |
647 */ | |
648 if (PROC_IS_BRANDED(t->t_procp) && BRMOP(t->t_procp)->b_fixsegreg) { | |
649 greg_t bsr = BRMOP(t->t_procp)->b_fixsegreg(sr, datamodel); | |
650 | |
651 if (bsr == 0 && iscs == IS_CS) | |
652 return (0 | SEL_UPL); | |
653 else | |
654 return (bsr); | |
655 } | 639 } |
656 | 640 |
657 /* | 641 /* |
658 * Force it into the LDT in ring 3 for 32-bit processes, which by | 642 * Force it into the LDT in ring 3 for 32-bit processes, which by |
659 * default do not have an LDT, so that any attempt to use an invalid | 643 * default do not have an LDT, so that any attempt to use an invalid |