File tree 19 files changed +16
-93
lines changed
19 files changed +16
-93
lines changed Original file line number Diff line number Diff line change 8
8
# define ATTRIBUTE_PACKED __attribute__((packed))
9
9
#endif
10
10
11
+ #define _SHIFTL (v , s , w ) \
12
+ ((u32) (((u32)(v) & ((0x01 << (w)) - 1)) << (s))) //mask the first w bits of v before lshifting
13
+ #define _SHIFTR (v , s , w ) \
14
+ ((u32)(((u32)(v) >> (s)) & ((0x01 << (w)) - 1))) //rshift v and mask the first w bits afterwards
15
+
16
+ #define _ROTL (v ,s ) \
17
+ (((u32)v<<s)|((u32)v>>(0x20-s)))
18
+
11
19
#endif /* _GCUTIL_H */
12
20
Original file line number Diff line number Diff line change 7
7
8
8
#include "geckousb.h"
9
9
10
- #define _SHIFTL (v , s , w ) \
11
- ((u32) (((u32)(v) & ((0x01 << (w)) - 1)) << (s)))
12
- #define _SHIFTR (v , s , w ) \
13
- ((u32)(((u32)(v) >> (s)) & ((0x01 << (w)) - 1)))
14
-
15
10
static struct dbginterface usb_device ;
16
11
17
12
static __inline__ int __send_command (s32 chn ,u16 * cmd )
Original file line number Diff line number Diff line change 1
1
#include <stdlib.h>
2
2
#include <stdio.h>
3
3
#include <string.h>
4
+ #include "gcutil.h"
4
5
#include "asm.h"
5
6
#include "processor.h"
6
7
#include "exi.h"
@@ -187,10 +188,6 @@ struct bba_descr {
187
188
u32 X (X (next_packet_ptr :12 , packet_len :12 ), status :8 );
188
189
};
189
190
190
- #define _SHIFTL (v , s , w ) \
191
- ((u32) (((u32)(v) & ((0x01 << (w)) - 1)) << (s)))
192
- #define _SHIFTR (v , s , w ) \
193
- ((u32)(((u32)(v) >> (s)) & ((0x01 << (w)) - 1)))
194
191
195
192
/* new functions */
196
193
#define bba_select () EXI_Select(EXI_CHANNEL_0,EXI_DEVICE_2,EXI_SPEED32MHZ)
Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ distribution.
31
31
#include <stdlib.h>
32
32
#include <string.h>
33
33
#include <stdio.h>
34
+ #include "gcutil.h"
34
35
#include "asm.h"
35
36
#include "processor.h"
36
37
#include "aram.h"
@@ -54,11 +55,6 @@ distribution.
54
55
55
56
#define AR_ARAMEXPANSION 2
56
57
57
- #define _SHIFTL (v , s , w ) \
58
- ((u32) (((u32)(v) & ((0x01 << (w)) - 1)) << (s)))
59
- #define _SHIFTR (v , s , w ) \
60
- ((u32)(((u32)(v) >> (s)) & ((0x01 << (w)) - 1)))
61
-
62
58
static vu16 * const _dspReg = (u16 * )0xCC005000 ;
63
59
64
60
static ARCallback __ARDmaCallback = NULL ;
Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ distribution.
30
30
31
31
32
32
#include <stdlib.h>
33
+ #include "gcutil.h"
33
34
#include "asm.h"
34
35
#include "processor.h"
35
36
#include "irq.h"
@@ -65,12 +66,6 @@ distribution.
65
66
#define AI_SCRESET 0x20
66
67
#define AI_DMAFR 0x40
67
68
68
-
69
- #define _SHIFTL (v , s , w ) \
70
- ((u32) (((u32)(v) & ((0x01 << (w)) - 1)) << (s))) //mask the first w bits of v before lshifting
71
- #define _SHIFTR (v , s , w ) \
72
- ((u32)(((u32)(v) >> (s)) & ((0x01 << (w)) - 1))) //rshift v and mask the first w bits afterwards
73
-
74
69
#if defined(HW_DOL )
75
70
static vu32 * const _aiReg = (u32 * )0xCC006C00 ;
76
71
#elif defined(HW_RVL )
Original file line number Diff line number Diff line change @@ -28,15 +28,11 @@ distribution.
28
28
-------------------------------------------------------------*/
29
29
30
30
31
- #include <asm.h>
32
- #include <processor.h>
31
+ #include "gcutil.h"
32
+ #include "asm.h"
33
+ #include "processor.h"
33
34
#include "cache.h"
34
35
35
- #define _SHIFTL (v , s , w ) \
36
- ((u32) (((u32)(v) & ((0x01 << (w)) - 1)) << (s)))
37
- #define _SHIFTR (v , s , w ) \
38
- ((u32)(((u32)(v) >> (s)) & ((0x01 << (w)) - 1)))
39
-
40
36
extern void __LCEnable (void );
41
37
extern void L2GlobalInvalidate (void );
42
38
extern void L2Enable (void );
Original file line number Diff line number Diff line change @@ -52,13 +52,6 @@ distribution.
52
52
#define CARD_SYSBAT 0x6000
53
53
#define CARD_SYSBAT_BACK 0x8000
54
54
55
- #define _SHIFTL (v , s , w ) \
56
- ((u32) (((u32)(v) & ((0x01 << (w)) - 1)) << (s)))
57
- #define _SHIFTR (v , s , w ) \
58
- ((u32)(((u32)(v) >> (s)) & ((0x01 << (w)) - 1)))
59
- #define _ROTL (v ,s ) \
60
- (((u32)v<<s)|((u32)v>>(0x20-s)))
61
-
62
55
#define CARD_STATUS_UNLOCKED 0x40
63
56
64
57
struct card_header {
Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ distribution.
31
31
32
32
#include <stdlib.h>
33
33
#include <stdio.h>
34
+ #include "gcutil.h"
34
35
#include "asm.h"
35
36
#include "processor.h"
36
37
#include "irq.h"
@@ -51,10 +52,6 @@ distribution.
51
52
#define DSPCR_PIINT 0x0002 // assert DSP PI interrupt
52
53
#define DSPCR_RES 0x0001 // reset DSP
53
54
54
- #define _SHIFTL (v , s , w ) \
55
- ((u32) (((u32)(v) & ((0x01 << (w)) - 1)) << (s)))
56
- #define _SHIFTR (v , s , w ) \
57
- ((u32)(((u32)(v) >> (s)) & ((0x01 << (w)) - 1)))
58
55
59
56
static u32 __dsp_inited = FALSE;
60
57
static u32 __dsp_rudetask_pend = FALSE;
Original file line number Diff line number Diff line change @@ -131,11 +131,6 @@ distribution.
131
131
#define cpu_to_le32 (x ) (((x>>24)&0x000000ff) | ((x>>8)&0x0000ff00) | ((x<<8)&0x00ff0000) | ((x<<24)&0xff000000))
132
132
#define dvd_may_retry (s ) (DVD_STATUS(s) == DVD_STATUS_READY || DVD_STATUS(s) == DVD_STATUS_DISK_ID_NOT_READ)
133
133
134
- #define _SHIFTL (v , s , w ) \
135
- ((u32) (((u32)(v) & ((0x01 << (w)) - 1)) << (s)))
136
- #define _SHIFTR (v , s , w ) \
137
- ((u32)(((u32)(v) >> (s)) & ((0x01 << (w)) - 1)))
138
-
139
134
typedef void (* dvdcallbacklow )(s32 );
140
135
typedef void (* dvdstatecb )(dvdcmdblk * );
141
136
Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ distribution.
36
36
#include "processor.h"
37
37
#include "spinlock.h"
38
38
#include "exi.h"
39
+ #include "gcutil.h"
39
40
40
41
//#define _EXI_DEBUG
41
42
@@ -53,11 +54,6 @@ distribution.
53
54
#define EXI_EXT_IRQ 0x0800
54
55
#define EXI_EXT_BIT 0x1000
55
56
56
- #define _SHIFTL (v , s , w ) \
57
- ((u32) (((u32)(v) & ((0x01 << (w)) - 1)) << (s)))
58
- #define _SHIFTR (v , s , w ) \
59
- ((u32)(((u32)(v) >> (s)) & ((0x01 << (w)) - 1)))
60
-
61
57
62
58
struct _lck_dev {
63
59
lwp_node node ;
Original file line number Diff line number Diff line change 25
25
#define LARGE_NUMBER (-1.0e+18f)
26
26
#endif
27
27
28
- #define _SHIFTL (v , s , w ) \
29
- ((u32) (((u32)(v) & ((0x01 << (w)) - 1)) << (s)))
30
- #define _SHIFTR (v , s , w ) \
31
- ((u32)(((u32)(v) >> (s)) & ((0x01 << (w)) - 1)))
32
-
33
28
#define GX_LOAD_BP_REG (x ) \
34
29
do { \
35
30
wgPipe->U8 = 0x61; \
Original file line number Diff line number Diff line change @@ -43,11 +43,6 @@ distribution.
43
43
#define CPU_STACK_ALIGNMENT 8
44
44
#define CPU_MINIMUM_STACK_FRAME_SIZE 16
45
45
46
- #define _SHIFTL (v , s , w ) \
47
- ((u32) (((u32)(v) & ((0x01 << (w)) - 1)) << (s)))
48
- #define _SHIFTR (v , s , w ) \
49
- ((u32)(((u32)(v) >> (s)) & ((0x01 << (w)) - 1)))
50
-
51
46
struct irq_handler_s {
52
47
raw_irq_handler_t pHndl ;
53
48
void * pCtx ;
Original file line number Diff line number Diff line change 14
14
15
15
#define PAD_PRODPADS 6
16
16
17
- #define _SHIFTL (v , s , w ) \
18
- ((u32) (((u32)(v) & ((0x01 << (w)) - 1)) << (s)))
19
- #define _SHIFTR (v , s , w ) \
20
- ((u32)(((u32)(v) >> (s)) & ((0x01 << (w)) - 1)))
21
-
22
17
#define PAD_ENABLEDMASK (chan ) (0x80000000>>chan);
23
18
24
19
typedef struct _keyinput {
Original file line number Diff line number Diff line change 41
41
#define CARDIO_OP_IOERR_ILL 0x0001
42
42
#define CARDIO_OP_IOERR_FATAL (CARDIO_OP_IOERR_PARAM|CARDIO_OP_IOERR_WRITE|CARDIO_OP_IOERR_ADDR|CARDIO_OP_IOERR_CRC|CARDIO_OP_IOERR_ILL)
43
43
44
- #define _SHIFTL (v , s , w ) \
45
- ((u32) (((u32)(v) & ((0x01 << (w)) - 1)) << (s)))
46
- #define _SHIFTR (v , s , w ) \
47
- ((u32)(((u32)(v) >> (s)) & ((0x01 << (w)) - 1)))
48
-
49
44
typedef s32 (* cardiocallback )(s32 drv_no );
50
45
51
46
u8 g_CID [MAX_DRIVE ][16 ];
Original file line number Diff line number Diff line change 13
13
14
14
//#define _SI_DEBUG
15
15
16
- #define _SHIFTL (v , s , w ) \
17
- ((u32) (((u32)(v) & ((0x01 << (w)) - 1)) << (s)))
18
- #define _SHIFTR (v , s , w ) \
19
- ((u32)(((u32)(v) >> (s)) & ((0x01 << (w)) - 1)))
20
-
21
16
#define SISR_ERRORMASK (chn ) (0x0f000000>>((chn)<<3))
22
17
#define SIPOLL_ENABLE (chn ) (0x80000000>>((chn)+24))
23
18
Original file line number Diff line number Diff line change @@ -85,10 +85,6 @@ distribution.
85
85
return NULL; \
86
86
}
87
87
88
- #define _SHIFTL (v , s , w ) \
89
- ((u32) (((u32)(v) & ((0x01 << (w)) - 1)) << (s)))
90
- #define _SHIFTR (v , s , w ) \
91
- ((u32)(((u32)(v) >> (s)) & ((0x01 << (w)) - 1)))
92
88
93
89
struct _sramcntrl {
94
90
u8 srambuf [64 ];
Original file line number Diff line number Diff line change 9
9
10
10
#include "usbgecko.h"
11
11
12
- #define _SHIFTL (v , s , w ) \
13
- ((u32) (((u32)(v) & ((0x01 << (w)) - 1)) << (s)))
14
- #define _SHIFTR (v , s , w ) \
15
- ((u32)(((u32)(v) >> (s)) & ((0x01 << (w)) - 1)))
16
-
17
-
18
12
static u32 usbgecko_inited = 0 ;
19
13
static lwpq_t wait_exi_queue [3 ];
20
14
Original file line number Diff line number Diff line change @@ -50,11 +50,6 @@ video.c -- VIDEO subsystem
50
50
51
51
#define VIDEO_MQ 1
52
52
53
- #define _SHIFTL (v , s , w ) \
54
- ((u32) (((u32)(v) & ((0x01 << (w)) - 1)) << (s)))
55
- #define _SHIFTR (v , s , w ) \
56
- ((u32)(((u32)(v) >> (s)) & ((0x01 << (w)) - 1)))
57
-
58
53
#define VI_REGCHANGE (_reg ) \
59
54
((u64)0x01<<(63-_reg))
60
55
Original file line number Diff line number Diff line change @@ -177,11 +177,6 @@ struct bba_descr {
177
177
u32 X (X (next_packet_ptr :12 , packet_len :12 ), status :8 );
178
178
};
179
179
180
- #define _SHIFTL (v , s , w ) \
181
- ((u32) (((u32)(v) & ((0x01 << (w)) - 1)) << (s)))
182
- #define _SHIFTR (v , s , w ) \
183
- ((u32)(((u32)(v) >> (s)) & ((0x01 << (w)) - 1)))
184
-
185
180
186
181
struct bba_priv {
187
182
u8 flag ;
You can’t perform that action at this time.
0 commit comments