Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
Software for White Rabbit PTP Core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
28
Issues
28
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Software for White Rabbit PTP Core
Commits
fcf531df
Commit
fcf531df
authored
Apr 08, 2011
by
Tomasz Wlostowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added irq routines
parent
0cbcb7e0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
0 deletions
+39
-0
irq.c
target/lm32/irq.c
+39
-0
No files found.
target/lm32/irq.c
0 → 100644
View file @
fcf531df
#include "irq.h"
void
disable_irq
()
{
unsigned
int
ie
,
im
;
unsigned
int
Mask
=
~
1
;
/* disable peripheral interrupts in case they were enabled */
asm
volatile
(
"rcsr %0,ie"
:
"=r"
(
ie
));
ie
&=
(
~
0x1
);
asm
volatile
(
"wcsr ie, %0"
::
"r"
(
ie
));
/* disable mask-bit in im */
asm
volatile
(
"rcsr %0, im"
:
"=r"
(
im
));
im
&=
Mask
;
asm
volatile
(
"wcsr im, %0"
::
"r"
(
im
));
}
void
enable_irq
()
{
unsigned
int
ie
,
im
;
unsigned
int
Mask
=
1
;
/* disable peripheral interrupts in-case they were enabled*/
asm
volatile
(
"rcsr %0,ie"
:
"=r"
(
ie
));
ie
&=
(
~
0x1
);
asm
volatile
(
"wcsr ie, %0"
::
"r"
(
ie
));
/* enable mask-bit in im */
asm
volatile
(
"rcsr %0, im"
:
"=r"
(
im
));
im
|=
Mask
;
asm
volatile
(
"wcsr im, %0"
::
"r"
(
im
));
ie
|=
0x1
;
asm
volatile
(
"wcsr ie, %0"
::
"r"
(
ie
));
}
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