Skip to contentSkip to conversation

two PPC patches for 2.5.73

PATCH In review Colin Leroy 2 participants 2 messages Jul 6, 2003 – Jul 7, 2003

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 two PPC patches for 2.5.73

Hi,

here are two patches for kernel 2.5.73. compile.diff is needed for the kernel to compile. time.diff fixes uptime being wrong; I hope it's correct.

Signature · 4 lines
 \|/ ____ \|/   Colin
 "@'/ ,. \`@"   http://www.geekounet.org/
 /_| \__/ |_\
    \__U_/
ppc/kernel/traps.c renamed from ppc/kernel/traps.c.orig +6 -0
@@ -346,6 +346,12 @@
 	return 0;
 }
 
+void 
+show_stack(struct task_struct *task, unsigned long * sp)
+{
+	printk(KERN_CRIT "arch/ppc/kernel/traps.c::show_stack() called but not implemented!\n");
+}
+
 void
 ProgramCheckException(struct pt_regs *regs)
 {
ppc/kernel/time.c renamed from ppc/kernel/time.c.orig +24 -0
@@ -277,6 +277,18 @@
 	xtime.tv_nsec = new_nsec;
 	xtime.tv_sec = new_sec;
 
+	wall_to_monotonic.tv_sec += xtime.tv_sec - tv->tv_sec;
+	wall_to_monotonic.tv_nsec += xtime.tv_nsec - tv->tv_nsec;
+
+	if (wall_to_monotonic.tv_nsec > NSEC_PER_SEC) {
+		wall_to_monotonic.tv_nsec -= NSEC_PER_SEC;
+		wall_to_monotonic.tv_sec++;
+	}
+	if (wall_to_monotonic.tv_nsec < 0) {
+		wall_to_monotonic.tv_nsec += NSEC_PER_SEC;
+		wall_to_monotonic.tv_sec--;
+	}
+
 	/* In case of a large backwards jump in time with NTP, we want the 
 	 * clock to be updated as soon as the PLL is again in lock.
 	 */
@@ -347,6 +359,8 @@
 		sys_tz.tz_dsttime = 0;
 		xtime.tv_sec -= time_offset;
         }
+	wall_to_monotonic.tv_sec = -xtime.tv_sec;
+	wall_to_monotonic.tv_nsec = -xtime.tv_nsec;
 }
 
 #define FEBRUARY		2
@@ -427,4 +441,14 @@
 	if (err <= inscale/2) mlt++;
 	return mlt;
 }
+
+/* monotonic_clock(): returns # of nanoseconds passed since time_init()
+ *		Note: This function is required to return accurate
+ *		time even in the absence of multiple timer ticks.
+ */
+unsigned long long monotonic_clock(void)
+{
+	return xtime.tv_sec * NSEC_PER_SEC + xtime.tv_nsec;
+}
+EXPORT_SYMBOL(monotonic_clock);
 
#1 lore raw
Quoted 3 lines · Colin Leroy

here are two patches for kernel 2.5.73. compile.diff is needed for the kernel to compile. time.diff fixes uptime being wrong; I hope it's correct.

In the future, PPC changes should be sent to the linuxppc-dev list at lists.linuxppc.org, and this has already been fixed in the linuxppc-2.5 tree (which has all of the changes ready to goto Linus, as well as stuff being worked on for PPC, etc). This tree is at bk://ppc.bkbits.net/linuxppc-2.5 or rsync://source.mvista.com/linuxppc-2.5

Signature · 2 lines
Tom Rini
http://gate.crashing.org/~trini/