mips.h 1.44 KB
#ifndef __TV_rkmips_h_
#define __TV_rkmips_h_

/*
** RiscKernel machine dependent definitions for the mips R4000 series
** processors.
*/

#ifdef _LANGUAGE_ASSEMBLY

/*
** Arguments to system calls are in a0,a1,a2,a3,t0,t1,t2,t3.
*/
#define TVSYSCALL(name)		       \
	LEAF(name);		       \
	li	v0,__TV_TRAP_/**/name; \
	syscall;		       \
	j	ra;		       \
	END(name);

#define TVSYSCALL5(name)	       \
	LEAF(name);		       \
	li	v0,__TV_TRAP_/**/name; \
	lw	t0,0+4*4(sp);	       \
	syscall;		       \
	j	ra;		       \
	END(name);

#define TVSYSCALL6(name)	       \
	LEAF(name);		       \
	li	v0,__TV_TRAP_/**/name; \
	lw	t0,0+4*4(sp);	       \
	lw	t1,4+4*4(sp);	       \
	syscall;		       \
	j	ra;		       \
	END(name);

#define TVSYSCALL0(a) TVSYSCALL(a)
#define TVSYSCALL1(a) TVSYSCALL(a)
#define TVSYSCALL2(a) TVSYSCALL(a)
#define TVSYSCALL3(a) TVSYSCALL(a)
#define TVSYSCALL4(a) TVSYSCALL(a)

#endif

/************************************************************************/

/* Size of a page */
#define TV_PAGE_SIZE  4096
#define TV_PAGE_MASK  4095
#define TV_PAGE_SHIFT 12

/* Mapping restrictions for regions */
#define TV_REGION_GRANULARITY		4096
#define TV_REGION_ALIGNMENT		4096
#define TV_REGION_SHARED_ALIGNMENT	65536

/* Maximum size of an id set */
#define TV_MAX_SET_SIZE		200

/* Extra bit set of exception was in delay slot */
#define TV_EXC_IN_DELAY_SLOT		0x8000

/* Base for rk system calls */
#define __TV_TRAP_BASE	0

#endif /* __TV_rkmips_h_ */