diff options
author | isiora <none@example.com> | 2018-01-18 09:16:28 +0000 |
---|---|---|
committer | isiora <none@example.com> | 2018-01-18 09:16:28 +0000 |
commit | c44be00d4fd1365c7fdab487d14183a586a57214 (patch) | |
tree | d6c143c663cb14e0690a9d476bb79c56ccb9abc2 /demos/ATSAMA5D2/RT-SAMA5D2-XPLAINED-NSEC/smcclient.c | |
parent | 09b81ae2539a7b3aceac489ad459dfd6192172f5 (diff) | |
download | ChibiOS-c44be00d4fd1365c7fdab487d14183a586a57214.tar.gz ChibiOS-c44be00d4fd1365c7fdab487d14183a586a57214.tar.bz2 ChibiOS-c44be00d4fd1365c7fdab487d14183a586a57214.zip |
Demo for the non secure world.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@11306 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'demos/ATSAMA5D2/RT-SAMA5D2-XPLAINED-NSEC/smcclient.c')
-rw-r--r-- | demos/ATSAMA5D2/RT-SAMA5D2-XPLAINED-NSEC/smcclient.c | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/demos/ATSAMA5D2/RT-SAMA5D2-XPLAINED-NSEC/smcclient.c b/demos/ATSAMA5D2/RT-SAMA5D2-XPLAINED-NSEC/smcclient.c new file mode 100644 index 000000000..ec32af7d6 --- /dev/null +++ b/demos/ATSAMA5D2/RT-SAMA5D2-XPLAINED-NSEC/smcclient.c @@ -0,0 +1,64 @@ +/*
+ ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio.
+
+ This file is part of ChibiOS.
+
+ ChibiOS is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ ChibiOS is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+/**
+ * @file smcclient.c
+ * @brief SMC client module code.
+ *
+ * @addtogroup SMC
+ * @{
+ */
+
+#include "ch.h"
+
+/*===========================================================================*/
+/* Module local definitions. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Module exported variables. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Module local types. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Module local variables. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Module local functions. */
+/*===========================================================================*/
+
+/*===========================================================================*/
+/* Module exported functions. */
+/*===========================================================================*/
+
+msg_t smcInvokeService(msg_t handle, void *data)
+{
+ msg_t result;
+
+ do {
+ asm volatile("smc #0" : "=r" (result) : "r" (handle), "r" (data));
+ } while (result == MSG_RESET);
+ return result;
+}
+
+/** @} */
|