[BACK]Return to cpuvar.h CVS log [TXT][DIR] Up to [local] / funnyos / dev

File: [local] / funnyos / dev / cpuvar.h (download)

Revision 1.2, Sun Nov 4 22:47:16 2007 UTC (16 years, 6 months ago) by init
Branch: MAIN
Changes since 1.1: +6 -1 lines

add __cpu_disable_irq and __cpu_enable_irq macross for clear/set the I bit in CPSR

/*
 * $Id: cpuvar.h,v 1.2 2007/11/04 22:47:16 init Exp $
 */
#ifndef _DEV_CPUVAR_H
#define _DEV_CPUVAR_H

/* Interrupt enable/disable */
/* XXX should move somewhere else */
#define __cpu_enable_irq() do { __asm __volatile("mrs r0, cpsr\nbic r0, r0, #0x80\nmsr cpsr, r0"); } while(0);
#define __cpu_disable_irq() do { __asm __volatile("mrs r0, cpsr\norr r0, r0, #0x80\nmsr cpsr, r0"); } while(0);

/*
 * CPU capabilities.
 */
/* TODO when CPU identification will work */
#define CPU_HAVE_ICACHE 	0x00000001
#define CPU_HAVE_DCACHE 	0x00000002
#define CPU_HAVE_MMU 		0x00000004


struct cpu_dd {
	uint32_t 	cpu_freq;
	char 		*cpu_name;
	uint32_t 	cpu_flags;
};

#endif /* _DEV_CPUVAR_H */