Skip to content

Commit

Permalink
musl 1.2.5: update __libc struct
Browse files Browse the repository at this point in the history
  • Loading branch information
MagnusS committed Jul 3, 2024
1 parent 9ca3ed3 commit 57bdaf7
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/platform/x86_pc/smp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,25 +44,28 @@ struct apic_boot {
uint32_t stack_base;
uint32_t stack_size;
};

struct __libc {
int can_do_threads;
int threaded;
int secure;
volatile int threads_minus_1;
size_t* auxv;
char can_do_threads;
char threaded;
char secure;
volatile signed char need_locks;
int threads_minus_1;
size_t *auxv;
};
extern struct __libc __libc;
//extern "C" struct __libc *__libc_loc(void) __attribute__((const));
//#define __libc (*__libc_loc())

static inline void musl_override_glob_locks()
{
printf("__libc.can_do_threads: %d __libc.threaded: %d\n",
printf("__libc.can_do_threads: %d\n__libc.threaded: %d\n",
__libc.can_do_threads, __libc.threaded);
printf("__libc.threads_minus_1: %d -> %d\n",
__libc.threads_minus_1, 1);
__libc.threads_minus_1 = 1;
printf("__libc.need_locks: %d -> 1",
__libc.need_locks);
__libc.need_locks = 1;
}

namespace x86
Expand Down

0 comments on commit 57bdaf7

Please sign in to comment.