1d8315c79SWarner Losh /*- 2*4d846d26SWarner Losh * SPDX-License-Identifier: BSD-2-Clause 3af3dc4a7SPedro F. Giffuni * 40da5fed4SIan Lepore * Copyright (c) 2012 Olivier Houchard <cognet@FreeBSD.org> 56fc729afSOlivier Houchard * All rights reserved. 66fc729afSOlivier Houchard * 76fc729afSOlivier Houchard * Redistribution and use in source and binary forms, with or without 86fc729afSOlivier Houchard * modification, are permitted provided that the following conditions 96fc729afSOlivier Houchard * are met: 106fc729afSOlivier Houchard * 1. Redistributions of source code must retain the above copyright 116fc729afSOlivier Houchard * notice, this list of conditions and the following disclaimer. 126fc729afSOlivier Houchard * 2. Redistributions in binary form must reproduce the above copyright 136fc729afSOlivier Houchard * notice, this list of conditions and the following disclaimer in the 146fc729afSOlivier Houchard * documentation and/or other materials provided with the distribution. 156fc729afSOlivier Houchard * 160da5fed4SIan Lepore * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 170da5fed4SIan Lepore * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 180da5fed4SIan Lepore * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 190da5fed4SIan Lepore * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 200da5fed4SIan Lepore * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 210da5fed4SIan Lepore * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 220da5fed4SIan Lepore * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 236fc729afSOlivier Houchard * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 246fc729afSOlivier Houchard * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 256fc729afSOlivier Houchard * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 266fc729afSOlivier Houchard * SUCH DAMAGE. 276fc729afSOlivier Houchard */ 286fc729afSOlivier Houchard 296fc729afSOlivier Houchard #ifndef _MACHINE_ASMACROS_H_ 306fc729afSOlivier Houchard #define _MACHINE_ASMACROS_H_ 316fc729afSOlivier Houchard 32cf1a573fSOleksandr Tymoshenko #include <machine/asm.h> 33cf1a573fSOleksandr Tymoshenko 346fc729afSOlivier Houchard #ifdef _KERNEL 356fc729afSOlivier Houchard 366fc729afSOlivier Houchard #ifdef LOCORE 376fc729afSOlivier Houchard 38cf1a573fSOleksandr Tymoshenko #define GET_CURTHREAD_PTR(tmp) \ 39646b9404SOlivier Houchard mrc p15, 0, tmp, c13, c0, 4 406fc729afSOlivier Houchard 415c8f95d5SAndrew Turner #define ELFNOTE(section, type, vendor, desctype, descdata...) \ 42881c1454SRoger Pau Monné .pushsection section, "a", %note ; \ 435c8f95d5SAndrew Turner .balign 4 ; \ 445c8f95d5SAndrew Turner .long 2f - 1f /* namesz */ ; \ 455c8f95d5SAndrew Turner .long 4f - 3f /* descsz */ ; \ 465c8f95d5SAndrew Turner .long type /* type */ ; \ 475c8f95d5SAndrew Turner 1: .asciz vendor /* vendor name */ ; \ 485c8f95d5SAndrew Turner 2: .balign 4 ; \ 495c8f95d5SAndrew Turner 3: desctype descdata /* node */ ; \ 505c8f95d5SAndrew Turner 4: .balign 4 ; \ 515c8f95d5SAndrew Turner .popsection 525c8f95d5SAndrew Turner 536fc729afSOlivier Houchard #endif /* LOCORE */ 546fc729afSOlivier Houchard 556fc729afSOlivier Houchard #endif /* _KERNEL */ 566fc729afSOlivier Houchard 576fc729afSOlivier Houchard #endif /* !_MACHINE_ASMACROS_H_ */ 58