omap_smc.S revision 1.1
11.1Sskrll/* $NetBSD: omap_smc.S,v 1.1 2025/12/16 12:20:22 skrll Exp $ */ 21.1Sskrll 31.1Sskrll/*- 41.1Sskrll * Copyright (c) 2025 Rui-Xiang Guo 51.1Sskrll * All rights reserved. 61.1Sskrll * 71.1Sskrll * Redistribution and use in source and binary forms, with or without 81.1Sskrll * modification, are permitted provided that the following conditions 91.1Sskrll * are met: 101.1Sskrll * 1. Redistributions of source code must retain the above copyright 111.1Sskrll * notice, this list of conditions and the following disclaimer. 121.1Sskrll * 2. Redistributions in binary form must reproduce the above copyright 131.1Sskrll * notice, this list of conditions and the following disclaimer in the 141.1Sskrll * documentation and/or other materials provided with the distribution. 151.1Sskrll * 161.1Sskrll * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 171.1Sskrll * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 181.1Sskrll * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 191.1Sskrll * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 201.1Sskrll * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 211.1Sskrll * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 221.1Sskrll * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 231.1Sskrll * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 241.1Sskrll * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 251.1Sskrll * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 261.1Sskrll * SUCH DAMAGE. 271.1Sskrll */ 281.1Sskrll 291.1Sskrll/*- 301.1Sskrll * Copyright (c) 2014 The NetBSD Foundation, Inc. 311.1Sskrll * All rights reserved. 321.1Sskrll * 331.1Sskrll * This code is derived from software contributed to The NetBSD Foundation 341.1Sskrll * by Reinoud Zandijk. 351.1Sskrll * 361.1Sskrll * Redistribution and use in source and binary forms, with or without 371.1Sskrll * modification, are permitted provided that the following conditions 381.1Sskrll * are met: 391.1Sskrll * 1. Redistributions of source code must retain the above copyright 401.1Sskrll * notice, this list of conditions and the following disclaimer. 411.1Sskrll * 2. Redistributions in binary form must reproduce the above copyright 421.1Sskrll * notice, this list of conditions and the following disclaimer in the 431.1Sskrll * documentation and/or other materials provided with the distribution. 441.1Sskrll * 451.1Sskrll * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 461.1Sskrll * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 471.1Sskrll * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 481.1Sskrll * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 491.1Sskrll * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 501.1Sskrll * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 511.1Sskrll * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 521.1Sskrll * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 531.1Sskrll * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 541.1Sskrll * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 551.1Sskrll * POSSIBILITY OF SUCH DAMAGE. 561.1Sskrll */ 571.1Sskrll 581.1Sskrll 591.1Sskrll#include <arm/asm.h> 601.1Sskrll#include <arm/armreg.h> 611.1Sskrll 621.1SskrllRCSID("$NetBSD: omap_smc.S,v 1.1 2025/12/16 12:20:22 skrll Exp $") 631.1Sskrll 641.1Sskrll .arch armv7-a 651.1Sskrll .arch_extension sec 661.1Sskrll/* 671.1Sskrll * void 681.1Sskrll * omap_smc(uint32_t arg1, uint32_t cmd) 691.1Sskrll */ 701.1Sskrll 711.1SskrllENTRY_NP(omap_smc) 721.1Sskrll stmfd sp!, {r2-r12, lr} 731.1Sskrll mov r12, r1 741.1Sskrll dsb /* Data Synchronisation Barrier */ 751.1Sskrll smc #0 /* Call firmware for all permissions */ 761.1Sskrll ldmfd sp!, {r2-r12, pc} 771.1SskrllEND(omap_smc) 781.1Sskrll 79