summaryrefslogtreecommitdiffstats
path: root/nuttx/arch/arm/include/arm/irq.h
diff options
context:
space:
mode:
authorpatacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679>2011-03-29 00:07:02 +0000
committerpatacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679>2011-03-29 00:07:02 +0000
commit5b2b2a609f2748a188c11f845faedbefea7866e7 (patch)
tree82bf5b0e6e26f447eedb4044500a97a0108f4572 /nuttx/arch/arm/include/arm/irq.h
parent5da709c514b7fece0eaaa30e9998751abdbb8334 (diff)
Moving toward system call infrastructure
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@3435 7fd9a85b-ad96-42d3-883c-3090e2eb8679
Diffstat (limited to 'nuttx/arch/arm/include/arm/irq.h')
-rw-r--r--nuttx/arch/arm/include/arm/irq.h47
1 files changed, 43 insertions, 4 deletions
diff --git a/nuttx/arch/arm/include/arm/irq.h b/nuttx/arch/arm/include/arm/irq.h
index 65ccd13563..befc1218b2 100644
--- a/nuttx/arch/arm/include/arm/irq.h
+++ b/nuttx/arch/arm/include/arm/irq.h
@@ -1,7 +1,7 @@
/****************************************************************************
* arch/arm/include/arm/irq.h
*
- * Copyright (C) 2009-2010 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2009-2011 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -204,8 +204,46 @@ static inline void irqrestore(irqstate_t flags)
: "memory");
}
-static inline void system_call(swint_t func, int parm1,
- int parm2, int parm3)
+static inline void system_call0(unsigned int nbr)
+{
+ __asm__ __volatile__
+ (
+ "mov\tr0,%0\n\t"
+ "swi\t0x900001\n\t"
+ :
+ : "r" ((long)(nbr))
+ : "r0", "lr");
+}
+
+static inline void system_call1(unsigned int nbr, uintptr_t parm1)
+{
+ __asm__ __volatile__
+ (
+ "mov\tr0,%0\n\t"
+ "mov\tr1,%1\n\t"
+ "swi\t0x900001\n\t"
+ :
+ : "r" ((long)(nbr)), "r" ((long)(parm1))
+ : "r0", "r1", "lr");
+}
+
+static inline void system_call2(unsigned int nbr, uintptr_t parm1,
+ uintptr_t parm2)
+{
+ __asm__ __volatile__
+ (
+ "mov\tr0,%0\n\t"
+ "mov\tr1,%1\n\t"
+ "mov\tr2,%2\n\t"
+ "swi\t0x900001\n\t"
+ :
+ : "r" ((long)(nbr)), "r" ((long)(parm1)),
+ "r" ((long)(parm2))
+ : "r0", "r1", "r2", "lr");
+}
+
+static inline void system_call3(unsigned int nbr, uintptr_t parm1,
+ uintptr_t parm2, uintptr_t parm3)
{
__asm__ __volatile__
(
@@ -215,10 +253,11 @@ static inline void system_call(swint_t func, int parm1,
"mov\tr3,%3\n\t"
"swi\t0x900001\n\t"
:
- : "r" ((long)(func)), "r" ((long)(parm1)),
+ : "r" ((long)(nbr)), "r" ((long)(parm1)),
"r" ((long)(parm2)), "r" ((long)(parm3))
: "r0", "r1", "r2", "r3", "lr");
}
+
#endif /* __ASSEMBLY__ */
/****************************************************************************