History log of /haiku/src/tools/gensyscalls/gensyscalls.cpp
Revision Date Author Comments
# ab3c8bea 05-Apr-2022 David Karoly <karolyd577@gmail.com>

gensyscalls: alignment fixup for ARM

ARM ABI has different alignment requirements based on parameter size:
* parameters not larger than 4 bytes are aligned on 4 bytes
* parameters larger than 4 bytes are aligned on 8 bytes

see:
Procedure Call Standard for the Arm Architecture
sections 5.1, Fundamental Data Types
and 6.5, Parameter Passing

Therefore the following changes are introduced in gensyscalls tool:
* new optional define SYSCALL_LONG_PARAMETER_ALIGNMENT_TYPE is introduced
* it's defined only on ARM
* on other architectures it takes on the value of SYSCALL_PARAMETER_ALIGNMENT_TYPE as a default
* constants kLongParameterAlignmentType and kLongParameterAlignmentSize are introduced
* Syscall::AddParameter uses this value for aligning parameters larger than 4 bytes

Change-Id: I7e766e0ea9d07001643e813722b462b1f044921a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5112
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>


# 45bd7bb3 25-Jun-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

Removed unnecessary inclusions of <boot/kernel_args.h> in private kernel
headers and respectively added includes in source files.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37259 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 59d6284b 27-Nov-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Changed the way the syscall infos are generated. We no longer include the
preprocessed <syscalls.h> header in sources compiled for the build platform.
Instead we're generating macros for the return type and parameter type sizes
via the CreateAsmStructOffsetsHeader rule (no template magic anymore) and
thus get a clear separation of host and target code, resulting in better
portability (although surprisingly enough the build already worked on 64 bit
hosts).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34323 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 23f179da 25-Nov-2009 Axel Dörfler <axeld@pinc-software.de>

* Cleanup, no functional change.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34237 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 7200c6f4 19-Jun-2009 Axel Dörfler <axeld@pinc-software.de>

* Fixed warnings.
* Automatic whitespace cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31114 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e7c8829c 27-May-2009 Jérôme Duval <korli@users.berlios.de>

strchr(const char*, ...) returns const char* in C++, identified by gcc 4.4.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30882 a95241bf-73f2-0310-859d-f6bbb57e9c96


# cbd4dd19 24-Feb-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Patch by Vasilis Kaoutsis: Added missing headers. Fixes the build on
certain Linux distributions.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24109 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ed854de7 07-Feb-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Also include info about the syscall return type in the
extended_syscall_info structure.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23916 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b4f58d87 21-Jan-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Renamed syscall_parameters_info structure to extended_syscall_info (and
kSyscallParametersInfos to kExtendedSyscallInfos) and added "name"
field. Now the classes for syscall kernel tracing don't need to lookup
the syscall function symbol anymore, which speeds up printing/filtering
of those entries dramatically.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23687 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 19101ba0 18-Jan-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Generate a kernel array kSyscallParametersInfos containing information
about syscall parameters. Particularly interesting is a type_code field
for each parameter. The mechanism isn't very accurate, but we can
classify everything in string, pointer, and integer types.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23618 a95241bf-73f2-0310-859d-f6bbb57e9c96


# bbaaf4b7 18-Jan-2008 Jérôme Duval <korli@users.berlios.de>

gcc4 requires a cast, so we prepend (void *) to cast every syscall function
fixed syscall.cpp inclusions due to renaming


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23611 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 34b3b26b 10-Jan-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Merged branch haiku/branches/developer/bonefish/optimization revision
23139 into trunk, with roughly the following changes (for details svn
log the branch):
* The int 99 syscall handler is now fully in assembly.
* Added a sysenter/sysexit handler and use it on Pentiums that support
it (via commpage).
* Got rid of i386_handle_trap(). A bit of functionality was moved into
the assembly handler which now uses a jump table to call C functions
handling the respective interrupt.
* Some optimizations to get user debugger support code out of the
interrupt handling path.
* Introduced a thread::flags fields which allows to skip handling of
rare events (signals, user debug enabling/disabling) on the
common interrupt handling path.
* Got rid of the explicit iframe stack. The iframes can still be
retrieved by iterating through the stack frames.
* Made the commpage an architecture independent feature. It's used for
the real time data stuff (instead of creating a separate area).
* The x86 CPU modules can now provide processor optimized versions for
common functions (currently memcpy() only). They are used in the
kernel and are provided to the userland via commpage entries.
* Introduced build system feature allowing easy use of C structure
member offsets in assembly code.

Changes after merging:
* Fixed merge conflict in src/system/kernel/arch/x86/arch_debug.cpp
(caused by refactoring and introduction of "call" debugger command).



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23370 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2ae56893 27-Nov-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Reworked the way how the gensyscalls stuff finds out about
the sizes and alignments of syscall parameters. It no longer
generates and compiles functions with the same signature as the
syscalls. This simply doesn't generally work for cross-compilation.
Instead we provide a bit of architecture-specific code that knows
how things work for the target architecture.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15196 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 50ff7518 25-Feb-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

* Don't use int32 in sources to be compiled for the build platform
(Daniel Furrer).
* The strace interface for the generated file changed.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11495 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 3f38375a 21-Feb-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Write return and parameter type names into the generated strace file.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11446 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 747fcbd3 10-Feb-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

We generate two more files now: A simple array with the kernel function
pointers and overall parameters size for the kernel and some more
sophisticated code for strace.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11339 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 1f90f9aa 30-Sep-2004 Ingo Weinhold <ingo_weinhold@gmx.de>

We do now also generate a header file that defines macros for the syscall numbers.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9133 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f740226b 11-Sep-2004 Ingo Weinhold <ingo_weinhold@gmx.de>

Removed unnecessary include.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8916 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 91a47969 10-Sep-2004 Ingo Weinhold <ingo_weinhold@gmx.de>

No need to define the types here, since arch_config.h now uses C types.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8908 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8ad73448 10-Sep-2004 Axel Dörfler <axeld@pinc-software.de>

gensyscalls.cpp should now build under Linux again.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8902 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d21749db 01-Sep-2004 Ingo Weinhold <ingo_weinhold@gmx.de>

Fixed a problem we had with bool parameters (probably with all types that consume more storage when being passed as function parameters).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8784 a95241bf-73f2-0310-859d-f6bbb57e9c96


# efd87ab8 28-Aug-2004 Ingo Weinhold <ingo_weinhold@gmx.de>

Had to change the mechanism for automatically generating most of the
boring syscall stuff. It has two phases now: The first one
(gensyscallinfos) parses syscalls.h and generates a source file containing
all the required information. This file is compiled and linked to
gensyscalls, which generates the actual output files.
Added to the build.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8697 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a8ca1ab3 22-Aug-2004 Ingo Weinhold <ingo_weinhold@gmx.de>

Completed. Properly generates the desired outputs now.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8622 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2e463a12 21-Aug-2004 Ingo Weinhold <ingo_weinhold@gmx.de>

The beginnings of a small tool to parse syscalls.h and generate the assembly file performing the calls and the respective part of kernel syscall dispatcher. The parsing part is done.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8618 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 45bd7bb3db9d9e4dcb02b89a3e7c2bf382c0a88c 25-Jun-2010 Ingo Weinhold <ingo_weinhold@gmx.de>

Removed unnecessary inclusions of <boot/kernel_args.h> in private kernel
headers and respectively added includes in source files.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37259 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 59d6284b7b7c1d099ff0fb785f9aaf27c13ef54b 27-Nov-2009 Ingo Weinhold <ingo_weinhold@gmx.de>

Changed the way the syscall infos are generated. We no longer include the
preprocessed <syscalls.h> header in sources compiled for the build platform.
Instead we're generating macros for the return type and parameter type sizes
via the CreateAsmStructOffsetsHeader rule (no template magic anymore) and
thus get a clear separation of host and target code, resulting in better
portability (although surprisingly enough the build already worked on 64 bit
hosts).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34323 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 23f179da55b1bd1ba84fbf3d3c56947e2c8d0aca 25-Nov-2009 Axel Dörfler <axeld@pinc-software.de>

* Cleanup, no functional change.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34237 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 7200c6f499191933e4b04e1f9c9a269d10fc92c0 19-Jun-2009 Axel Dörfler <axeld@pinc-software.de>

* Fixed warnings.
* Automatic whitespace cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31114 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e7c8829c5d8e5d34a2a1e111f1c06aceff256013 27-May-2009 Jérôme Duval <korli@users.berlios.de>

strchr(const char*, ...) returns const char* in C++, identified by gcc 4.4.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30882 a95241bf-73f2-0310-859d-f6bbb57e9c96


# cbd4dd196d0cd91c36b94fe9691356af21247682 24-Feb-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Patch by Vasilis Kaoutsis: Added missing headers. Fixes the build on
certain Linux distributions.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24109 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ed854de77028ac5787ab7f8ac42a28784c3f80df 07-Feb-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Also include info about the syscall return type in the
extended_syscall_info structure.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23916 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b4f58d8758380bc4ef224a1d2a05348fc1535e33 21-Jan-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Renamed syscall_parameters_info structure to extended_syscall_info (and
kSyscallParametersInfos to kExtendedSyscallInfos) and added "name"
field. Now the classes for syscall kernel tracing don't need to lookup
the syscall function symbol anymore, which speeds up printing/filtering
of those entries dramatically.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23687 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 19101ba0f4061b3ca064ad0713dfd29e93104a39 18-Jan-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Generate a kernel array kSyscallParametersInfos containing information
about syscall parameters. Particularly interesting is a type_code field
for each parameter. The mechanism isn't very accurate, but we can
classify everything in string, pointer, and integer types.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23618 a95241bf-73f2-0310-859d-f6bbb57e9c96


# bbaaf4b7c3e1f9c03e34ea5a0b40d87392d5601b 18-Jan-2008 Jérôme Duval <korli@users.berlios.de>

gcc4 requires a cast, so we prepend (void *) to cast every syscall function
fixed syscall.cpp inclusions due to renaming


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23611 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 34b3b26b3b8c46ba46ddde037b10dd173f4936d6 10-Jan-2008 Ingo Weinhold <ingo_weinhold@gmx.de>

Merged branch haiku/branches/developer/bonefish/optimization revision
23139 into trunk, with roughly the following changes (for details svn
log the branch):
* The int 99 syscall handler is now fully in assembly.
* Added a sysenter/sysexit handler and use it on Pentiums that support
it (via commpage).
* Got rid of i386_handle_trap(). A bit of functionality was moved into
the assembly handler which now uses a jump table to call C functions
handling the respective interrupt.
* Some optimizations to get user debugger support code out of the
interrupt handling path.
* Introduced a thread::flags fields which allows to skip handling of
rare events (signals, user debug enabling/disabling) on the
common interrupt handling path.
* Got rid of the explicit iframe stack. The iframes can still be
retrieved by iterating through the stack frames.
* Made the commpage an architecture independent feature. It's used for
the real time data stuff (instead of creating a separate area).
* The x86 CPU modules can now provide processor optimized versions for
common functions (currently memcpy() only). They are used in the
kernel and are provided to the userland via commpage entries.
* Introduced build system feature allowing easy use of C structure
member offsets in assembly code.

Changes after merging:
* Fixed merge conflict in src/system/kernel/arch/x86/arch_debug.cpp
(caused by refactoring and introduction of "call" debugger command).



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23370 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2ae568931fcac7deb9f1e6ff4e47213fbfe4029b 27-Nov-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Reworked the way how the gensyscalls stuff finds out about
the sizes and alignments of syscall parameters. It no longer
generates and compiles functions with the same signature as the
syscalls. This simply doesn't generally work for cross-compilation.
Instead we provide a bit of architecture-specific code that knows
how things work for the target architecture.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15196 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 50ff75180531d097ed514c604eb216a438dc54e7 25-Feb-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

* Don't use int32 in sources to be compiled for the build platform
(Daniel Furrer).
* The strace interface for the generated file changed.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11495 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 3f38375acc71271236ce06038f8d290ac9d56b27 21-Feb-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

Write return and parameter type names into the generated strace file.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11446 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 747fcbd3e0ed8d2275e202b6db289c6d59d09da7 10-Feb-2005 Ingo Weinhold <ingo_weinhold@gmx.de>

We generate two more files now: A simple array with the kernel function
pointers and overall parameters size for the kernel and some more
sophisticated code for strace.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11339 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 1f90f9aa63aadddaf1861b2a1fd2624b0e58ca34 30-Sep-2004 Ingo Weinhold <ingo_weinhold@gmx.de>

We do now also generate a header file that defines macros for the syscall numbers.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9133 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f740226bcd9ae8af00829e5f6de837085e8a065e 11-Sep-2004 Ingo Weinhold <ingo_weinhold@gmx.de>

Removed unnecessary include.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8916 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 91a479693905981194510c2bf8a6e166a62ce4c9 10-Sep-2004 Ingo Weinhold <ingo_weinhold@gmx.de>

No need to define the types here, since arch_config.h now uses C types.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8908 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8ad734482988d1bd2fbed226ea5ec11fdcaea95d 10-Sep-2004 Axel Dörfler <axeld@pinc-software.de>

gensyscalls.cpp should now build under Linux again.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8902 a95241bf-73f2-0310-859d-f6bbb57e9c96


# d21749db83ec1f7f6ec4eca30a3ff2cc65839eb3 01-Sep-2004 Ingo Weinhold <ingo_weinhold@gmx.de>

Fixed a problem we had with bool parameters (probably with all types that consume more storage when being passed as function parameters).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8784 a95241bf-73f2-0310-859d-f6bbb57e9c96


# efd87ab8df79399cac98d888ab3f36d3f33c34ed 28-Aug-2004 Ingo Weinhold <ingo_weinhold@gmx.de>

Had to change the mechanism for automatically generating most of the
boring syscall stuff. It has two phases now: The first one
(gensyscallinfos) parses syscalls.h and generates a source file containing
all the required information. This file is compiled and linked to
gensyscalls, which generates the actual output files.
Added to the build.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8697 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a8ca1ab34809db29591c461b3ead287d2424f508 22-Aug-2004 Ingo Weinhold <ingo_weinhold@gmx.de>

Completed. Properly generates the desired outputs now.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8622 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2e463a12a9f0f8054990ffda360138d8fa020d26 21-Aug-2004 Ingo Weinhold <ingo_weinhold@gmx.de>

The beginnings of a small tool to parse syscalls.h and generate the assembly file performing the calls and the respective part of kernel syscall dispatcher. The parsing part is done.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8618 a95241bf-73f2-0310-859d-f6bbb57e9c96