Print this page
10076 make usr/src/test smatch clean


  51 static void badss(void)
  52 {
  53         __asm__ volatile("movw %0, %%ss" : : "r" (selector));
  54 }
  55 
  56 static void
  57 resetseg(uint_t seg)
  58 {
  59         ucontext_t ucp;
  60         volatile int done = 0;
  61 
  62         int rc = getcontext(&ucp);
  63         if (done) {
  64                 (void) getcontext(&ucp);
  65                 return;
  66         }
  67 
  68         if (rc == 0) {
  69                 done = 1;
  70                 ucp.uc_mcontext.gregs[seg] = selector;
  71                 setcontext(&ucp);
  72         }
  73         abort();
  74 }
  75 
  76 static void
  77 resetcs(void)
  78 {
  79         return (resetseg(CS));
  80 }
  81 
  82 static void
  83 resetds(void)
  84 {
  85         return (resetseg(DS));
  86 }
  87 
  88 static void
  89 resetes(void)
  90 {
  91         return (resetseg(ES));




  51 static void badss(void)
  52 {
  53         __asm__ volatile("movw %0, %%ss" : : "r" (selector));
  54 }
  55 
  56 static void
  57 resetseg(uint_t seg)
  58 {
  59         ucontext_t ucp;
  60         volatile int done = 0;
  61 
  62         int rc = getcontext(&ucp);
  63         if (done) {
  64                 (void) getcontext(&ucp);
  65                 return;
  66         }
  67 
  68         if (rc == 0) {
  69                 done = 1;
  70                 ucp.uc_mcontext.gregs[seg] = selector;
  71                 (void) setcontext(&ucp);
  72         }
  73         abort();
  74 }
  75 
  76 static void
  77 resetcs(void)
  78 {
  79         return (resetseg(CS));
  80 }
  81 
  82 static void
  83 resetds(void)
  84 {
  85         return (resetseg(DS));
  86 }
  87 
  88 static void
  89 resetes(void)
  90 {
  91         return (resetseg(ES));