Skip to content

Commit

Permalink
Ensure all datatypes are available for compilation
Browse files Browse the repository at this point in the history
The changes to make building against libctf as an alternative to
libdtrace-ctf caused a compilation failure if libdtrace-ctf was not
installed.  The cause was a dependency on some datatype declarations
defined by the libdtrace-ctf include files.  These declarations have
been moved to dtrace_types.h to ensure that they are available
regardless of which CTF library is used during compilation.

Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com>
  • Loading branch information
kvanhees authored and nickalcock committed Apr 12, 2021
1 parent 188bf56 commit 4e5912e
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion uts/common/sys/dtrace_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,19 @@

#include <sys/types.h>
#include <stdint.h>
#include <sys/ctf_types.h>
#include <endian.h>
#include <unistd.h>

typedef enum { B_FALSE, B_TRUE} boolean_t;

/*
* POSIX Extensions
*/
typedef unsigned char uchar_t;
typedef unsigned short ushort_t;
typedef unsigned int uint_t;
typedef unsigned long ulong_t;

/*
* Strictly conforming ANSI C environments prior to the 1999
* revision of the C Standard (ISO/IEC 9899:1999) do not have
Expand Down Expand Up @@ -75,6 +82,13 @@ typedef unsigned long long hrtime_t;
#warning Unknown endianness
#endif

/*
* return x rounded up to an alignment boundary
* eg, P2ROUNDUP(0x1234, 0x100) == 0x1300 (0x13*align)
* eg, P2ROUNDUP(0x5600, 0x100) == 0x5600 (0x56*align)
*/
#define P2ROUNDUP(x, align) (-(-(x) & -(align)))

/*
* This comes from <linux/dtrace_os.h>.
*/
Expand Down

0 comments on commit 4e5912e

Please sign in to comment.