1239281Sgonzo/*-
2239281Sgonzo * Copyright (c) 2012 Olivier Houchard.  All rights reserved.
3239281Sgonzo *
4239281Sgonzo * Redistribution and use in source and binary forms, with or without
5239281Sgonzo * modification, are permitted provided that the following conditions
6239281Sgonzo * are met:
7239281Sgonzo * 1. Redistributions of source code must retain the above copyright
8239281Sgonzo *    notice, this list of conditions and the following disclaimer.
9239281Sgonzo * 2. Redistributions in binary form must reproduce the above copyright
10239281Sgonzo *    notice, this list of conditions and the following disclaimer in the
11239281Sgonzo *    documentation and/or other materials provided with the distribution.
12239281Sgonzo *
13239281Sgonzo * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
14239281Sgonzo * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
15239281Sgonzo * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
16239281Sgonzo * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
17239281Sgonzo * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
18239281Sgonzo * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
19239281Sgonzo * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
20239281Sgonzo * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21239281Sgonzo * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
22239281Sgonzo * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23239281Sgonzo */
24239281Sgonzo
25239281Sgonzo#include <machine/armreg.h>
26239281Sgonzo#include <machine/asm.h>
27239281Sgonzo__FBSDID("$FreeBSD$");
28239281Sgonzo
29275524Sandrew	.cpu cortex-a8
30269395Sian	.arch_extension sec
31239283Sgonzo
32239281Sgonzo/* Issue a smc #0 call */
33239281Sgonzo/* r0 and r1 contains the eventual arguments, r2 contains the function ID */
34239281SgonzoENTRY(ti_smc0)
35239281Sgonzo	stmfd	sp!, {r4-r12, lr}
36239281Sgonzo	mov	r12, r2 /* the rom expects the function ID in r12 */
37239281Sgonzo	dsb
38239281Sgonzo	smc	#0
39239281Sgonzo	ldmfd	sp!, {r4-r12, pc}
40239281Sgonzo
41