asmacros.h revision 87702
11558Srgrimes/*- 293492Sphk * Copyright (c) 2001 Jake Burkholder. 393492Sphk * All rights reserved. 493492Sphk * 51558Srgrimes * Redistribution and use in source and binary forms, with or without 693492Sphk * modification, are permitted provided that the following conditions 793492Sphk * are met: 893492Sphk * 1. Redistributions of source code must retain the above copyright 993492Sphk * notice, this list of conditions and the following disclaimer. 1093492Sphk * 2. Redistributions in binary form must reproduce the above copyright 111558Srgrimes * notice, this list of conditions and the following disclaimer in the 121558Srgrimes * documentation and/or other materials provided with the distribution. 131558Srgrimes * 141558Srgrimes * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 151558Srgrimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 161558Srgrimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 171558Srgrimes * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 181558Srgrimes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 1993492Sphk * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2093492Sphk * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2193492Sphk * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 221558Srgrimes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2393492Sphk * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 241558Srgrimes * SUCH DAMAGE. 251558Srgrimes * 2693492Sphk * $FreeBSD: head/sys/sparc64/include/asmacros.h 87702 2001-12-11 23:33:44Z jhb $ 271558Srgrimes */ 281558Srgrimes 291558Srgrimes#ifndef _MACHINE_ASMACROS_H_ 301558Srgrimes#define _MACHINE_ASMACROS_H_ 311558Srgrimes 321558Srgrimes#ifdef _KERNEL 331558Srgrimes 3493492Sphk .register %g2,#ignore 3593492Sphk .register %g3,#ignore 361558Srgrimes .register %g6,#ignore 371558Srgrimes .register %g7,#ignore 381558Srgrimes 391558Srgrimes#define PCPU(member) %g7 + PC_ ## member 4093492Sphk#define PCPU_ADDR(member, reg) add %g7, PC_ ## member, reg 4193492Sphk 4293492Sphk#define DEBUGGER() ta %xcc, 1 4393492Sphk 4493492Sphk#define PANIC(msg, reg) \ 4593492Sphk .sect .rodata ; \ 4693492Sphk9: .asciz msg ; \ 4793492Sphk .previous ; \ 4893492Sphk setx 9b, reg, %o0 ; \ 491558Srgrimes call panic ; \ 5093492Sphk nop 5193492Sphk 521558Srgrimes#endif 5393492Sphk 541558Srgrimes#define DATA(name) \ 5593492Sphk .data ; \ 5693492Sphk .globl name ; \ 5793492Sphk .type name, @object ; \ 5893492Sphkname ## : 5993492Sphk 6093492Sphk#define EMPTY 6193492Sphk 6293492Sphk#define ENTRY(name) \ 6393492Sphk .text ; \ 6493492Sphk .align 16 ; \ 6593492Sphk .globl name ; \ 6693492Sphk .type name, @function ; \ 671558Srgrimesname ## : 6893492Sphk 691558Srgrimes#define END(name) \ 7093492Sphk .size name, . - name 7193492Sphk 721558Srgrimes/* 7393492Sphk * If the kernel can be located above 4G, setx needs to be used to load 7493492Sphk * symbol values, otherwise set is sufficient. 7593492Sphk */ 7693492Sphk#ifdef HIGH_KERNEL 7793492Sphk#define SET(sym, tmp, dst) \ 7893492Sphk setx sym, tmp, dst 7993492Sphk#else 808871Srgrimes#define SET(sym, tmp, dst) \ 8193492Sphk set sym, dst 8293492Sphk#endif 8393492Sphk 8493492Sphk#endif /* !_MACHINE_ASMACROS_H_ */ 8593492Sphk