Segment.c 353 B

123456789101112131415
  1. /* This Hello World simply print out "Hello World" */
  2. #include "pal.h"
  3. #include "pal_debug.h"
  4. void * private = &private;
  5. int main (int argc, char ** argv, char ** envp)
  6. {
  7. DkSegmentRegister(PAL_SEGMENT_FS, private);
  8. void * ptr;
  9. __asm__ volatile("mov %%fs:0, %0" : "=r"(ptr) :: "memory");
  10. pal_printf("TLS = %p\n", ptr);
  11. return 0;
  12. }