📄 asm.h
字号:
/*
* include/asm-mips/asm.h
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
* Copyright (C) 1995, 1996, 1997 by Ralf Baechle
*
* Some useful macros for MIPS assembler code
*
* Some of the routines below contain useless nops that will be optimized
* away by gas in -O mode. These nops are however required to fill delay
* slots in noreorder mode.
*/
#ifndef _ASM_H_
#define _ASM_H_
#define ASM_ONLY
/*
* Macros to handle different pointer/register sizes for 32/64-bit code
*
* 64 bit address space isn't used yet, so we may use the R3000 32 bit
* defines for now.
*/
#define PTRSIZE 4
#define PTRLOG 2
/* Philip modify, Mar 16,2004 */
/* #define ROM_512KB */
/*
#define ROM_64KB
#ifdef ROM_512K
#define DATA_START_ADDR 0x1fc7c000
#endif
#ifdef ROM_64KB
#define DATA_START_ADDR 0x1fc0c000
#endif
*/
#ifndef _TEXT_SECTION
#define _TEXT_SECTION .text
#endif
/*
* LEAF - declare leaf routine
*/
#define LEAF(name) \
_TEXT_SECTION; \
.globl name; \
.ent name; \
name:
/*
* NESTED - declare nested routine entry point
*/
#define NESTED(symbol, framesize, rpc) \
.globl symbol; \
.align 2; \
.type symbol,@function; \
.ent symbol,0; \
symbol: .frame sp, framesize, rpc
/*
* END - mark end of function
*/
#define END(function) \
.end function
/*// .size function,.-function
2004.08.25, philip modify "//".
*/
/*
* EXPORT - export definition of symbol
*/
#define EXPORT(symbol) \
.globl symbol; \
symbol:
/*
* ABS - export absolute symbol
*/
#define ABS(symbol,value) \
.globl symbol; \
symbol = value
#define PANIC(msg) \
.set push; \
.set reorder; \
la a0,8f; \
jal panic; \
9: b 9b; \
.set pop; \
TEXT(msg)
/*
* Print formated string
*/
#define PRINT(string) \
.set push; \
.set reorder; \
la a0,8f; \
jal printk; \
.set pop; \
TEXT(string)
#define TEXT(msg) \
.data; \
8: .asciiz msg; \
.previous;
/*
* Build text tables
*/
#define TTABLE(string) \
.text; \
.word 1f; \
.previous; \
.data; \
1: .asciz string; \
.previous
#endif /* __ASM_ASM_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -