#15636: Document ABI conventions
--------------------+------------------------------
Reporter: X512 | Owner: nobody
Type: task | Status: new
Priority: normal | Milestone: Unscheduled
Component: System | Version: R1/Development
Keywords: | Blocked By:
Blocking: | Has a Patch: 0
Platform: All |
--------------------+------------------------------
ABI conventions used by Haiku for each architecture (x86 gcc2, x86 gcc4+,
x86_64) should be documented in some way (in web site, HaikuBook etc.).
At least following topics should be documented:
* Preserved registers, including SIMD registers etc.
* FPU state.
* Passing arguments to function and return value.
* Stack alignment.
* Exception handling and stack unwinding.
* Executable format.
If Haiku use some existing ABI, it should be referenced in documentation
with Haiku specific changes, if any.
I tried to port some non C/C++ compiler (target ABI: x86 gcc4+) and make
Haiku API bindings and experience various problems such as:
* Structs passed by value (such as `pattern`) are stored on stack as is,
but classes such as `BPoint` are passed by pointer.
* `StrokeLine(BPoint, BPoint, pattern)` is not working if stack is not
aligned.
--
Ticket URL: <https://dev.haiku-os.org/ticket/15636>
Haiku <https://dev.haiku-os.org>
The Haiku operating system.