From 482cc1b78fae30281528145098ab8d9908d5fafe Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Tue, 22 Jul 2008 22:28:07 +0000 Subject: 2008-07-19 Barry deFreese * chips/busses.h (bus_ctlr, bus_device): Make intr return void instead of int. * device/tty.h (tty): Make t_start and t_stop return void instead of int. * i386/i386/ipl.h (ivect[]): return void instead of int. * i386/i386at/pic_isa.h (ivect[]): Likewise. * i386/i386at/kd_mouse.c (mouseintr): Likewise. * i386/i386at/com.c (comintr, comstop): Likewise. * i386/i386at/kd.c (kdcnputc, kdstart, kdstop, kdintr): Likewise. * i386/i386/trap.c (exception, thread_exception_return, i386_exception): Add __attribute__ ((noreturn)). * i386/i386at/kd.c (kdcnprobe): Return 0 at end of function. * i386/i386at/lpr.c (lprintr, lprstart): Return void instead of int. (lprstart): Don't return numeric values any longer. * kern/eventcount.c (evc_wait_clear): Return a value. * kern/exceptions.c (exception, exception_try_task, exception_no_server, exception_raise, exception_raise_continue, exception_raise_continue_slow, exception_raise_continue_fast): Add __attribute__ ((noreturn)). (exception, exceptio_try_task, exception_raise, exception_raise_continue_slow, exception_raise_continue_fast): Remove spurious returns. (exception_no_server): Add panic() on return from thread_halt_self(). --- kern/eventcount.c | 2 +- kern/exception.c | 23 ++++++++--------------- 2 files changed, 9 insertions(+), 16 deletions(-) (limited to 'kern') diff --git a/kern/eventcount.c b/kern/eventcount.c index fe7626d..1b68ec2 100644 --- a/kern/eventcount.c +++ b/kern/eventcount.c @@ -227,7 +227,7 @@ kern_return_t evc_wait_clear(natural_t ev_id) simple_unlock(&ev->lock); splx(s); - ret = KERN_NO_SPACE; /* XX */ + return KERN_NO_SPACE; /* XX */ } /* diff --git a/kern/exception.c b/kern/exception.c index 6572085..258fedf 100644 --- a/kern/exception.c +++ b/kern/exception.c @@ -51,15 +51,15 @@ -extern void exception(); -extern void exception_try_task(); -extern void exception_no_server(); +extern void exception() __attribute__ ((noreturn)); +extern void exception_try_task() __attribute__ ((noreturn)); +extern void exception_no_server() __attribute__ ((noreturn)); -extern void exception_raise(); +extern void exception_raise() __attribute__ ((noreturn)); extern kern_return_t exception_parse_reply(); -extern void exception_raise_continue(); -extern void exception_raise_continue_slow(); -extern void exception_raise_continue_fast(); +extern void exception_raise_continue() __attribute__ ((noreturn)); +extern void exception_raise_continue_slow() __attribute__ ((noreturn)); +extern void exception_raise_continue_fast() __attribute__ ((noreturn)); #if MACH_KDB extern void thread_kdb_return(); @@ -113,7 +113,6 @@ exception(_exception, code, subcode) ith_unlock(self); exception_try_task(_exception, code, subcode); /*NOTREACHED*/ - return; } ip_lock(exc_port); @@ -122,7 +121,6 @@ exception(_exception, code, subcode) ip_unlock(exc_port); exception_try_task(_exception, code, subcode); /*NOTREACHED*/ - return; } /* @@ -183,7 +181,6 @@ exception_try_task(_exception, code, subcode) itk_unlock(task); exception_no_server(); /*NOTREACHED*/ - return; } ip_lock(exc_port); @@ -192,7 +189,6 @@ exception_try_task(_exception, code, subcode) ip_unlock(exc_port); exception_no_server(); /*NOTREACHED*/ - return; } /* @@ -268,6 +264,7 @@ exception_no_server() (void) task_terminate(self->task); thread_halt_self(); + panic("terminating the task didn't kill us"); /*NOTREACHED*/ } @@ -758,7 +755,6 @@ exception_raise(dest_port, thread_port, task_port, ip_unlock(reply_port); exception_raise_continue_slow(MACH_RCV_PORT_DIED, IKM_NULL, /*dummy*/0); /*NOTREACHED*/ - return; } imq_lock(reply_mqueue); @@ -933,7 +929,6 @@ exception_raise_continue_slow(mr, kmsg, seqno) (mr == MACH_RCV_PORT_DIED)) { thread_exception_return(); /*NOTREACHED*/ - return; } if (self->ith_exc != KERN_SUCCESS) { @@ -941,7 +936,6 @@ exception_raise_continue_slow(mr, kmsg, seqno) self->ith_exc_code, self->ith_exc_subcode); /*NOTREACHED*/ - return; } exception_no_server(); @@ -991,7 +985,6 @@ exception_raise_continue_fast(reply_port, kmsg) if (kr == KERN_SUCCESS) { thread_exception_return(); /*NOTREACHED*/ - return; /* help for the compiler */ } if (self->ith_exc != KERN_SUCCESS) { -- cgit v1.2.3