[haiku-bugs] Re: [Haiku] #1141: Support for x86-64 architecture

  • From: "bonefish" <trac@xxxxxxxxxxxx>
  • Date: Tue, 11 May 2010 19:42:56 -0000

#1141: Support for x86-64 architecture
---------------------------+------------------------------------------------
 Reporter:  ekdahl         |       Owner:  bonefish   
     Type:  enhancement    |      Status:  assigned   
 Priority:  normal         |   Milestone:  Unscheduled
Component:  System/Kernel  |     Version:             
 Keywords:                 |   Blockedby:             
 Platform:  x86-64         |    Blocking:             
---------------------------+------------------------------------------------

Comment(by bonefish):

 Replying to [comment:14 nmentley]:

 Sorry for the delay. Things were a bit busy in the last week.

 The latest Haiku trunk patch is somewhat broken. The third hunk for
 `build/jam/BuildSetup` has the wrong length, which causes patch to fail
 (with an unfortunately not very helpful error message). In case you edited
 the patch by hand, this is apparently something one shouldn't forget
 about.

 > I've submitted the patch with the corrections you've suggested.
 >
 > Just a few notes.
 >
 > gcc/gcc/config/i386/haiku64.h:
 > I irresponsibly left the comment "If ELF is the default format, we
 should not use /lib/elf" in from the file I based haiku64.h off of...
 Which happens to be haiku.h of the same directory. That comment is
 actually included in all the gcc/gcc/config/(arch)/haiku.h files strangely
 enough.

 Very irresponsibly indeed. ;-) Seems the comment originates from `beos-
 elf.h` already.

 > build/jam/BuildSetup:
 > I'm currently reading up on the atomic_*() functions... So I might be
 alittle off here.
 > In headers/os/support/SupportDefs.h: I've implemented sub, xor, nand,
 but I'm unsure of the atomic_set function. I've commented it out for now.
 > I've included the newly defined atomic functions in the definition
 B_USE_EXTRA_BUILTIN_ATOMIC_FUNCTIONS since these builtins aren't supported
 in x86. This might not be the cleanest way to define the atomic functions
 tho.

 There are no `atomic_{sub,xor,nand}()` in the public API, so there's no
 need to add those. Please note that the macros in `<SupportDefs.h>` are
 only there for optimization purposes. It doesn't matter whether macros are
 missing there (e.g. atomic_set()). The functions have to be implemented
 anyway (in src/system/libroot/os/arch/x86_64). Feel free to use hand-coded
 assembly or C++ just using the built-ins.

 > headers/posix/arch/x86_64/arch_setjmp.h:
 > I used 12 since it's the jmpbuf size on freebsd amd64, but that'll be
 changed to a more logical jmpbuf size later.

 OK, I was merely wondering because that is the same size as for x86,
 although the registers are twice as wide.

 > Correcnt me if I'm wrong, but I was under the impression that setjmp()
 and longjmp() are defined in
 src/system/libroot/ponix/arch/(arch)/siglongjmp.S and
 src/system/libroot/ponix/arch/(arch)/sigsetjmp.S and not in this file.

 Yep, they are. You wouldn't get very far implementing them with a too
 short structure definition, though.

 > They don't have much to do with the gnu toolchain which was atleast my
 goal for this patch, but I'll for sure work on setjmp() and longjmp()
 before continuing working with haiku_loader.

 OK.

 Applied the buildtools patch in r36793. Applied the Haiku trunk patch in
 r36794, removing the extra atomic_*() part. Thanks a lot!

-- 
Ticket URL: <http://dev.haiku-os.org/ticket/1141#comment:17>
Haiku <http://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: