diff options
author | Flavio Cruz <flaviocruz@gmail.com> | 2022-11-04 01:29:37 -0400 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2022-11-05 22:21:04 +0100 |
commit | 3902cb2fcae6e2028252b5d2016bf0e99ed74980 (patch) | |
tree | 6f48ad0f9567569680529367b843e6e8abbece90 /type.h | |
parent | 68b3d8fe3a9595b7a5cb2bb6bc5973ba26139704 (diff) |
Add support to define structures in mig.v1.8+git20221111
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>
Diffstat (limited to 'type.h')
-rw-r--r-- | type.h | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -143,6 +143,7 @@ typedef struct ipc_type u_int itTypeSize; /* size of the C type */ u_int itPadSize; /* amount of padding after data */ u_int itMinTypeSize; /* minimal amount of space occupied by data */ + u_int itAlignment; /* alignment required for this type */ u_int itInName; /* name supplied to kernel in sent msg */ u_int itOutName; /* name in received msg */ @@ -193,7 +194,8 @@ extern ipc_type_t *itResetType(ipc_type_t *it); extern ipc_type_t *itVarArrayDecl(u_int number, const ipc_type_t *it); extern ipc_type_t *itArrayDecl(u_int number, const ipc_type_t *it); extern ipc_type_t *itPtrDecl(ipc_type_t *it); -extern ipc_type_t *itStructDecl(u_int number, const ipc_type_t *it); +extern ipc_type_t *itStructArrayDecl(u_int number, const ipc_type_t *it); +extern ipc_type_t *itStructDecl(u_int min_type_size_in_bytes, u_int required_alignment_in_bytes); extern ipc_type_t *itCStringDecl(u_int number, boolean_t varying); extern ipc_type_t *itRetCodeType; |