summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@linux.intel.com>2014-01-22 23:25:03 -0800
committerH. Peter Anvin <hpa@linux.intel.com>2014-01-22 23:25:03 -0800
commit511f9f904c70d218f26a2721c2e700b2ef84fc48 (patch)
tree01d90dc698b111f5e565decb8e048e619ea28240
parent6d1312ad64999f739b5f9f99645380363bb4abc2 (diff)
downloadtest16-511f9f904c70d218f26a2721c2e700b2ef84fc48.tar.gz
test16-511f9f904c70d218f26a2721c2e700b2ef84fc48.tar.xz
test16-511f9f904c70d218f26a2721c2e700b2ef84fc48.zip
run16: mark jump16() as noreturn
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
-rw-r--r--run16.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/run16.c b/run16.c
index 77713b8..1a588ca 100644
--- a/run16.c
+++ b/run16.c
@@ -53,7 +53,7 @@ static void setup_ldt(void)
syscall(SYS_modify_ldt, 1, &data16_desc, sizeof data16_desc);
}
-static void jump16(uint32_t offset, uint32_t start)
+static void __attribute__((noreturn)) jump16(uint32_t offset, uint32_t start)
{
struct far_ptr {
uint32_t offset;
@@ -64,6 +64,7 @@ static void jump16(uint32_t offset, uint32_t start)
target.segment = 7;
asm volatile("ljmpl *%0" : : "m" (target), "a" (start));
+ abort(); /* Shouldn't be possible to hit... */
}
#define ALIGN_UP(x,y) (((x) + (y) - 1) & ((y) - 1))
@@ -259,7 +260,8 @@ static void run(const char *file, char **argv)
setup_ldt();
jump16(offset, start);
- abort(); /* Does not return */
+ abort(); /* Should never be hit */
+
barf:
fprintf(stderr, "run16: %s: %s\n", file, strerror(errno));
exit(127);