summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-03-04Fix c89 compilation of mig headersSamuel Thibault
* header.c (WriteServerHeader): Print __inline instead of inline.
2018-01-28Fix RPC build warningsSamuel Thibault
Users of RPCs want to be able to pass pointers to const data, so add const qualifiers to RPCs as appropriate. * utils.c (UserVarConst, UserVarQualifier): New functions. (WriteUserVarDecl): Use UserVarQualifier to qualify function parameter. (WriteFieldDeclPrim): Use UserVarConst to qualify pointer to user variable.
2018-01-28Fix compilation warningsSamuel Thibault
Nowadays' compilers are able to recognize memcpy and replace it appropriately without having to tell them so through a structure assignment. That also avoids warnings about type puning. * utils.c (WriteCopyType): Emit memcpy call instead of type-puned assignement.
2017-01-02Fix spurious warning on MACH_MSG_TYPE_POLYMORPHIC valueSamuel Thibault
* utils.c (WriteStaticLongDecl): Explicitly cast name to unsigned short to ignore truncation of MACH_MSG_TYPE_POLYMORPHIC i.e. -1.
2016-12-19Fix compiler warningSamuel Thibault
2016-12-18GNU MIG 1.8v1.8Thomas Schwinge
* configure.ac (AC_INIT): Set version to 1.8. * NEWS: Finalize for 1.8.
2016-12-13Remove bullet points from NEWS fileThomas Schwinge
... to match the GNU Mach and Hurd NEWS files. * NEWS: Remove bullet points.
2016-12-09Update the NEWS fileJustus Winter
2016-10-10Fix spurious warning on MACH_MSG_TYPE_POLYMORPHIC valueSamuel Thibault
* utils.c (WriteCheckDecl, WriteStaticShortDecl): Explicitly cast name to unsigned char to ignore truncation of MACH_MSG_TYPE_POLYMORPHIC i.e. -1.
2016-09-20fix typoSamuel Thibault
2016-05-18GNU MIG 1.7v1.7Thomas Schwinge
* configure.ac (AC_INIT): Set version to 1.7. * NEWS: Finalize for 1.7.
2016-05-03Add missing EXTRA_DISTSamuel Thibault
* tests/Makefile.am (EXTRA_DIST): Add base_types.defs test_lib.sh includes/all.h includes/mach/mig_support.h includes/server.h includes/types.h includes/user.h. * tests/bad/Makefile.am (EXTRA_DIST): Add $(TESTS) run_bad_test.sh. * tests/generate-only/Makefile.am (EXTRA_DIST): Add $(TESTS) run_generate_only_test.sh. * tests/good/Makefile.am (EXTRA_DIST): Add $(TESTS) run_good_test.sh.
2016-04-26Simplify ArgumentType production rule.Flavio Cruz
* parser.y: Move syColon from ArgumentType into Argument.
2016-04-20Make Git ignore some more automatically generated filesDavid Michael
* .gitignore: Ignore parser.h and all Makefile/Makefile.in files.
2016-04-20Use the target platform compiler in the test scriptsDavid Michael
* tests/Makeconf.am (AM_TESTS_ENVIRONMENT): Set CC to $(TARGET_CC).
2016-04-20Update NEWSJustus Winter
2016-04-19Simple testsuite for MIG.Flavio Cruz
This includes a set of valid and invalid definition files that MIG will try to process. For valid definitions, GCC will compile the stubs to check if valid C code was generated. * configure.ac: Add new test Makefiles. * Makefile.am: Add SUBDIRS. * tests/Makeconf.am: Automake definitions shared by all test subdirectories. * tests/test_lib.sh: Library of functions shared by all test drivers. * tests/good/run_good_test.sh: Script to run valid definition files. * tests/good/Makefile.am: New file. * tests/bad/Makefile.am: New file. * tests/generate-only/Makefile.am: New file. * tests/bad/run_bad_test.sh: Script to run invalid definition files. * tests/generate-only/run_generate_only.sh: Script to run valid definition files that should be generated only. * tests/includes/*.h: Test header files that are included by test stubs. * tests/good/*.defs: Valid definition files where generated stubs can be compiled. * tests/generate_only/*.defs: Valid definition files that can be generated but no compilation should be attempted. * tests/bad/*.defs: Definition files with problems that should be detected by MIG.
2016-04-15Update NEWS fileJustus Winter
2016-04-05Include stdint.h in stub code by default.Flavio Cruz
* server.c: Include stdint.h in the header code. * user.c: Likewise.
2016-04-04Use uint32_t instead of unsigned32_t.Flavio Cruz
* utils.c: Generate code using uint32_t.
2016-04-04Fix use of stringize in lexxer.lFlavio Cruz
The fields instr and outstr should be set to a string and not to the stringified number represented by the string. This improves the readability of mig stubs code that creates mach_msg_type_t values for messages. * lexxer.l: Inline stringize in TPRETURN and TRETURN.
2016-04-03Use word_size instead of 4.Flavio Cruz
* server.c: Use word_size and update comments. * type.c: Use word_size to compute padding. * user.c: Use word_size and update comments.
2016-03-20Remove functions, procedures and simple procedures.Flavio Cruz
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.
2016-03-19Simpler lexer regexps of case insensitive keywords.Flavio Cruz
* lexxer.l: Use (?i) for matching case insensitive keywords. * README: Fix typo.
2016-03-15Automatically generate parser.h.Flavio Cruz
* Makefile.am: Set AM_YFLAGS to -d to generate parser.h. Add parser.h to CLEANFILES and include parser.h as a dependency of lexxer.c. * lexxer.l: Declare yyerror here. * parser.h: Remove file since yacc will generate the same content automatically.
2016-03-07Correctly initialize prototype in itAlloc.Flavio Cruz
* type.c (itAlloc): Initialize itKernelPort to FALSE.
2016-02-09Cast kernel server port arguments to the correct type.Flavio Cruz
* 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.
2015-10-31GNU MIG 1.6v1.6Thomas Schwinge
* configure.ac (AC_INIT): Set version to 1.6. * NEWS: Finalize for 1.6.
2015-10-05Update NEWS fileJustus Winter
2015-06-05Change x_server_routine functions to "static inline" for -std=gnu11David Michael
* header.c (WriteServerHeader): Replace "extern" with "static". * server.c (WriteEpilog): Remove WriteSubsystemServerRoutine call.
2015-04-10GNU MIG 1.5.v1.5Thomas Schwinge
* configure.ac (AC_INIT): Set version to 1.5. * NEWS: Finalize for 1.5.
2015-02-15Do not generate code dereferencing type-punned pointersJustus Winter
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.
2015-02-06Test the configured yacc programDavid Michael
* configure.ac (yacc_is_bison): Test the configured yacc program.
2015-02-06Check that yacc is provided by bisonYves-Gael Cheny ( irc hurdman_begin )
* configure.ac: Check that yacc --version contains bison.
2014-12-01Add static branch prediction to type checksJustus Winter
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.
2014-11-06Provide default implementations for server functionsJustus Winter
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.
2014-10-10Add support for protected payloadsJustus Winter
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.
2014-09-24Update NEWS fileJustus Winter
2014-02-21Fix variable-sized c stringsJustus Winter
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.
2013-12-16Generate a x_server_routine in the sheader so it can be inlinedJustus Winter
* 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.
2013-12-16Move the generation of x_server_routine function into a functionJustus Winter
* server.c (WriteSubsystemServerRoutine): New function. (WriteEpilog): Adjust accordingly. * write.h (WriteSubsystemServerRoutine): New declaration.
2013-12-16Clean up generated sourcesJustus Winter
* Makefile (CLEANFILES): Add generated source files lexxer.c and parser.c.
2013-12-16Avoid a compiler warning in WriteDefinesJustus Winter
* header.c (WriteDefines): Avoid warning about unused parameter.
2013-12-16Advise flex not to generate the input functionJustus Winter
This avoids a warning about input being unused. * lexxer.l: Define YY_NO_INPUT.
2013-12-15mig/server.c (WriteVarDecls): quiet GCC warning about set but unused variableMarin Ramesa
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.
2013-09-27GNU MIG 1.4.v1.4Thomas Schwinge
* configure.ac (AC_INIT): Set version to 1.4. * NEWS: Finalize changes for 1.4. * README: Update.
2013-09-27Generate ChangeLog files for distributions.Thomas Schwinge
* gitlog-to-changelog: New file; import from gnulib's 9fc81090f6c5590bd1b0e0fa5087577a2ee43a3e:build-aux/gitlog-to-changelog. * Makefile.am (gen-ChangeLog): New target. (dist-hook): Depend on it.
2013-09-04Drop the auto keywordJustus Winter
Drop the auto keyword from the generated source code. auto is the default storage type for variables anyway and it is customary to omit it. * utils.c (WriteCheckDecl): Drop auto from generated source. (WriteStaticLongDecl): Likewise. (WriteStaticShortDecl): Likewise.
2013-08-19Drop alloca.cJustus Winter
This file was only used with GCC < 2, so it's time to drop it. * alloca.c: Remove file. * configure.ac: Remove test for alloca. * Makefile.am (migcom_LDADD): Remove @ALLOCA@.
2013-08-19Drop the register keywordJustus Winter
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.