Skip to content

Commit

Permalink
PPC64LE: Fix the cache clear instructions.
Browse files Browse the repository at this point in the history
Change the cache clear instructions for generated PPC64LE code so that it uses
an input variable instead of an output variable.

With an output variable, it doesn't use the correct address for the dcbst and
icbi instructions, possibly causing it to crash.
  • Loading branch information
kbrenneman committed Jun 13, 2017
1 parent 80d9a87 commit 8b4f6ae
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/GLdispatch/vnd-glapi/entry_ppc64le_tls.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ void entry_generate_default_code(char *entry, int slot)
" sync\n\t"
" icbi 0, %0\n\t"
" isync\n"
: "=r" (writeEntry)
: : "r" (writeEntry)
);
}

2 changes: 1 addition & 1 deletion src/GLdispatch/vnd-glapi/entry_ppc64le_tsd.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ void entry_generate_default_code(char *entry, int slot)
" sync\n\t"
" icbi 0, %0\n\t"
" isync\n"
: "=r" (writeEntry)
: : "r" (writeEntry)
);
}

2 changes: 1 addition & 1 deletion src/util/glvnd_genentry.c
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ void SetDispatchFuncPointer(GLVNDGenEntrypoint *entry,
" sync\n\t"
" icbi 0, %0\n\t"
" isync\n"
: "=r" (code)
: : "r" (code)
);
#else
#error "Can't happen -- not implemented"
Expand Down
2 changes: 1 addition & 1 deletion tests/dummy/patchentrypoints.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ static void patch_ppc64le(char *writeEntry, const char *execEntry,
" sync\n\t"
" icbi 0, %0\n\t"
" isync\n"
: "=r" (writeEntry)
: : "r" (writeEntry)
);
#else
assert(0); // Should not be calling this
Expand Down

0 comments on commit 8b4f6ae

Please sign in to comment.