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 393

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
/* Variable keeping track of timer ticks */
37
extern unsigned long timer_ticks;
38
/* Enable tick timer and interrupt generation */
39
void enable_timer(void);
40
/* Disable tick timer and interrupt generation */
41
void disable_timer(void);
42
/* Timer increment - called by interrupt routine */
43
void timer_tick(void);
44
/* Reset tick counter */
45
void clear_timer_ticks(void);
46
/* Get tick counter */
47
unsigned long get_timer_ticks(void);
48
/* Wait for 10ms */
49
void wait_10ms(void);
50
 
51
#endif

powered by: WebSVN 2.1.0

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