summaryrefslogtreecommitdiff
path: root/lexxer.l
AgeCommit message (Collapse)Author
2023-06-17Remove error procedure directivesSergey Bugaev
Back in the wonderful old days of Mach 2, when there were no send-once rights, dead names, or port reference counts, MIG used to have more kinds of operations: there were functions, procedures, simpleprocedures, routines, and simpleroutines. Routines returned an error code as their C function return value, functions had real return values, procedures and simpleprocedures returned void. Functions, procedures, and simpleprocedures signalled errors by invoking a global function. By default, a function named MsgError was invoked, but a subsystem could specify a different function using the 'error' directive: error CustomErrorHandler; In Mach 3, functions, procedures, and simpleprocedures are gone. Routines and simpleroutines are the only remaining kinds of operations. Some 26 years later, most of the code for generating functions, procedures, and simpleprocedures was removed from GNU MIG in commit 7f10b4ed6a557b7a1fd1083939156a3dcf8b377e. Error directives remained, seemingly due to an oversight. So remove them too. Found while trying to use the word 'error' as an identifier and receiving a cryptic syntax error from MIG. Message-Id: <20230617203953.622120-1-bugaevc@gmail.com>
2022-11-05Add support to define structures in mig.v1.8+git20221111Flavio Cruz
Basic syntax is presented below and allows users to define nested structured types by using simpler or structure types as members. Mig will use the C padding and alignment rules to produce the same size as the corresponding C structures. type timespec_t = struct { uint32_t tv_sec; uint32_t tv_nsec; }; This allows us to build stubs that are more easily adaptable to other architectures. Message-Id: <Y2SjQSMOINY8I5Dy@viriathus>
2022-08-27add separate port_size and mach_port_name_size definitionsLuca Dariz
* cpu.sym: retrieve size of vm_offset_t and mach_port_name_t from gnumach headers at compile type. * global.{c,h}: add port size as a variable and initialize it to the port name size. * lexxer.l: apply port or port name size to the corresponding types, instead of using the word size. * parser.y: update port size if we're generating for kernel-space (server or client). Also re-initialize default port types to account for this change. * type.c: use port size instead of word size in default port types and runtime checks. There are many assumptions about mach_port_t: - on kernel side, its size is the same as a pointer. This allows to replace the port name with the address of the corresponding data structure during copyin in mach_msg() - in mig, this is also the "word size", which is derived from gnumach headers as the size of integer_t - its size is also the same as natural_t, so it's possible to model structures like mach_port_status_t as an array of integer_t in mig. This is convenient since arrays and structures can't have mixed types. - its size is always the same as the port name size This patch does not change the current behaviour on 32-bit kernels, but allows for some of these assumptions to be broken on 64-bit kernels. This is needed to have 32-bit port names on 64-bit kernels and be able to support a 32-bit userspace. It still leaves the choice for a 64-bit userspace, if all integer_t and natural_t are to be extended to 64 bit. However keeping 32-bit port names seems to be the right thing, based on previous discussions [1], even for a 64-bit kernel. The only assumption kept is that in kernel-space ports are always the size of a pointer, as they refer to a data structure and not to a specific port name. To ensure this is true for various user/kernel combinations, we dynamically change the port size if we're generating code for kernel-space server or clients, and keep the size of a port the same of a port name for user-space servers and clients. [1] https://lists.gnu.org/archive/html/bug-hurd/2012-04/msg00000.html Signed-off-by: Luca Dariz <luca@orpolo.org> Message-Id: <20220403150020.120799-2-luca@orpolo.org>
2021-02-11Add noyywrap optionPaul Dufresne
We do not actually use yywrap, and this allows to avoid requiring libflex, making cross-compilations simpler. * lexxer.l: Add noyywrap option.
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-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.
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.
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-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.
2008-05-282008-05-28 Thomas Schwinge <tschwinge@gnu.org>Thomas Schwinge
[bug #23417: Building with -g3] * lexxer.l (^\#define[ \t]): Ignore until EOL.
2006-11-302006-11-29 Thomas Schwinge <tschwinge@gnu.org>Thomas Schwinge
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.
2001-12-312001-12-31 Roland McGrath <roland@frob.com>Roland McGrath
* lexxer.l: Grok "retcode" IPC flag as a no-op, for compatibility with OSF Mach mig syntax. * lexxer.c: Regenerated.
2001-06-082001-06-07 Roland McGrath <roland@frob.com>Roland McGrath
* statement.h: Fix obsolete #else/#endif syntax. * lexxer.l: Likewise.
1998-07-18Created new module from gnumach/mig at tag before-mig-moveRoland McGrath