aboutsummaryrefslogtreecommitdiff
path: root/routine.c
Commit message (Collapse)AuthorAgeFilesLines
* x86_64: adapt MiG generated stubs to use mach_port_name_inlined_t for ↵Flavio Cruz2023-12-171-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | inlined port rights. For i686, we just change the code to use mach_port_name_inlined_t when defining the types. This is a no-op. For x86_64, there's a few things that are different: - In the server code, the server handler can get inlined ports and the array will be resized and cast as an array of mach_port_name_t. Output parameters have a similar treatment where the inlined array in the output is used as an array of mach_port_name_t but resized to look like a mach_port_name_inlined_t. - In the user side, we follow the same approach. Input ports as arrays of mach_port_name_t are expanded into an array of mach_port_name_inlined_t. Output ports are then converted back into an array of mach_port_name_inlined_t so that they fit into the expected message format. Essentially, regardless of whether port rights are inline or out of line, user interfaces and server stubs always receive an array of port rights, not mach_port_name_inlined_t. However, inlined port rights will be exchanged using mach_port_name_inlined_t.
* Revert "x86_64: adapt MiG generated stubs to use mach_port_name_inlined_t ↵Samuel Thibault2023-12-031-6/+0
| | | | | | for inlined port rights." This reverts commit c40604042bd6e9f80e4f5fe6bc9deefb29c4b94a.
* x86_64: adapt MiG generated stubs to use mach_port_name_inlined_t for ↵Flavio Cruz2023-12-031-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | inlined port rights. For i686, we just change the code to use mach_port_name_inlined_t when defining the types. This is a no-op. For x86_64, there's a few things that are different: - In the server code, the server handler can get inlined ports and the array will be resized and cast as an array of mach_port_name_t. Output parameters have a similar treatment where the inlined array in the output is used as an array of mach_port_name_t but resized to look like a mach_port_name_inlined_t. - In the user side, we follow the same approach. Input ports as arrays of mach_port_name_t are expanded into an array of mach_port_name_inlined_t. Output ports are then converted back into an array of mach_port_name_inlined_t so that they fit into the expected message format. Essentially, regardless of whether port rights are inline or out of line, user interfaces and server stubs always receive an array of port rights, not mach_port_name_inlined_t. However, inlined port rights will be exchanged using mach_port_name_inlined_t. Message-ID: <20231124213041.952886-4-flaviocruz@gmail.com>
* Introduce complex_alignof to replace word_sizeFlavio Cruz2023-02-131-1/+4
| | | | | | | Remove the concept of word_size since it is meaningless in some architectures. This is also done in preparation to possibly introduce 8-byte aligned messages. Message-Id: <Y+lkv0uMo/3+hbCb@jupiter.tail36e24.ts.net>
* mig: replace boolean.h with stdbool.hFlavio Cruz2022-11-251-34/+34
| | | | Message-Id: <Y3/Z1CGL8D4OwT66@viriathus>
* fix message fields alignment for 64 bitLuca Dariz2022-08-271-2/+2
| | | | | | | | | | | | | | | On x86_64 alignment of structures is different, as the pointer size is different. For simplicity we keep the same 4-byte alignment as used on 32-bit. This simplifies the support for 32-bit rpc on 64-bit kernels, and also it seems not worth as an optimization, as we would need to add more code in the ipc_kmsg* routines. * routine.c: align both short and long descriptors * utils.c: use a fixed alignment for data fields in structures representing messages. Signed-off-by: Luca Dariz <luca@orpolo.org> Message-Id: <20220628094927.442907-2-luca@orpolo.org>
* cpu.sym: Replace implementation from Utah with implementation from CMUSamuel Thibault2020-06-181-0/+1
| | | | | | | | | | This replaces the implementation from the University of Utah, covered by the advertising clause, with the implementation from CMU, picked up from the GNU Mach source, which is free from the advertising clause. This includes the addition of the sizeof as seen used by mig with git grep word_size git grep sizeof_
* Remove functions, procedures and simple procedures.Flavio Cruz2016-03-201-79/+6
| | | | | | | | | | | | | This has been tested by cross-compiling a base Hurd system to make sure these kinds of routines are no longer used. * lexxer.l: Remove tokens. * parser.y: Remove token types and production rules. * routine.c: Remove rtMakeProcedure, rtMakeSimpleProcedure, rtMakeFunction. * routine.h: Remove enum values rkSimpleProcedure, rkProcedure, rkFunction. Remove dead fields from struct routine. * user.c: Simplify and remove dead code.
* Add support for protected payloadsJustus Winter2014-10-101-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for protected payloads. The new `intranpayload' option can be used to specify a translation function translating payloads to values of the translated type. This function will be used instead of the `intran' function to to look up the receiving object of a message in a server. This makes it easy to use the protected payloads introduced in GNU Mach 1.5. An inTransPayload function translates payloads to objects, like an inTrans function translates from port names to objects. Generate code in the server routine to optimize lookups to the receiver of the message. Additionally, if no intran function is provided, but an intranpayload function is, it is expected to translate from payloads to port names. This is used to preserve the semantics in case the server routine expects a port name. * NEWS: Add item. * lexxer.l: Emit syInTranPayload. * parser.h: Define syInTranPayload. * parser.y (TransTypeSpec): Handle syInTranPayload. * type.h (struct ipc_type): Add itInTransPayload. * server.c (WriteExtractArgValue): If a payload-aware intrans function has been specified, use it to get a reference to the receiving object. * routine.c (rtAugmentArgKind): Force the use of a local variable if a payload-aware translate-in function is defined.
* Drop the register keywordJustus Winter2013-08-191-53/+53
| | | | | | | | | | | | | | | | | | | Drop the register keyword both from MIGs code and from the generated code. The register keyword is only a hint and it is ignored by modern compilers. * alloca.c: Drop the register keyword. * header.c: Likewise. * lexxer.l: Likewise. * parser.y: Likewise. * routine.c: Likewise. * server.c: Likewise. * statement.c: Likewise. * string.c: Likewise. * type.c: Likewise. * user.c: Likewise. * utils.c: Likewise. * vprint.c: Likewise.
* 2006-11-29 Thomas Schwinge <tschwinge@gnu.org>Thomas Schwinge2006-11-301-0/+14
| | | | | | | | | | | | | | | | | Fix compiler, flex and bison warnings. * error.c: Include <stdlib.h>. * lexxer.h (yylex): Add declaration. * migcom.c: Include <stdlib.h>. (main): Set USER, SHEADER and IHEADER to `NULL' by default. (myfclose): Add lost conversion specifications. * parser.h (yyerror): Add declaration. * routine.c (rtPrintArg, rtCheckRoutine): Add braces to avoid ambiguousness. * server.c (WriteSymTabEntries): Make NUM an `u_int'. * user.c (WriteUserIndividual): Add a `default' case in a switch statement and add lost conversion specifications. * lexxer.l: Set option `nounput'. * parser.y (%left): Change commas to spaces.
* 2002-07-31 Marcus Brinkmann <marcus@gnu.org>Marcus Brinkmann2002-08-041-2/+1
| | | | | * routine.c (rtFindSize): Always add sizeof_mach_msg_type_t to SIZE for args not in long form, irregardless of the itSize.
* 2002-05-07 Roland McGrath <roland@frob.com>Roland McGrath2002-05-251-10/+10
| | | | | | | * type.c (itMakeNaturalType): New function. (init_type): Use that instead of itMakeIntType for itWaitTimeType and itMsgOptionType--give them each their special typedef names. * routine.c (rtCheckArgTypes): Use itCheckNaturalType for rtMsgOption.
* Created new module from gnumach/mig at tag before-mig-moveRoland McGrath1998-07-181-0/+1334