mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Colin Leroy <colin@colino.net>
To: linux-kernel@vger.kernel.org
Subject: [PATCH] two PPC patches for 2.5.73
Date: Sun, 6 Jul 2003 02:39:22 +0200	[thread overview]
Message-ID: <20030706023922.52c2806a.colin@colino.net> (raw)

[-- Attachment #1: Type: text/plain, Size: 246 bytes --]

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.

-- 
 \|/ ____ \|/   Colin
 "@'/ ,. \`@"   http://www.geekounet.org/
 /_| \__/ |_\
    \__U_/

[-- Attachment #2: compile.diff --]
[-- Type: text/plain, Size: 367 bytes --]

--- arch/ppc/kernel/traps.c.orig	Sun Jul  6 02:36:56 2003
+++ arch/ppc/kernel/traps.c	Sun Jul  6 02:36:49 2003
@@ -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)
 {

[-- Attachment #3: time.diff --]
[-- Type: text/plain, Size: 1298 bytes --]

--- arch/ppc/kernel/time.c.orig	Sun Jul  6 02:35:18 2003
+++ arch/ppc/kernel/time.c	Sun Jul  6 02:20:27 2003
@@ -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);
 

             reply	other threads:[~2003-07-06  0:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-06  0:39 Colin Leroy [this message]
2003-07-07 16:18 ` Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030706023922.52c2806a.colin@colino.net \
    --to=colin@colino.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®