Segment.c 525 B

123456789101112131415161718
  1. /* -*- mode:c; c-file-style:"k&r"; c-basic-offset: 4; tab-width:4; indent-tabs-mode:nil; mode:auto-fill; fill-column:78; -*- */
  2. /* vim: set ts=4 sw=4 et tw=78 fo=cqt wm=0: */
  3. /* This Hello World simply print out "Hello World" */
  4. #include "pal.h"
  5. #include "pal_debug.h"
  6. void * private = &private;
  7. int main (int argc, char ** argv, char ** envp)
  8. {
  9. DkSegmentRegister(PAL_SEGMENT_FS, private);
  10. void * ptr;
  11. asm volatile("mov %%fs:0, %0" : "=r"(ptr) :: "memory");
  12. pal_printf("TLS = %p\n", ptr);
  13. return 0;
  14. }