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 742

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 489 julius
// Pull in interrupt defines here
5
#include "int.h"
6
 
7 349 julius
/* Register access macros */
8
#define REG8(add) *((volatile unsigned char *)(add))
9
#define REG16(add) *((volatile unsigned short *)(add))
10
#define REG32(add) *((volatile unsigned long *)(add))
11
 
12
/*
13
 * l.nop constants
14
 *
15
 */
16
#define NOP_NOP         0x0000      /* Normal nop instruction */
17
#define NOP_EXIT        0x0001      /* End of simulation */
18
#define NOP_REPORT      0x0002      /* Simple report */
19
#define NOP_PRINTF      0x0003      /* Simprintf instruction */
20
#define NOP_PUTC        0x0004      /* Simulation putc instruction */
21
#define NOP_REPORT_FIRST 0x0400     /* Report with number */
22
#define NOP_REPORT_LAST  0x03ff      /* Report with number */
23
 
24
/* For writing into SPR. */
25
void mtspr(unsigned long spr, unsigned long value);
26
 
27
/* For reading SPR. */
28
unsigned long mfspr(unsigned long spr);
29
 
30
/* Print out a character via simulator */
31
void sim_putc(unsigned char c);
32
 
33
/* Prints out a value */
34
void report(unsigned long value);
35
 
36
/* Loops/exits simulation */
37
void exit(int i);
38
 
39 408 julius
/* Enable user interrupts */
40
void cpu_enable_user_interrupts(void);
41
 
42 349 julius
/* Variable keeping track of timer ticks */
43
extern unsigned long timer_ticks;
44
/* Enable tick timer and interrupt generation */
45 411 julius
void cpu_enable_timer(void);
46 349 julius
/* Disable tick timer and interrupt generation */
47 411 julius
void cpu_disable_timer(void);
48 349 julius
/* Timer increment - called by interrupt routine */
49 411 julius
void cpu_timer_tick(void);
50 349 julius
/* Reset tick counter */
51 411 julius
void cpu_reset_timer_ticks(void);
52 349 julius
/* Get tick counter */
53 411 julius
unsigned long cpu_get_timer_ticks(void);
54 349 julius
/* Wait for 10ms */
55 411 julius
void cpu_sleep_10ms(void);
56 349 julius
 
57
#endif

powered by: WebSVN 2.1.0

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