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
1534bc17
Commit
1534bc17
authored
Mar 10, 2002
by
Russell King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make iq80310_gettimeoffset() return the currect time delta.
Remove redundant irq_enter/irq_exit calls.
parent
5ab808d1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
10 deletions
+28
-10
arch/arm/mach-iop310/iq80310-time.c
arch/arm/mach-iop310/iq80310-time.c
+28
-10
No files found.
arch/arm/mach-iop310/iq80310-time.c
View file @
1534bc17
...
@@ -47,23 +47,44 @@ static u_long iq80310_read_timer (void)
...
@@ -47,23 +47,44 @@ static u_long iq80310_read_timer (void)
u_long
b0
,
b1
,
b2
,
b3
,
val
;
u_long
b0
,
b1
,
b2
,
b3
,
val
;
b0
=
*
la0
;
b1
=
*
la1
;
b2
=
*
la2
;
b3
=
*
la3
;
b0
=
*
la0
;
b1
=
*
la1
;
b2
=
*
la2
;
b3
=
*
la3
;
b0
=
(((
b0
&
0x
2
0
)
>>
1
)
|
(
b0
&
0x1f
));
b0
=
(((
b0
&
0x
4
0
)
>>
1
)
|
(
b0
&
0x1f
));
b1
=
(((
b1
&
0x
2
0
)
>>
1
)
|
(
b1
&
0x1f
));
b1
=
(((
b1
&
0x
4
0
)
>>
1
)
|
(
b1
&
0x1f
));
b2
=
(((
b2
&
0x
2
0
)
>>
1
)
|
(
b2
&
0x1f
));
b2
=
(((
b2
&
0x
4
0
)
>>
1
)
|
(
b2
&
0x1f
));
b3
=
(
b3
&
0x0f
);
b3
=
(
b3
&
0x0f
);
val
=
((
b0
<<
0
)
|
(
b1
<<
6
)
|
(
b2
<<
12
)
|
(
b3
<<
18
));
val
=
((
b0
<<
0
)
|
(
b1
<<
6
)
|
(
b2
<<
12
)
|
(
b3
<<
18
));
return
val
;
return
val
;
}
}
/* IRQs are disabled before entering here from do_gettimeofday() */
/*
* IRQs are disabled before entering here from do_gettimeofday().
* Note that the counter may wrap. When it does, 'elapsed' will
* be small, but we will have a pending interrupt.
*/
static
unsigned
long
iq80310_gettimeoffset
(
void
)
static
unsigned
long
iq80310_gettimeoffset
(
void
)
{
{
unsigned
long
elapsed
,
usec
;
unsigned
long
elapsed
,
usec
,
tmp1
;
unsigned
int
stat1
,
stat2
;
/* We need elapsed timer ticks since last interrupt */
stat1
=
*
(
volatile
u8
*
)
IQ80310_INT_STAT
;
elapsed
=
iq80310_read_timer
();
elapsed
=
iq80310_read_timer
();
stat2
=
*
(
volatile
u8
*
)
IQ80310_INT_STAT
;
/*
* If an interrupt was pending before we read the timer,
* we've already wrapped. Factor this into the time.
* If an interrupt was pending after we read the timer,
* it may have wrapped between checking the interrupt
* status and reading the timer. Re-read the timer to
* be sure its value is after the wrap.
*/
if
(
stat1
&
1
)
elapsed
+=
LATCH
;
else
if
(
stat2
&
1
)
elapsed
=
LATCH
+
iq80310_read_timer
();
/* Now convert them to usec */
/*
* Now convert them to usec.
*/
usec
=
(
unsigned
long
)(
elapsed
*
tick
)
/
LATCH
;
usec
=
(
unsigned
long
)(
elapsed
*
tick
)
/
LATCH
;
return
usec
;
return
usec
;
...
@@ -92,9 +113,7 @@ static void iq80310_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
...
@@ -92,9 +113,7 @@ static void iq80310_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
*
*
* -DS
* -DS
*/
*/
irq_exit
(
smp_processor_id
(),
irq
);
do_timer
(
regs
);
do_timer
(
regs
);
irq_enter
(
smp_processor_id
(),
irq
);
}
}
extern
unsigned
long
(
*
gettimeoffset
)(
void
);
extern
unsigned
long
(
*
gettimeoffset
)(
void
);
...
@@ -116,4 +135,3 @@ void __init time_init(void)
...
@@ -116,4 +135,3 @@ void __init time_init(void)
*
timer_en
|=
2
;
*
timer_en
|=
2
;
*
timer_en
|=
1
;
*
timer_en
|=
1
;
}
}
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