Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
044836d4
Commit
044836d4
authored
Oct 05, 2004
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Plain Diff
Merge
bk://bk.arm.linux.org.uk/linux-2.6-rmk
into ppc970.osdl.org:/home/torvalds/v2.6/linux
parents
7e5829c1
ee206dc5
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
54 additions
and
9 deletions
+54
-9
arch/arm/kernel/time.c
arch/arm/kernel/time.c
+33
-0
arch/arm/mach-pxa/pm.c
arch/arm/mach-pxa/pm.c
+7
-3
arch/arm/mach-sa1100/pm.c
arch/arm/mach-sa1100/pm.c
+8
-4
arch/arm/mm/init.c
arch/arm/mm/init.c
+1
-0
include/asm-arm/mach/time.h
include/asm-arm/mach/time.h
+5
-2
No files found.
arch/arm/kernel/time.c
View file @
044836d4
...
@@ -304,6 +304,39 @@ int do_settimeofday(struct timespec *tv)
...
@@ -304,6 +304,39 @@ int do_settimeofday(struct timespec *tv)
EXPORT_SYMBOL
(
do_settimeofday
);
EXPORT_SYMBOL
(
do_settimeofday
);
/**
* save_time_delta - Save the offset between system time and RTC time
* @delta: pointer to timespec to store delta
* @rtc: pointer to timespec for current RTC time
*
* Return a delta between the system time and the RTC time, such
* that system time can be restored later with restore_time_delta()
*/
void
save_time_delta
(
struct
timespec
*
delta
,
struct
timespec
*
rtc
)
{
set_normalized_timespec
(
delta
,
xtime
.
tv_sec
-
rtc
->
tv_sec
,
xtime
.
tv_nsec
-
rtc
->
tv_nsec
);
}
EXPORT_SYMBOL
(
save_time_delta
);
/**
* restore_time_delta - Restore the current system time
* @delta: delta returned by save_time_delta()
* @rtc: pointer to timespec for current RTC time
*/
void
restore_time_delta
(
struct
timespec
*
delta
,
struct
timespec
*
rtc
)
{
struct
timespec
ts
;
set_normalized_timespec
(
&
ts
,
delta
->
tv_sec
+
rtc
->
tv_sec
,
delta
->
tv_nsec
+
rtc
->
tv_nsec
);
do_settimeofday
(
&
ts
);
}
EXPORT_SYMBOL
(
restore_time_delta
);
void
timer_tick
(
struct
pt_regs
*
regs
)
void
timer_tick
(
struct
pt_regs
*
regs
)
{
{
profile_tick
(
CPU_PROFILING
,
regs
);
profile_tick
(
CPU_PROFILING
,
regs
);
...
...
arch/arm/mach-pxa/pm.c
View file @
044836d4
...
@@ -21,6 +21,7 @@
...
@@ -21,6 +21,7 @@
#include <asm/system.h>
#include <asm/system.h>
#include <asm/arch/pxa-regs.h>
#include <asm/arch/pxa-regs.h>
#include <asm/arch/lubbock.h>
#include <asm/arch/lubbock.h>
#include <asm/mach/time.h>
/*
/*
...
@@ -69,14 +70,16 @@ static int pxa_pm_enter(u32 state)
...
@@ -69,14 +70,16 @@ static int pxa_pm_enter(u32 state)
{
{
unsigned
long
sleep_save
[
SLEEP_SAVE_SIZE
];
unsigned
long
sleep_save
[
SLEEP_SAVE_SIZE
];
unsigned
long
checksum
=
0
;
unsigned
long
checksum
=
0
;
unsigned
long
delta
;
struct
timespec
delta
,
rtc
;
int
i
;
int
i
;
if
(
state
!=
PM_SUSPEND_MEM
)
if
(
state
!=
PM_SUSPEND_MEM
)
return
-
EINVAL
;
return
-
EINVAL
;
/* preserve current time */
/* preserve current time */
delta
=
xtime
.
tv_sec
-
RCNR
;
rtc
.
tv_sec
=
RCNR
;
rtc
.
tv_nsec
=
0
;
save_time_delta
(
&
delta
,
&
rtc
);
/* save vital registers */
/* save vital registers */
SAVE
(
OSMR0
);
SAVE
(
OSMR0
);
...
@@ -161,7 +164,8 @@ static int pxa_pm_enter(u32 state)
...
@@ -161,7 +164,8 @@ static int pxa_pm_enter(u32 state)
RESTORE
(
ICMR
);
RESTORE
(
ICMR
);
/* restore current time */
/* restore current time */
xtime
.
tv_sec
=
RCNR
+
delta
;
rtc
.
tv_sec
=
RCNR
;
restore_time_delta
(
&
delta
,
&
rtc
);
#ifdef DEBUG
#ifdef DEBUG
printk
(
KERN_DEBUG
"*** made it back from resume
\n
"
);
printk
(
KERN_DEBUG
"*** made it back from resume
\n
"
);
...
...
arch/arm/mach-sa1100/pm.c
View file @
044836d4
...
@@ -30,6 +30,7 @@
...
@@ -30,6 +30,7 @@
#include <asm/hardware.h>
#include <asm/hardware.h>
#include <asm/memory.h>
#include <asm/memory.h>
#include <asm/system.h>
#include <asm/system.h>
#include <asm/mach/time.h>
extern
void
sa1100_cpu_suspend
(
void
);
extern
void
sa1100_cpu_suspend
(
void
);
extern
void
sa1100_cpu_resume
(
void
);
extern
void
sa1100_cpu_resume
(
void
);
...
@@ -58,14 +59,16 @@ enum { SLEEP_SAVE_SP = 0,
...
@@ -58,14 +59,16 @@ enum { SLEEP_SAVE_SP = 0,
static
int
sa11x0_pm_enter
(
u32
state
)
static
int
sa11x0_pm_enter
(
u32
state
)
{
{
unsigned
long
sleep_save
[
SLEEP_SAVE_SIZE
];
unsigned
long
gpio
,
sleep_save
[
SLEEP_SAVE_SIZE
];
unsigned
long
delta
,
gpio
;
struct
timespec
delta
,
rtc
;
if
(
state
!=
PM_SUSPEND_MEM
)
if
(
state
!=
PM_SUSPEND_MEM
)
return
-
EINVAL
;
return
-
EINVAL
;
/* preserve current time */
/* preserve current time */
delta
=
xtime
.
tv_sec
-
RCNR
;
rtc
.
tv_sec
=
RCNR
;
rtc
.
tv_nsec
=
0
;
save_time_delta
(
&
delta
,
&
rtc
);
gpio
=
GPLR
;
gpio
=
GPLR
;
/* save vital registers */
/* save vital registers */
...
@@ -136,7 +139,8 @@ static int sa11x0_pm_enter(u32 state)
...
@@ -136,7 +139,8 @@ static int sa11x0_pm_enter(u32 state)
OSCR
=
OSMR0
-
LATCH
;
OSCR
=
OSMR0
-
LATCH
;
/* restore current time */
/* restore current time */
xtime
.
tv_sec
=
RCNR
+
delta
;
rtc
.
tv_sec
=
RCNR
;
restore_time_delta
(
&
delta
,
&
rtc
);
return
0
;
return
0
;
}
}
...
...
arch/arm/mm/init.c
View file @
044836d4
...
@@ -14,6 +14,7 @@
...
@@ -14,6 +14,7 @@
#include <linux/swap.h>
#include <linux/swap.h>
#include <linux/init.h>
#include <linux/init.h>
#include <linux/bootmem.h>
#include <linux/bootmem.h>
#include <linux/mman.h>
#include <linux/initrd.h>
#include <linux/initrd.h>
#include <asm/mach-types.h>
#include <asm/mach-types.h>
...
...
include/asm-arm/mach/time.h
View file @
044836d4
...
@@ -13,8 +13,11 @@
...
@@ -13,8 +13,11 @@
extern
void
(
*
init_arch_time
)(
void
);
extern
void
(
*
init_arch_time
)(
void
);
extern
int
(
*
set_rtc
)(
void
);
extern
int
(
*
set_rtc
)(
void
);
extern
unsigned
long
(
*
gettimeoffset
)(
void
);
extern
unsigned
long
(
*
gettimeoffset
)(
void
);
void
timer_tick
(
struct
pt_regs
*
);
extern
void
timer_tick
(
struct
pt_regs
*
);
extern
void
save_time_delta
(
struct
timespec
*
delta
,
struct
timespec
*
rtc
);
extern
void
restore_time_delta
(
struct
timespec
*
delta
,
struct
timespec
*
rtc
);
#endif
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment