LibPkg
call_swi.h
Go to the documentation of this file.
1 // This file is part of the RISC OS Toolkit (RTK).
2 // Copyright © 2003-2005 Graham Shaw.
3 // Distribution and use are subject to the GNU Lesser General Public License,
4 // a copy of which may be found in the file !RTK.Copyright.
5 // Moved to LibPkg by Alan Buckley to remove the RTK dependency.
6 // Modified from RTK version to add extra exception information
7 // by Theo Markettos
8 
9 #ifndef _LIBPKG_OS_SWI
10 #define _LIBPKG_OS_SWI
11 
12 #include "kernel.h"
13 
14 #include "exception.h"
15 
16 namespace pkg {
17 namespace os {
18 
23 inline void call_swi(unsigned int number,_kernel_swi_regs* regs)
24 {
25  const int X=0x20000;
26  unsigned int r0=regs->r[0];
27  _kernel_oserror* err=_kernel_swi(X+number,regs,regs);
28  if (err) throw exception(err,number,r0);
29 }
30 
31 } /* namespace os */
32 } /* namespace pkg */
33 
34 #endif
void call_swi(unsigned int number, _kernel_swi_regs *regs)
Call a RISC OS software interrupt.
Definition: call_swi.h:23
An exception class to represent a RISC OS error block.
Definition: exception.h:22

Reference Manual LibPkg Version 0.6.1 (28 Jan 2015)