From c44be00d4fd1365c7fdab487d14183a586a57214 Mon Sep 17 00:00:00 2001 From: isiora Date: Thu, 18 Jan 2018 09:16:28 +0000 Subject: Demo for the non secure world. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@11306 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- .../ATSAMA5D2/RT-SAMA5D2-XPLAINED-NSEC/smcclient.c | 64 ++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 demos/ATSAMA5D2/RT-SAMA5D2-XPLAINED-NSEC/smcclient.c (limited to 'demos/ATSAMA5D2/RT-SAMA5D2-XPLAINED-NSEC/smcclient.c') 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 . +*/ + +/** + * @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; +} + +/** @} */ -- cgit v1.2.3