diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libhvcall/brokensc1.c | 10 | ||||
-rw-r--r-- | lib/libhvcall/libhvcall.h | 1 |
2 files changed, 6 insertions, 5 deletions
diff --git a/lib/libhvcall/brokensc1.c b/lib/libhvcall/brokensc1.c index e6387e0..d97ae77 100644 --- a/lib/libhvcall/brokensc1.c +++ b/lib/libhvcall/brokensc1.c @@ -47,13 +47,13 @@ static int check_broken_sc1(void) * supervisor mode. */ r = hcall(INS_SC1, H_SET_DABR, 0); - if (r == H_SUCCESS || r == H_HARDWARE) { - /* All is fine */ - return 0; + if (r == H_PRIVILEGE) { + /* We found a broken sc1 host! */ + return 1; } - /* We found a broken sc1 host! */ - return 1; + /* All is fine */ + return 0; } int patch_broken_sc1(void *start, void *end, uint32_t *test_ins) diff --git a/lib/libhvcall/libhvcall.h b/lib/libhvcall/libhvcall.h index 3fa4398..caa4d6d 100644 --- a/lib/libhvcall/libhvcall.h +++ b/lib/libhvcall/libhvcall.h @@ -3,6 +3,7 @@ #define H_SUCCESS 0 #define H_HARDWARE -1 +#define H_PRIVILEGE -3 /* Caller not privileged */ #define H_GET_TCE 0x1C #define H_PUT_TCE 0x20 |