⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 armv4.h

📁 epson usb2.0 控制芯片 S1R72V05 固件程序。
💻 H
字号:
/*
 *  The above copyright holder, limited to cases in which one satisfies
 *  conditions (1) ~ (4) below, or the conditions described in Version 2
 *  of of the GNU Public License officially announced by the Free Software
 *  Foundation, consents to the use, reproduction, alteration, and
 *  redistribution (hereafter called utilization) of this software (this
 *  software includes alterations, likewise below) without compensation.
 *
 *  (1) When this software is utilized in the form of source code, the
 *  above copyright declaration, these conditions of utilization, and the
 *  following stipulation of no guarantee shall be included in unchanged
 *  form inside the source code.
 *  (2) When this software is redistributed in a form in which it can be
 *  used in the development of other software, library form, etc., the above
 *  copyright display, these terms of utilization, and the following
 *  stipulation of no guarantee shall be inserted in documentation accompanying
 *  redistribution (user's manual, etc.).
 *  (3) When this software is redistributed in a form in which it cannot be used
 *  in the development of other software, embedded in devices, etc., one of the
 *  following conditions shall be satisfied.
 *		(a) The above copyright display, these terms of utilization, and the
 *		following stipulation of no guarantee shall be inserted in documentation
 *		accompanying redistribution (user's manual, etc.).
 *		(b) The TOPPERS Project shall be notified owing to a method in which the
 *		form of distribution is decided otherwise.
 *		(4) The above copyright holder and the TOPPERS Project shall be exempt
 *		from responsibility for whatever damages occur either directly or indirectly
 *		through the utilization of this software.
 *
 *	This software is something that is provided with no guarantee. The above copyright
 *  holder and the TOPPERS Project make no guarantee whatsoever in regard to this
 *  software, including the possibility of its application. In addition, the above
 *  copyright holder and the TOPPERS Project shall also not bear responsibility for
 *  whatever damages occur either directly or indirectly through the utilization of
 *  this software.
 *
 *  @(#) $Id: armv4.h,v 1.2 2006/07/21 09:49:59 9564907 Exp $
 */

/*
 * Definition for ARMv4
 */

#ifndef _ARMV4_H_
#define _ARMV4_H_

/*
 *  ARM Exception Vector
 */
#define SVC_Vector    0x00
#define UND_Vector    0x04
#define SWI_Vector    0x08
#define PRFA_Vector   0x0C
#define DATAA_Vector  0x10
#define IRQ_Vector    0x18
#define FIQ_Vector    0x1C


/*
 * ARM Exception Vector Number
 */
#define SVC_Number    0
#define UND_Number    1
#define SWI_Number    2
#define PRFA_Number   3
#define DATAA_Number  4
#define UNNOWN_Number 5
#define IRQ_Number    6
#define FIQ_Number    7

/*
 * Prohibition bit of CPSR interruption
 */
#define CPSR_INT_MASK 0xC0
#define CPSR_IRQ_BIT  0x80
#define CPSR_FIQ_BIT  0x40

/*
 * Mode bit of CPSR
 */
#define CPSR_MODE_MASK   0x1f
#define CPSR_USER        0x10
#define CPSR_FIQ         0x11
#define CPSR_IRQ         0x12
#define CPSR_SVC         0x13
#define CPSR_ABT         0x17
#define CPSR_SYS         0x1F


/*
 * Stub Call
 */
#ifndef _MACRO_ONLY
Inline void
stub_exit(void){
    Asm("swi 0xff");
}

Inline void
stub_putc(char c)
{
    Asm("mov r0,#0x0; mov r4,%0; swi 0x123456"
        :: "r"(c):"r0","r4");
}

Inline void
stub_write(const char *string)
{
    int pos = 0;

    while(string[pos] !=0)
        stub_putc(string[pos++]);
}

Inline void
stub_set_inh(INHNO inhno, FP inthdr)
{
    Asm("mov r0,#0x1; mov r4,%0; mov r5,%1; swi 0x123456"
        : /* no output */
        : "r"(inhno),"r"(inthdr)
        : "r0", "r4", "r5");

}

#endif /* _MACRO_ONLY */

#endif /* _ARMV4_H_ */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -