aboutsummaryrefslogtreecommitdiff
path: root/server.c
Commit message (Collapse)AuthorAgeFilesLines
* Include stdint.h in stub code by default.Flavio Cruz2016-04-051-0/+1
| | | | | * server.c: Include stdint.h in the header code. * user.c: Likewise.
* Use word_size instead of 4.Flavio Cruz2016-04-031-10/+10
| | | | | | * server.c: Use word_size and update comments. * type.c: Use word_size to compute padding. * user.c: Use word_size and update comments.
* Cast kernel server port arguments to the correct type.Flavio Cruz2016-02-091-0/+12
| | | | | | * server.c: Add cast for ipc_port_t arguments that are handled differently. * type.c: Set itKernelPort when the mach_port_t is treated as a ipc_port_t. * type.h: Add itKernelPort to struct ipc_type.
* Change x_server_routine functions to "static inline" for -std=gnu11David Michael2015-06-051-6/+0
| | | | | * header.c (WriteServerHeader): Replace "extern" with "static". * server.c (WriteEpilog): Remove WriteSubsystemServerRoutine call.
* Do not generate code dereferencing type-punned pointersJustus Winter2015-02-151-9/+9
| | | | | | | | | | | | | | | | | | | | | | For variable-length arrays, up to 2048 bytes are transmitted inline. If the array is larger, the data is transmitted out-of-line, and a pointer to a vm_allocated region is stored at the beginning of the array. Previously, the generated code casted the field. Use a union instead. This fixes the gcc warning `dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]'. * global.c (OOLPostfix): New variable. * global.h (OOLPostfix): New declaration. * server.c (WriteServerCallArg): Avoid cast. (WriteDestroyArg): Likewise. (WritePackArgValue): Likewise. (WritePackArg): Likewise. * user.c (WriteExtractArgValue): Likewise. * utils.c (WriteFieldDeclPrim): Generate a union with an additional pointer field for variable-length arrays.
* Add static branch prediction to type checksJustus Winter2014-12-011-9/+12
| | | | | | | | | Annotate generated type checks with static branch prediction optimizing well-formed messages. * utils.c (WriteBogusDefines): Define `mig_unlikely' if not defined. * server.c: Use `mig_unlikely' in generated type checks. * user.c: Likewise.
* Provide default implementations for server functionsJustus Winter2014-11-061-0/+24
| | | | | | | | By providing default implementations, servers can provide partial implementations of protocols without having to stub out functions. * server.c (WriteDefaultRoutine): New function. (WriteRoutine): Call WriteDefaultRoutine.
* Add support for protected payloadsJustus Winter2014-10-101-4/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Fix variable-sized c stringsJustus Winter2014-02-211-0/+5
| | | | | | | | | | | | Previously, the terminating zero of variable-sized c strings was only included when copying the message if the length of the string was not a multiple of four. mig_strncpy returns the length of the string excluding the terminating zero. Fix this by properly accounting for the byte for the terminating zero in the array length. * server.c (WritePackArgValue): Account for the terminating zero in the array length. * user.c (WritePackArgValue): Likewise.
* Generate a x_server_routine in the sheader so it can be inlinedJustus Winter2013-12-161-1/+1
| | | | | | | * header.c (WriteServerHeader): Emit a x_server_routine that can be inlined. * server.c (WriteEpilog): Export the x_routines array so it can be used from the inlined x_server_routine.
* Move the generation of x_server_routine function into a functionJustus Winter2013-12-161-14/+21
| | | | | | * server.c (WriteSubsystemServerRoutine): New function. (WriteEpilog): Adjust accordingly. * write.h (WriteSubsystemServerRoutine): New declaration.
* mig/server.c (WriteVarDecls): quiet GCC warning about set but unused variableMarin Ramesa2013-12-151-2/+2
| | | | | | | This is again that code where variable is assigned to itself, but I don't know how to fix this the other way. * server.c (WriteVarDecls) (msgh_simple): Assign to itself.
* Drop the register keywordJustus Winter2013-08-191-72/+72
| | | | | | | | | | | | | | | | | | | 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.
* Fix spurious deallocationOlaf Buddenhagen2013-02-191-2/+7
| | | | | * server.c (WriteDestroyArg): Only dealloc out-of-line memory from request message if KERN_SUCCESS.
* 2006-11-29 Thomas Schwinge <tschwinge@gnu.org>Thomas Schwinge2006-11-301-1/+1
| | | | | | | | | | | | | | | | | 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.
* 2004-02-10 Roland McGrath <roland@frob.com>Roland McGrath2004-02-111-1/+1
| | | | | | | | * user.c (WriteTypeCheck): Use BAD_TYPECHECK macro instead of type-pun. * server.c (WriteTypeCheck): Likewise. * utils.c (WriteBogusDefines): Write a #define for that macro. * utils.c (WriteCheckDecl): Write auto const, not static const. (WriteStaticShortDecl, WriteStaticLongDecl): Likewise.
* 1999-10-11 Roland McGrath <roland@baalperazim.frob.com>Roland McGrath1999-10-111-1/+1
| | | | | * user.c (WriteIncludes): Fix missing newline in last change. * server.c (WriteIncludes): Likewise.
* 1999-10-08 Roland McGrath <roland@baalperazim.frob.com>Roland McGrath1999-10-091-8/+12
| | | | | | | | | | * server.c (WriteIncludes): Write: #ifndef _GNU_SOURCE #define _GNU_SOURCE 1 #endif into the output before all else. This is required for building stubs with GNU libc's built-in Mach/MiG support code. * user.c (WriteIncludes): Likewise.
* Created new module from gnumach/mig at tag before-mig-moveRoland McGrath1998-07-181-0/+1322