Skip to content

Commit

Permalink
i#2080 sigreturn: fix Mac build breakage
Browse files Browse the repository at this point in the history
Fixes Mac build breakage caused by 03eaf62.

Review-URL: https://codereview.appspot.com/318930043
  • Loading branch information
derekbruening committed Dec 7, 2016
1 parent 184dd8b commit d6fd2c9
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions core/unix/signal.c
Expand Up @@ -2306,14 +2306,20 @@ thread_set_segment_registers(sigcontext_t *sc)
{
#ifdef X86
/* Fill in the segment registers */
__asm__ __volatile__("mov %%cs, %%ax; mov %%ax, %0" : "=m"(sc->cs) : : "eax");
__asm__ __volatile__("mov %%cs, %%ax; mov %%ax, %0" : "=m"(sc->SC_FIELD(cs))
: : "eax");
# ifndef X64
__asm__ __volatile__("mov %%ss, %%ax; mov %%ax, %0" : "=m"(sc->ss) : : "eax");
__asm__ __volatile__("mov %%ds, %%ax; mov %%ax, %0" : "=m"(sc->ds) : : "eax");
__asm__ __volatile__("mov %%es, %%ax; mov %%ax, %0" : "=m"(sc->es) : : "eax");
__asm__ __volatile__("mov %%ss, %%ax; mov %%ax, %0" : "=m"(sc->SC_FIELD(ss))
: : "eax");
__asm__ __volatile__("mov %%ds, %%ax; mov %%ax, %0" : "=m"(sc->SC_FIELD(ds))
: : "eax");
__asm__ __volatile__("mov %%es, %%ax; mov %%ax, %0" : "=m"(sc->SC_FIELD(es))
: : "eax");
# endif
__asm__ __volatile__("mov %%fs, %%ax; mov %%ax, %0" : "=m"(sc->fs) : : "eax");
__asm__ __volatile__("mov %%gs, %%ax; mov %%ax, %0" : "=m"(sc->gs) : : "eax");
__asm__ __volatile__("mov %%fs, %%ax; mov %%ax, %0" : "=m"(sc->SC_FIELD(fs))
: : "eax");
__asm__ __volatile__("mov %%gs, %%ax; mov %%ax, %0" : "=m"(sc->SC_FIELD(gs))
: : "eax");
#endif
}

Expand Down

0 comments on commit d6fd2c9

Please sign in to comment.