PATCH: POSIX 1003.1b timer minor fixes

Robert H. de Vries (R.de.Vries@fokkerspace.nl)
Tue, 27 Jul 1999 14:38:02 +0200 (CEST)


Included you will find a patch correcting all comments from Ulrich Drepper
and Andreas Jaeger.

It fixes:

* two typos (one in my code, and one in other code).
* Rename MAX_ITIMERS to TIMER_MAX
* Add DELAYTIMER_MAX

This patch is relative to prepatch 2.3.12-pre6, but should work without a
problem to the latest prepatch.

Robert

diff -ruN linux-2.3.12-pre6-vanilla/arch/alpha/kernel/entry.S linux-2.3.12-pre6/arch/alpha/kernel/entry.S
--- linux-2.3.12-pre6-vanilla/arch/alpha/kernel/entry.S Tue Jul 27 09:00:19 1999
+++ linux-2.3.12-pre6/arch/alpha/kernel/entry.S Tue Jul 27 09:18:03 1999
@@ -1146,7 +1146,7 @@
.quad sys_timer_create
.quad sys_timer_settime
.quad sys_timer_gettime
- .quad sys_timer_setoverrun
+ .quad sys_timer_getoverrun
.quad sys_timer_delete /* 375 */
.quad sys_clock_gettime
.quad sys_clock_settime
diff -ruN linux-2.3.12-pre6-vanilla/arch/mips/kernel/irix5sys.h linux-2.3.12-pre6/arch/mips/kernel/irix5sys.h
--- linux-2.3.12-pre6-vanilla/arch/mips/kernel/irix5sys.h Thu Jul 8 09:21:48 1999
+++ linux-2.3.12-pre6/arch/mips/kernel/irix5sys.h Tue Jul 27 09:18:03 1999
@@ -235,7 +235,7 @@
SYS(irix_unimp, 0) /* 1213 XXX timer_delete() */
SYS(irix_unimp, 0) /* 1214 XXX timer_settime() */
SYS(irix_unimp, 0) /* 1215 XXX timer_gettime() */
-SYS(irix_unimp, 0) /* 1216 XXX timer_setoverrun() */
+SYS(irix_unimp, 0) /* 1216 XXX timer_getoverrun() */
SYS(sys_sched_rr_get_interval, 2) /* 1217 sched_rr_get_interval()V*/
SYS(sys_sched_yield, 0) /* 1218 sched_yield() V*/
SYS(sys_sched_getscheduler, 1) /* 1219 sched_getscheduler() V*/
diff -ruN linux-2.3.12-pre6-vanilla/include/linux/limits.h linux-2.3.12-pre6/include/linux/limits.h
--- linux-2.3.12-pre6-vanilla/include/linux/limits.h Tue Jul 27 09:00:26 1999
+++ linux-2.3.12-pre6/include/linux/limits.h Tue Jul 27 09:17:59 1999
@@ -14,7 +14,8 @@
#define PATH_MAX 4095 /* # chars in a path name */
#define PIPE_BUF 4096 /* # bytes in atomic write to a pipe */

-#define MAX_ITIMERS 32 /* # POSIX.1b itimers per process */
+#define TIMER_MAX 32 /* # POSIX.1b timers a process may have */
+#define DELAYTIMER_MAX INT_MAX /* # timer expiration overruns a POSIX.1b timer may have */

#define RTSIG_MAX 32

diff -ruN linux-2.3.12-pre6-vanilla/include/linux/sched.h linux-2.3.12-pre6/include/linux/sched.h
--- linux-2.3.12-pre6-vanilla/include/linux/sched.h Tue Jul 27 09:00:26 1999
+++ linux-2.3.12-pre6/include/linux/sched.h Tue Jul 27 13:23:59 1999
@@ -241,7 +241,7 @@
struct itimer_struct {
atomic_t count;
spinlock_t its_lock;
- struct k_itimer *itimer[MAX_ITIMERS];
+ struct k_itimer *itimer[TIMER_MAX];
};

struct task_struct {
diff -ruN linux-2.3.12-pre6-vanilla/kernel/exit.c linux-2.3.12-pre6/kernel/exit.c
--- linux-2.3.12-pre6-vanilla/kernel/exit.c Tue Jul 27 09:00:26 1999
+++ linux-2.3.12-pre6/kernel/exit.c Tue Jul 27 09:18:02 1999
@@ -243,7 +243,7 @@

if (atomic_dec_and_test(&timers->count)) {
tsk->posix_timers = NULL;
- for (i = 0; i < MAX_ITIMERS; i++) {
+ for (i = 0; i < TIMER_MAX; i++) {
timr = timers->itimer[i];
if (timr) {
start_bh_atomic();
diff -ruN linux-2.3.12-pre6-vanilla/kernel/itimer.c linux-2.3.12-pre6/kernel/itimer.c
--- linux-2.3.12-pre6-vanilla/kernel/itimer.c Tue Jul 27 09:00:26 1999
+++ linux-2.3.12-pre6/kernel/itimer.c Tue Jul 27 09:18:02 1999
@@ -238,7 +238,7 @@
{
int i;

- for (i = 0; i < MAX_ITIMERS; i++) {
+ for (i = 0; i < TIMER_MAX; i++) {
if (timers->itimer[i] == NULL) return i;
}
return -1;
@@ -359,7 +359,7 @@
{
struct k_itimer *timr;

- if ((timer_id < 0) || (timer_id >= MAX_ITIMERS)) return NULL;
+ if ((timer_id < 0) || (timer_id >= TIMER_MAX)) return NULL;
spin_lock(&tsk->posix_timers->its_lock);
timr = tsk->posix_timers->itimer[timer_id];
if (timr) spin_lock(&timr->it_lock);

--
Robert H. de Vries
PO/SIM
Fokker Space B.V.
e-mail: R.de.Vries@fokkerspace.nl
   tel: (+31)71-5245464
   fax: (+31)71-5245498

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/