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
nexedi
linux
Commits
c948c5e3
Commit
c948c5e3
authored
Jun 14, 2003
by
Andrew Morton
Committed by
Linus Torvalds
Jun 14, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] alpha: fix do_settimeofday() for new API
parent
99f2577a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
14 deletions
+19
-14
arch/alpha/kernel/time.c
arch/alpha/kernel/time.c
+19
-14
No files found.
arch/alpha/kernel/time.c
View file @
c948c5e3
...
...
@@ -445,11 +445,14 @@ do_gettimeofday(struct timeval *tv)
tv
->
tv_usec
=
usec
;
}
void
do_settimeofday
(
struct
time
val
*
tv
)
int
do_settimeofday
(
struct
time
spec
*
tv
)
{
unsigned
long
delta_usec
;
long
sec
,
usec
;
unsigned
long
delta_nsec
;
long
sec
,
nsec
;
if
((
unsigned
long
)
tv
->
tv_nsec
>=
NSEC_PER_SEC
)
return
-
EINVAL
;
write_seqlock_irq
(
&
xtime_lock
);
...
...
@@ -458,31 +461,33 @@ do_settimeofday(struct timeval *tv)
time. Without this, a full-tick error is possible. */
#ifdef CONFIG_SMP
delta_
usec
=
(
jiffies
-
wall_jiffies
)
*
(
1000000
/
HZ
);
delta_
nsec
=
(
jiffies
-
wall_jiffies
)
*
(
NSEC_PER_SEC
/
HZ
);
#else
delta_
u
sec
=
rpcc
()
-
state
.
last_time
;
delta_
usec
=
(
delta_u
sec
*
state
.
scaled_ticks_per_cycle
delta_
n
sec
=
rpcc
()
-
state
.
last_time
;
delta_
nsec
=
(
delta_n
sec
*
state
.
scaled_ticks_per_cycle
+
state
.
partial_tick
+
((
jiffies
-
wall_jiffies
)
<<
FIX_SHIFT
))
*
15625
;
delta_usec
=
((
delta_usec
/
((
1UL
<<
(
FIX_SHIFT
-
6
-
1
))
*
HZ
))
+
1
)
/
2
;
delta_nsec
=
((
delta_nsec
/
((
1UL
<<
(
FIX_SHIFT
-
6
-
1
))
*
HZ
))
+
1
)
/
2
;
delta_nsec
*=
1000
;
#endif
sec
=
tv
->
tv_sec
;
usec
=
tv
->
tv_u
sec
;
usec
-=
delta_u
sec
;
if
(
u
sec
<
0
)
{
usec
+=
1000000
;
nsec
=
tv
->
tv_n
sec
;
nsec
-=
delta_n
sec
;
if
(
n
sec
<
0
)
{
nsec
+=
NSEC_PER_SEC
;
sec
-=
1
;
}
xtime
.
tv_sec
=
sec
;
xtime
.
tv_nsec
=
(
usec
/
1000
)
;
xtime
.
tv_nsec
=
nsec
;
time_adjust
=
0
;
/* stop active adjtime() */
time_status
|=
STA_UNSYNC
;
time_maxerror
=
NTP_PHASE_LIMIT
;
time_esterror
=
NTP_PHASE_LIMIT
;
write_sequnlock_irq
(
&
xtime_lock
);
return
0
;
}
...
...
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