summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2018-03-28 01:46:57 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2018-03-28 01:46:57 +0200
commitf63fff0be94f0c10bb7262dfc26074b847d0a98c (patch)
treef2ef9878d6c4b36b6993ddf152b8b9582fb4cb12
parentef701f63fa3053a2d0560ac02390b3c8c912fa01 (diff)
Fix coding style
-rw-r--r--sysdeps/mach/hurd/i386/pt-machdep.c34
-rw-r--r--sysdeps/mach/hurd/i386/pt-setup.c17
2 files changed, 26 insertions, 25 deletions
diff --git a/sysdeps/mach/hurd/i386/pt-machdep.c b/sysdeps/mach/hurd/i386/pt-machdep.c
index c43b00c..9b2083d 100644
--- a/sysdeps/mach/hurd/i386/pt-machdep.c
+++ b/sysdeps/mach/hurd/i386/pt-machdep.c
@@ -39,9 +39,9 @@
int
__thread_set_pcsptp (thread_t thread,
- int set_ip, void *ip,
- int set_sp, void *sp,
- int set_tp, void *tp)
+ int set_ip, void *ip,
+ int set_sp, void *sp,
+ int set_tp, void *tp)
{
error_t err;
struct i386_thread_state state;
@@ -58,23 +58,23 @@ __thread_set_pcsptp (thread_t thread,
state.uesp = (unsigned int) sp;
if (set_ip)
state.eip = (unsigned int) ip;
- if (set_tp) {
- HURD_TLS_DESC_DECL(desc, tp);
- int sel;
+ if (set_tp)
+ {
+ HURD_TLS_DESC_DECL (desc, tp);
+ int sel;
- asm ("mov %%gs, %w0" : "=q" (sel) : "0" (0));
- if (__builtin_expect (sel, 0x48) & 4) /* LDT selector */
- err = __i386_set_ldt (thread, sel, &desc, 1);
- else
- err = __i386_set_gdt (thread, &sel, desc);
- if (err)
- return err;
- state.gs = sel;
- }
+ asm ("mov %%gs, %w0": "=q" (sel):"0" (0));
+ if (__builtin_expect (sel, 0x48) & 4) /* LDT selector */
+ err = __i386_set_ldt (thread, sel, &desc, 1);
+ else
+ err = __i386_set_gdt (thread, &sel, desc);
+ if (err)
+ return err;
+ state.gs = sel;
+ }
err = __thread_set_state (thread, i386_REGS_SEGS_STATE,
- (thread_state_t) &state,
- i386_THREAD_STATE_COUNT);
+ (thread_state_t) &state, i386_THREAD_STATE_COUNT);
if (err)
return err;
diff --git a/sysdeps/mach/hurd/i386/pt-setup.c b/sysdeps/mach/hurd/i386/pt-setup.c
index 96ea95c..b498e50 100644
--- a/sysdeps/mach/hurd/i386/pt-setup.c
+++ b/sysdeps/mach/hurd/i386/pt-setup.c
@@ -38,7 +38,7 @@
Return the stack pointer for the new thread. */
static void *
stack_setup (struct __pthread *thread,
- void *(*start_routine)(void *), void *arg)
+ void *(*start_routine) (void *), void *arg)
{
error_t err;
uintptr_t *bottom, *top;
@@ -46,8 +46,8 @@ stack_setup (struct __pthread *thread,
/* Calculate the top of the new stack. */
bottom = thread->stackaddr;
top = (uintptr_t *) ((uintptr_t) bottom + thread->stacksize
- + ((thread->guardsize + __vm_page_size-1)
- / __vm_page_size) * __vm_page_size);
+ + ((thread->guardsize + __vm_page_size - 1)
+ / __vm_page_size) * __vm_page_size);
if (start_routine)
{
@@ -72,8 +72,9 @@ stack_setup (struct __pthread *thread,
int
__pthread_setup (struct __pthread *thread,
- void (*entry_point)(struct __pthread *, void *(*)(void *), void *),
- void *(*start_routine)(void *), void *arg)
+ void (*entry_point) (struct __pthread *, void *(*)(void *),
+ void *), void *(*start_routine) (void *),
+ void *arg)
{
tcbhead_t *tcb;
error_t err;
@@ -95,9 +96,9 @@ __pthread_setup (struct __pthread *thread,
else
{
err = __thread_set_pcsptp (thread->kernel_thread,
- 1, thread->mcontext.pc,
- 1, thread->mcontext.sp,
- 1, thread->tcb);
+ 1, thread->mcontext.pc,
+ 1, thread->mcontext.sp,
+ 1, thread->tcb);
assert_perror (err);
tcb = thread->tcb;
}