-
-
Notifications
You must be signed in to change notification settings - Fork 93
/
common.h
34 lines (26 loc) · 1.01 KB
/
common.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#ifndef _COMMON_H_
typedef volatile unsigned int vu32;
typedef unsigned int u32;
typedef int s32;
typedef unsigned short u16;
typedef signed short s16;
typedef unsigned char u8;
#define mftb(rval) ({unsigned long u; do { \
asm volatile ("mftbu %0" : "=r" (u)); \
asm volatile ("mftb %0" : "=r" ((rval)->l)); \
asm volatile ("mftbu %0" : "=r" ((rval)->u)); \
} while(u != ((rval)->u)); })
typedef struct {
unsigned long l, u;
} tb_t;
#define TB_CLOCK 40500000
void do_read(void* dst, u32 len, u32 offset, u32 sector);
void device_frag_read(void* dst, u32 len, u32 offset);
void dcache_flush_icache_inv(void* dst, u32 len);
int ADPdecodebuffer(unsigned char *input, short *outl, short * outr, long *histl1, long *histl2, long *histr1, long *histr2);
void StreamStartStream(u32 CurrentStart, u32 CurrentSize);
void StreamEndStream(void);
u32 process_queue(void* dst, u32 len, u32 offset, int readComplete);
unsigned long tb_diff_usec(tb_t* end, tb_t* start);
int usb_sendbuffer_safe(const void *buffer,int size);
#endif