Wed Jun 6 17:16:56 2018 UTC ()
Correct compilation of osnet/dev/dtrace/x86/dis_tables.c under Clang

Constify dgr_suffix.

This could be done with -W flags, but they are incompatible between
compilers.

This is a step forward functional MKLLVM=yes HAVE_LLVM=yes build.

Sponsored by <The NetBSD Foundation>


(kamil)
diff -r1.1 -r1.2 src/external/cddl/osnet/dev/dtrace/x86/dis_tables.c

cvs diff -r1.1 -r1.2 src/external/cddl/osnet/dev/dtrace/x86/dis_tables.c (expand / switch to unified diff)

--- src/external/cddl/osnet/dev/dtrace/x86/dis_tables.c 2018/05/28 23:47:39 1.1
+++ src/external/cddl/osnet/dev/dtrace/x86/dis_tables.c 2018/06/06 17:16:56 1.2
@@ -2335,27 +2335,27 @@ static int isize64[] = {1, 2, 4, 8}; @@ -2335,27 +2335,27 @@ static int isize64[] = {1, 2, 4, 8};
2335 * The simplest way to deal with this is to just define a table based on the 2335 * The simplest way to deal with this is to just define a table based on the
2336 * instruction opcodes, which are 0x90-0x93, so we subtract 0x90 to index into 2336 * instruction opcodes, which are 0x90-0x93, so we subtract 0x90 to index into
2337 * them. 2337 * them.
2338 * 2338 *
2339 * We further have to subdivide this based on the value of VEX_W and the value 2339 * We further have to subdivide this based on the value of VEX_W and the value
2340 * of VEX_L. The array is constructed to be indexed as: 2340 * of VEX_L. The array is constructed to be indexed as:
2341 * [opcode - 0x90][VEX_W][VEX_L]. 2341 * [opcode - 0x90][VEX_W][VEX_L].
2342 */ 2342 */
2343/* w = 0, 0x90 */ 2343/* w = 0, 0x90 */
2344typedef struct dis_gather_regs { 2344typedef struct dis_gather_regs {
2345 uint_t dgr_arg0; /* src reg */ 2345 uint_t dgr_arg0; /* src reg */
2346 uint_t dgr_arg1; /* vsib reg */ 2346 uint_t dgr_arg1; /* vsib reg */
2347 uint_t dgr_arg2; /* dst reg */ 2347 uint_t dgr_arg2; /* dst reg */
2348 char *dgr_suffix; /* suffix to append */ 2348 const char *dgr_suffix; /* suffix to append */
2349} dis_gather_regs_t; 2349} dis_gather_regs_t;
2350 2350
2351static dis_gather_regs_t dis_vgather[4][2][2] = { 2351static dis_gather_regs_t dis_vgather[4][2][2] = {
2352 { 2352 {
2353 /* op 0x90, W.0 */ 2353 /* op 0x90, W.0 */
2354 { 2354 {
2355 { XMM_OPND, XMM_OPND, XMM_OPND, "d" }, 2355 { XMM_OPND, XMM_OPND, XMM_OPND, "d" },
2356 { YMM_OPND, YMM_OPND, YMM_OPND, "d" } 2356 { YMM_OPND, YMM_OPND, YMM_OPND, "d" }
2357 }, 2357 },
2358 /* op 0x90, W.1 */ 2358 /* op 0x90, W.1 */
2359 { 2359 {
2360 { XMM_OPND, XMM_OPND, XMM_OPND, "q" }, 2360 { XMM_OPND, XMM_OPND, XMM_OPND, "q" },
2361 { YMM_OPND, XMM_OPND, YMM_OPND, "q" } 2361 { YMM_OPND, XMM_OPND, YMM_OPND, "q" }