summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2008-07-22 22:28:07 +0000
committerThomas Schwinge <tschwinge@gnu.org>2009-06-18 00:27:18 +0200
commit482cc1b78fae30281528145098ab8d9908d5fafe (patch)
tree4587121197bb788c514e2f833878cc0312d0241f
parent155f729a36531a464b82c63ae49adac5cc3b2d70 (diff)
2008-07-19 Barry deFreese <bddebian@comcast.net>
* 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().
-rw-r--r--ChangeLog25
-rw-r--r--chips/busses.h4
-rw-r--r--device/tty.h4
-rw-r--r--i386/i386/ipl.h2
-rw-r--r--i386/i386/trap.c6
-rw-r--r--i386/i386at/com.c10
-rw-r--r--i386/i386at/kd.c15
-rw-r--r--i386/i386at/kd_mouse.c4
-rw-r--r--i386/i386at/lpr.c15
-rw-r--r--i386/i386at/pic_isa.c2
-rw-r--r--kern/eventcount.c2
-rw-r--r--kern/exception.c23
12 files changed, 66 insertions, 46 deletions
diff --git a/ChangeLog b/ChangeLog
index 31fda86..f41c302 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,28 @@
+2008-07-19 Barry deFreese <bddebian@comcast.net>
+
+ * 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().
+
2008-07-20 Samuel Thibault <samuel.thibault@ens-lyon.org>
* linux/pcmcia-cs/glue/wireless_glue.h (schedule_task): Add parameter
diff --git a/chips/busses.h b/chips/busses.h
index 1ff89f0..49c0e44 100644
--- a/chips/busses.h
+++ b/chips/busses.h
@@ -73,7 +73,7 @@ struct bus_ctlr {
struct bus_driver *driver; /* myself, as a device */
char *name; /* readability */
int unit; /* index in driver */
- int (*intr)(); /* interrupt handler(s) */
+ void (*intr)(); /* interrupt handler(s) */
vm_offset_t address; /* device virtual address */
int am; /* address modifier */
vm_offset_t phys_address;/* device phys address */
@@ -93,7 +93,7 @@ struct bus_device {
struct bus_driver *driver; /* autoconf info */
char *name; /* my name */
int unit;
- int (*intr)();
+ void (*intr)();
vm_offset_t address; /* device address */
int am; /* address modifier */
vm_offset_t phys_address;/* device phys address */
diff --git a/device/tty.h b/device/tty.h
index 0ffab2c..10ef304 100644
--- a/device/tty.h
+++ b/device/tty.h
@@ -52,10 +52,10 @@ struct tty {
struct cirbuf t_outq; /* output buffer */
char * t_addr; /* device pointer */
int t_dev; /* device number */
- int (*t_start)(struct tty *);
+ void (*t_start)(struct tty *);
/* routine to start output */
#define t_oproc t_start
- int (*t_stop)(struct tty *, int);
+ void (*t_stop)(struct tty *, int);
/* routine to stop output */
int (*t_mctl)(struct tty *, int, int);
/* (optional) routine to control
diff --git a/i386/i386/ipl.h b/i386/i386/ipl.h
index 86ed660..557cd8d 100644
--- a/i386/i386/ipl.h
+++ b/i386/i386/ipl.h
@@ -70,7 +70,7 @@ WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#ifdef KERNEL
#ifndef __ASSEMBLER__
#include <machine/machspl.h>
-extern int (*ivect[])();
+extern void (*ivect[])();
extern int iunit[];
extern int intpri[];
#endif /* __ASSEMBLER__ */
diff --git a/i386/i386/trap.c b/i386/i386/trap.c
index 9c96758..41ce0cc 100644
--- a/i386/i386/trap.c
+++ b/i386/i386/trap.c
@@ -60,10 +60,10 @@
#include "debug.h"
-extern void exception();
-extern void thread_exception_return();
+extern void exception() __attribute__ ((noreturn));
+extern void thread_exception_return() __attribute__ ((noreturn));
-extern void i386_exception();
+extern void i386_exception() __attribute__ ((noreturn));
#if MACH_KDB
boolean_t debug_all_traps_with_kdb = FALSE;
diff --git a/i386/i386at/com.c b/i386/i386at/com.c
index 6e7dcbf..a4cfbf8 100644
--- a/i386/i386at/com.c
+++ b/i386/i386at/com.c
@@ -47,10 +47,10 @@
extern void timeout(), ttrstrt();
-int comprobe(), comintr(), comstart(), commctl();
-void comattach();
+int comprobe(), comstart(), commctl();
+void comstop(), comattach(), comintr();
static void comparam();
-int comstop(), comgetstat(), comsetstat();
+int comgetstat(), comsetstat();
static vm_offset_t com_std[NCOM] = { 0 };
struct bus_device *cominfo[NCOM];
@@ -489,7 +489,7 @@ unsigned int count;
return (D_SUCCESS);
}
-int
+void
comintr(unit)
int unit;
{
@@ -809,7 +809,7 @@ commctl(
return commodem[unit];
}
-int
+void
comstop(tp, flags)
register struct tty *tp;
int flags;
diff --git a/i386/i386at/kd.c b/i386/i386at/kd.c
index 6723752..8975ad1 100644
--- a/i386/i386at/kd.c
+++ b/i386/i386at/kd.c
@@ -118,7 +118,7 @@ boolean_t kdcheckmagic();
int kdcnprobe(struct consdev *cp);
int kdcninit(struct consdev *cp);
int kdcngetc(dev_t dev, int wait);
-int kdcnputc(dev_t dev, int c);
+void kdcnputc(dev_t dev, int c);
int do_modifier (int, Scancode, boolean_t);
/*
@@ -461,9 +461,9 @@ kdopen(dev, flag, ior)
io_req_t ior;
{
struct tty *tp;
- int kdstart();
+ void kdstart();
spl_t o_pri;
- int kdstop();
+ void kdstop();
tp = &kd_tty;
o_pri = spltty();
@@ -737,7 +737,7 @@ int flags; /* flags set for console */
*
*/
/*ARGSUSED*/
-int
+void
kdintr(vec, regs)
int vec;
int regs;
@@ -1085,7 +1085,7 @@ boolean_t extended;
* Entered and left at spltty. Drops priority to spl0 to display character.
* ASSUMES that it is never called from interrupt-driven code.
*/
-int
+void
kdstart(tp)
struct tty *tp;
{
@@ -1136,7 +1136,7 @@ struct tty *tp;
}
/*ARGSUSED*/
-int
+void
kdstop(tp, flags)
register struct tty *tp;
int flags;
@@ -2975,6 +2975,7 @@ kdcnprobe(struct consdev *cp)
cp->cn_dev = makedev(maj, unit);
cp->cn_pri = pri;
+ return 0;
}
int
@@ -2997,7 +2998,7 @@ kdcngetc(dev_t dev, int wait)
return kdcnmaygetc();
}
-int
+void
kdcnputc(dev_t dev, int c)
{
if (!kd_initialized)
diff --git a/i386/i386at/kd_mouse.c b/i386/i386at/kd_mouse.c
index 9487c54..94ebd79 100644
--- a/i386/i386at/kd_mouse.c
+++ b/i386/i386at/kd_mouse.c
@@ -124,7 +124,7 @@ u_char lastbuttons; /* previous state of mouse buttons */
#define MOUSE_DOWN 0
#define MOUSE_ALL_UP 0x7
-int mouseintr();
+void mouseintr();
void mouse_enqueue();
int mouse_baud = BCNT1200;
@@ -539,7 +539,7 @@ done:
/*
* mouseintr - Get a byte and pass it up for handling. Called at SPLKD.
*/
-int
+void
mouseintr(unit)
{
unsigned short base_addr = cominfo[unit]->address;
diff --git a/i386/i386at/lpr.c b/i386/i386at/lpr.c
index 05edc7b..ee8e721 100644
--- a/i386/i386at/lpr.c
+++ b/i386/i386at/lpr.c
@@ -65,7 +65,8 @@ extern void ttrstrt();
* Driver information for auto-configuration stuff.
*/
-int lprprobe(), lprintr(), lprstart(), lprstop();
+int lprprobe(), lprstop();
+void lprintr(), lprstart();
void lprattach(struct bus_device *);
#ifdef MACH_KERNEL
int lprstop(), lprgetstat(), lprsetstat();
@@ -280,7 +281,7 @@ int lprioctl(dev, cmd, addr, mode)
}
#endif /* MACH_KERNEL */
-int lprintr(unit)
+void lprintr(unit)
int unit;
{
register struct tty *tp = &lpr_tty[unit];
@@ -295,7 +296,7 @@ int unit;
lprstart(tp);
}
-int lprstart(tp)
+void lprstart(tp)
struct tty *tp;
{
spl_t s = spltty();
@@ -305,13 +306,13 @@ struct tty *tp;
if (tp->t_state & (TS_TIMEOUT|TS_TTSTOP|TS_BUSY)) {
splx(s);
- return(0);
+ return;
}
if (status & 0x20) {
printf("Printer out of paper!\n");
splx(s);
- return(0);
+ return;
}
if (tp->t_outq.c_cc <= TTLOWAT(tp)) {
@@ -331,7 +332,7 @@ struct tty *tp;
}
if (tp->t_outq.c_cc == 0) {
splx(s);
- return(0);
+ return;
}
#ifdef MACH_KERNEL
nch = getc(&tp->t_outq);
@@ -366,7 +367,7 @@ struct tty *tp;
}
#endif /* MACH_KERNEL */
splx(s);
- return(0);
+ return;
}
#ifdef MACH_KERNEL
diff --git a/i386/i386at/pic_isa.c b/i386/i386at/pic_isa.c
index 9d791c7..07b48a7 100644
--- a/i386/i386at/pic_isa.c
+++ b/i386/i386at/pic_isa.c
@@ -33,7 +33,7 @@
extern intnull(), fpintr(), hardclock(), kdintr();
extern prtnull();
-int (*ivect[NINTR])() = {
+void (*ivect[NINTR])() = {
/* 00 */ hardclock, /* always */
#if RCLINE < 0
/* 01 */ kdintr, /* kdintr, ... */
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) {