From 9f79feec169dfef2aeeb2ab54aa2bc3909c4a056 Mon Sep 17 00:00:00 2001 From: Bruce Evans Date: Mon, 27 Dec 1999 10:22:09 +0000 Subject: [PATCH] Fixed some type mismatches. p_retval[0] in struct proc has type register_t, so pointers to it must be passed around as `register_t *', not as `int *'. The type mismatches were non-benign on alphas, but the broken code is normally only configured by LINT. --- sys/kern/ksched.c | 22 ++++++++++++---------- sys/posix4/ksched.c | 22 ++++++++++++---------- sys/posix4/posix4.h | 18 ++++++++++-------- sys/sys/posix4.h | 18 ++++++++++-------- 4 files changed, 44 insertions(+), 36 deletions(-) diff --git a/sys/kern/ksched.c b/sys/kern/ksched.c index 3718e25386d8..8f297b21ecab 100644 --- a/sys/kern/ksched.c +++ b/sys/kern/ksched.c @@ -29,6 +29,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * + * $FreeBSD$ */ /* ksched: Soft real time scheduling based on "rtprio". @@ -93,7 +94,7 @@ int ksched_detach(struct ksched *p) #define P1B_PRIO_MAX rtpprio_to_p4prio(RTP_PRIO_MIN) static __inline int -getscheduler(int *ret, struct ksched *ksched, struct proc *p) +getscheduler(register_t *ret, struct ksched *ksched, struct proc *p) { int e = 0; @@ -115,10 +116,11 @@ getscheduler(int *ret, struct ksched *ksched, struct proc *p) return e; } -int ksched_setparam(int *ret, struct ksched *ksched, +int ksched_setparam(register_t *ret, struct ksched *ksched, struct proc *p, const struct sched_param *param) { - int e, policy; + register_t policy; + int e; e = getscheduler(&policy, ksched, p); @@ -133,7 +135,7 @@ int ksched_setparam(int *ret, struct ksched *ksched, return e; } -int ksched_getparam(int *ret, struct ksched *ksched, +int ksched_getparam(register_t *ret, struct ksched *ksched, struct proc *p, struct sched_param *param) { if (RTP_PRIO_IS_REALTIME(p->p_rtprio.type)) @@ -149,7 +151,7 @@ int ksched_getparam(int *ret, struct ksched *ksched, * The permissions to modify process p were checked in "p31b_proc()". * */ -int ksched_setscheduler(int *ret, struct ksched *ksched, +int ksched_setscheduler(register_t *ret, struct ksched *ksched, struct proc *p, int policy, const struct sched_param *param) { int e = 0; @@ -196,20 +198,20 @@ int ksched_setscheduler(int *ret, struct ksched *ksched, return e; } -int ksched_getscheduler(int *ret, struct ksched *ksched, struct proc *p) +int ksched_getscheduler(register_t *ret, struct ksched *ksched, struct proc *p) { return getscheduler(ret, ksched, p); } /* ksched_yield: Yield the CPU. */ -int ksched_yield(int *ret, struct ksched *ksched) +int ksched_yield(register_t *ret, struct ksched *ksched) { need_resched(); return 0; } -int ksched_get_priority_max(int *ret, struct ksched *ksched, int policy) +int ksched_get_priority_max(register_t*ret, struct ksched *ksched, int policy) { int e = 0; @@ -231,7 +233,7 @@ int ksched_get_priority_max(int *ret, struct ksched *ksched, int policy) return e; } -int ksched_get_priority_min(int *ret, struct ksched *ksched, int policy) +int ksched_get_priority_min(register_t *ret, struct ksched *ksched, int policy) { int e = 0; @@ -253,7 +255,7 @@ int ksched_get_priority_min(int *ret, struct ksched *ksched, int policy) return e; } -int ksched_rr_get_interval(int *ret, struct ksched *ksched, +int ksched_rr_get_interval(register_t *ret, struct ksched *ksched, struct proc *p, struct timespec *timespec) { *timespec = ksched->rr_interval; diff --git a/sys/posix4/ksched.c b/sys/posix4/ksched.c index 3718e25386d8..8f297b21ecab 100644 --- a/sys/posix4/ksched.c +++ b/sys/posix4/ksched.c @@ -29,6 +29,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * + * $FreeBSD$ */ /* ksched: Soft real time scheduling based on "rtprio". @@ -93,7 +94,7 @@ int ksched_detach(struct ksched *p) #define P1B_PRIO_MAX rtpprio_to_p4prio(RTP_PRIO_MIN) static __inline int -getscheduler(int *ret, struct ksched *ksched, struct proc *p) +getscheduler(register_t *ret, struct ksched *ksched, struct proc *p) { int e = 0; @@ -115,10 +116,11 @@ getscheduler(int *ret, struct ksched *ksched, struct proc *p) return e; } -int ksched_setparam(int *ret, struct ksched *ksched, +int ksched_setparam(register_t *ret, struct ksched *ksched, struct proc *p, const struct sched_param *param) { - int e, policy; + register_t policy; + int e; e = getscheduler(&policy, ksched, p); @@ -133,7 +135,7 @@ int ksched_setparam(int *ret, struct ksched *ksched, return e; } -int ksched_getparam(int *ret, struct ksched *ksched, +int ksched_getparam(register_t *ret, struct ksched *ksched, struct proc *p, struct sched_param *param) { if (RTP_PRIO_IS_REALTIME(p->p_rtprio.type)) @@ -149,7 +151,7 @@ int ksched_getparam(int *ret, struct ksched *ksched, * The permissions to modify process p were checked in "p31b_proc()". * */ -int ksched_setscheduler(int *ret, struct ksched *ksched, +int ksched_setscheduler(register_t *ret, struct ksched *ksched, struct proc *p, int policy, const struct sched_param *param) { int e = 0; @@ -196,20 +198,20 @@ int ksched_setscheduler(int *ret, struct ksched *ksched, return e; } -int ksched_getscheduler(int *ret, struct ksched *ksched, struct proc *p) +int ksched_getscheduler(register_t *ret, struct ksched *ksched, struct proc *p) { return getscheduler(ret, ksched, p); } /* ksched_yield: Yield the CPU. */ -int ksched_yield(int *ret, struct ksched *ksched) +int ksched_yield(register_t *ret, struct ksched *ksched) { need_resched(); return 0; } -int ksched_get_priority_max(int *ret, struct ksched *ksched, int policy) +int ksched_get_priority_max(register_t*ret, struct ksched *ksched, int policy) { int e = 0; @@ -231,7 +233,7 @@ int ksched_get_priority_max(int *ret, struct ksched *ksched, int policy) return e; } -int ksched_get_priority_min(int *ret, struct ksched *ksched, int policy) +int ksched_get_priority_min(register_t *ret, struct ksched *ksched, int policy) { int e = 0; @@ -253,7 +255,7 @@ int ksched_get_priority_min(int *ret, struct ksched *ksched, int policy) return e; } -int ksched_rr_get_interval(int *ret, struct ksched *ksched, +int ksched_rr_get_interval(register_t *ret, struct ksched *ksched, struct proc *p, struct timespec *timespec) { *timespec = ksched->rr_interval; diff --git a/sys/posix4/posix4.h b/sys/posix4/posix4.h index dee09ec2198b..232435a4922a 100644 --- a/sys/posix4/posix4.h +++ b/sys/posix4/posix4.h @@ -31,6 +31,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * + * $FreeBSD$ */ #include "opt_posix.h" @@ -93,21 +94,22 @@ struct ksched; int ksched_attach(struct ksched **); int ksched_detach(struct ksched *); -int ksched_setparam(int *, struct ksched *, +int ksched_setparam(register_t *, struct ksched *, struct proc *, const struct sched_param *); -int ksched_getparam(int *, struct ksched *, +int ksched_getparam(register_t *, struct ksched *, struct proc *, struct sched_param *); -int ksched_setscheduler(int *, struct ksched *, +int ksched_setscheduler(register_t *, struct ksched *, struct proc *, int, const struct sched_param *); -int ksched_getscheduler(int *, struct ksched *, struct proc *); +int ksched_getscheduler(register_t *, struct ksched *, struct proc *); -int ksched_yield(int *, struct ksched *); +int ksched_yield(register_t *, struct ksched *); -int ksched_get_priority_max(int *, struct ksched *, int); -int ksched_get_priority_min(int *, struct ksched *, int); +int ksched_get_priority_max(register_t *, struct ksched *, int); +int ksched_get_priority_min(register_t *, struct ksched *, int); -int ksched_rr_get_interval(int *, struct ksched *, struct proc *, struct timespec *); +int ksched_rr_get_interval(register_t *, struct ksched *, + struct proc *, struct timespec *); #endif /* _KPOSIX_PRIORITY_SCHEDULING */ diff --git a/sys/sys/posix4.h b/sys/sys/posix4.h index dee09ec2198b..232435a4922a 100644 --- a/sys/sys/posix4.h +++ b/sys/sys/posix4.h @@ -31,6 +31,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * + * $FreeBSD$ */ #include "opt_posix.h" @@ -93,21 +94,22 @@ struct ksched; int ksched_attach(struct ksched **); int ksched_detach(struct ksched *); -int ksched_setparam(int *, struct ksched *, +int ksched_setparam(register_t *, struct ksched *, struct proc *, const struct sched_param *); -int ksched_getparam(int *, struct ksched *, +int ksched_getparam(register_t *, struct ksched *, struct proc *, struct sched_param *); -int ksched_setscheduler(int *, struct ksched *, +int ksched_setscheduler(register_t *, struct ksched *, struct proc *, int, const struct sched_param *); -int ksched_getscheduler(int *, struct ksched *, struct proc *); +int ksched_getscheduler(register_t *, struct ksched *, struct proc *); -int ksched_yield(int *, struct ksched *); +int ksched_yield(register_t *, struct ksched *); -int ksched_get_priority_max(int *, struct ksched *, int); -int ksched_get_priority_min(int *, struct ksched *, int); +int ksched_get_priority_max(register_t *, struct ksched *, int); +int ksched_get_priority_min(register_t *, struct ksched *, int); -int ksched_rr_get_interval(int *, struct ksched *, struct proc *, struct timespec *); +int ksched_rr_get_interval(register_t *, struct ksched *, + struct proc *, struct timespec *); #endif /* _KPOSIX_PRIORITY_SCHEDULING */