OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [orpsocv2/] [sw/] [drivers/] [or1200/] [include/] [or1200-utils.h] - Blame information for rev 408

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 393 julius
#ifndef _OR1200_UTILS_H_
2
#define _OR1200_UTILS_H_
3 349 julius
 
4
/* Register access macros */
5
#define REG8(add) *((volatile unsigned char *)(add))
6
#define REG16(add) *((volatile unsigned short *)(add))
7
#define REG32(add) *((volatile unsigned long *)(add))
8
 
9
/*
10
 * l.nop constants
11
 *
12
 */
13
#define NOP_NOP         0x0000      /* Normal nop instruction */
14
#define NOP_EXIT        0x0001      /* End of simulation */
15
#define NOP_REPORT      0x0002      /* Simple report */
16
#define NOP_PRINTF      0x0003      /* Simprintf instruction */
17
#define NOP_PUTC        0x0004      /* Simulation putc instruction */
18
#define NOP_REPORT_FIRST 0x0400     /* Report with number */
19
#define NOP_REPORT_LAST  0x03ff      /* Report with number */
20
 
21
/* For writing into SPR. */
22
void mtspr(unsigned long spr, unsigned long value);
23
 
24
/* For reading SPR. */
25
unsigned long mfspr(unsigned long spr);
26
 
27
/* Print out a character via simulator */
28
void sim_putc(unsigned char c);
29
 
30
/* Prints out a value */
31
void report(unsigned long value);
32
 
33
/* Loops/exits simulation */
34
void exit(int i);
35
 
36 408 julius
/* Enable user interrupts */
37
void cpu_enable_user_interrupts(void);
38
 
39 349 julius
/* Variable keeping track of timer ticks */
40
extern unsigned long timer_ticks;
41
/* Enable tick timer and interrupt generation */
42
void enable_timer(void);
43
/* Disable tick timer and interrupt generation */
44
void disable_timer(void);
45
/* Timer increment - called by interrupt routine */
46
void timer_tick(void);
47
/* Reset tick counter */
48
void clear_timer_ticks(void);
49
/* Get tick counter */
50
unsigned long get_timer_ticks(void);
51
/* Wait for 10ms */
52
void wait_10ms(void);
53
 
54
#endif

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.