Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-davinci
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linux
linux-davinci
Commits
85049d4c
Commit
85049d4c
authored
Aug 16, 2005
by
Tony Lindgren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ARM: OMAP: Add sched_clock() for 32k timer
Add sched_clock() for 32k timer
parent
59a2e980
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
1 deletion
+19
-1
arch/arm/mach-omap1/time.c
arch/arm/mach-omap1/time.c
+19
-1
No files found.
arch/arm/mach-omap1/time.c
View file @
85049d4c
...
...
@@ -296,13 +296,22 @@ static inline void omap_32k_timer_stop(void)
}
/*
* Rounds down to nearest usec
* Rounds down to nearest usec
. Note that this will overflow for larger values.
*/
static
inline
unsigned
long
omap_32k_ticks_to_usecs
(
unsigned
long
ticks_32k
)
{
return
(
ticks_32k
*
5
*
5
*
5
*
5
*
5
*
5
)
>>
9
;
}
/*
* Rounds down to nearest nsec.
*/
static
inline
unsigned
long
long
omap_32k_ticks_to_nsecs
(
unsigned
long
ticks_32k
)
{
return
(
unsigned
long
long
)
ticks_32k
*
1000
*
5
*
5
*
5
*
5
*
5
*
5
>>
9
;
}
static
unsigned
long
omap_32k_last_tick
=
0
;
/*
...
...
@@ -314,6 +323,15 @@ static unsigned long omap_32k_timer_gettimeoffset(void)
return
omap_32k_ticks_to_usecs
(
now
-
omap_32k_last_tick
);
}
/*
* Returns current time from boot in nsecs. It's OK for this to wrap
* around for now, as it's just a relative time stamp.
*/
unsigned
long
long
sched_clock
(
void
)
{
return
omap_32k_ticks_to_nsecs
(
omap_32k_sync_timer_read
());
}
/*
* Timer interrupt for 32KHz timer. When dynamic tick is enabled, this
* function is also called from other interrupts to remove latency
...
...
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