Skip to content

Commit 6556c10

Browse files
committed
cleanup: make asm block declarations consistent
1 parent 031b827 commit 6556c10

29 files changed

Lines changed: 84 additions & 84 deletions

File tree

common/sbus/src/ps2_sbus.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ static u32 _get_reg(u32 *reg)
2626

2727
#ifdef _EE
2828
// EE needs 20 NOPs!
29-
__asm__ volatile("nop\nnop\nnop\nnop\nnop\nnop\nnop\nnop\nnop\nnop\nnop\nnop\nnop\nnop\nnop\nnop\nnop\nnop\nnop\nnop\n");
29+
__asm__ __volatile__("nop\nnop\nnop\nnop\nnop\nnop\nnop\nnop\nnop\nnop\nnop\nnop\nnop\nnop\nnop\nnop\nnop\nnop\nnop\nnop\n");
3030
#endif
3131

3232
v2 = *(vu32 *)reg;

ee/debug/src/screenshot.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ int ps2_screenshot( void *pDest, unsigned int VramAdress, unsigned int x,
250250
*PS2SS_D1_MADR = (u32)p_dma32;
251251
*PS2SS_D1_CHCR = 0x101;
252252

253-
asm __volatile__("sync.l\n");
253+
__asm__ __volatile__("sync.l\n");
254254

255255
// check if DMA is complete (STR=0)
256256

@@ -272,13 +272,13 @@ int ps2_screenshot( void *pDest, unsigned int VramAdress, unsigned int x,
272272
*PS2SS_D1_MADR = (u32)pDest;
273273
*PS2SS_D1_CHCR = 0x100;
274274

275-
asm __volatile__(" sync.l\n");
275+
__asm__ __volatile__(" sync.l\n");
276276

277277
// check if DMA is complete (STR=0)
278278

279279
while ( *PS2SS_D1_CHCR & 0x0100 );
280280
*PS2SS_D1_CHCR = prev_chcr;
281-
asm __volatile__(" sync.l\n");
281+
__asm__ __volatile__(" sync.l\n");
282282
*PS2SS_VIF1_STAT = 0;
283283
*PS2SS_GS_BUSDIR = (u64)0;
284284

ee/dma/src/dma.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ void dma_channel_fast_waits(int channel)
115115
void dma_wait_fast(void)
116116
{
117117

118-
asm volatile (
118+
__asm__ __volatile__ (
119119
"sync.l; sync.p;" \
120120
"0:" \
121121
"bc0t 0f; nop;" \

ee/elf-loader/src/elf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ MEMORY {
4242
static void wipe_bramMem(void) {
4343
int i;
4444
for (i = 0x00084000; i < 0x100000; i += 64) {
45-
asm volatile(
45+
__asm__ __volatile__(
4646
"\tsq $0, 0(%0) \n"
4747
"\tsq $0, 16(%0) \n"
4848
"\tsq $0, 32(%0) \n"

ee/elf-loader/src/loader/src/loader.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ static void wipeUserMem(void)
6262
{
6363
int i;
6464
for (i = 0x100000; i < GetMemorySize(); i += 64) {
65-
asm volatile(
65+
__asm__ __volatile__(
6666
"\tsq $0, 0(%0) \n"
6767
"\tsq $0, 16(%0) \n"
6868
"\tsq $0, 32(%0) \n"

ee/graph/src/graph_mode.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ static inline int __udelay(unsigned int usecs)
9494

9595
}
9696

97-
asm volatile (
97+
__asm__ __volatile__ (
9898
".set push\n\t"
9999
".set noreorder\n\t"
100100
"0:\n\t"
@@ -141,7 +141,7 @@ int graph_set_mode(int interlace, int mode, int ffmd, int flicker_filter)
141141
GsPutIMR(0x00007700);
142142

143143
// Ensure registers are written prior to setting another mode.
144-
asm volatile ("sync.p\n\t"
144+
__asm__ __volatile__ ("sync.p\n\t"
145145
"nop\n\t");
146146

147147
// If 576P is requested, check if bios supports it.
@@ -376,7 +376,7 @@ void graph_set_smode1(char cmod, char gcont)
376376
// Disable PRST for TV modes and enable for all other modes.
377377
*GS_REG_SMODE1 = smode1_val | (u64)1 << 16;
378378

379-
asm volatile ("sync.l; sync.p;");
379+
__asm__ __volatile__ ("sync.l; sync.p;");
380380

381381
// If VESA, 1080I, or 720P, disable bit PRST now and delay 2.5ms.
382382
if ((graph_crtmode >= 0x1A) && (graph_crtmode != 0x50) && (graph_crtmode != 0x53))
@@ -393,7 +393,7 @@ void graph_set_smode1(char cmod, char gcont)
393393
// Now enable read circuits.
394394
*GS_REG_PMODE = pmode_val;
395395

396-
asm volatile ("sync.l; sync.p;");
396+
__asm__ __volatile__ ("sync.l; sync.p;");
397397

398398
}
399399

ee/kernel/include/kernel.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@
2525
#define EI EIntr
2626

2727
// Workaround for EE kernel bug: call this immediately before returning from any interrupt handler.
28-
#define ExitHandler() asm volatile("sync\nei\n")
28+
#define ExitHandler() __asm__ __volatile__("sync\nei\n")
2929

3030
// note: 'sync' is the same as 'sync.l'
31-
#define EE_SYNC() __asm__ volatile("sync")
32-
#define EE_SYNCL() __asm__ volatile("sync.l")
33-
#define EE_SYNCP() __asm__ volatile("sync.p")
31+
#define EE_SYNC() __asm__ __volatile__("sync")
32+
#define EE_SYNCL() __asm__ __volatile__("sync.l")
33+
#define EE_SYNCP() __asm__ __volatile__("sync.p")
3434

3535
#define UNCACHED_SEG(x) \
3636
((void *)(((u32)(x)) | 0x20000000))
@@ -143,15 +143,15 @@ static inline void nopdelay(void)
143143
int i = 0xfffff;
144144

145145
do {
146-
__asm__("nop\nnop\nnop\nnop\nnop\n");
146+
__asm__ __volatile__("nop\nnop\nnop\nnop\nnop\n");
147147
} while (i-- != -1);
148148
}
149149

150150
static inline int ee_get_opmode(void)
151151
{
152152
u32 status;
153153

154-
__asm__ volatile(
154+
__asm__ __volatile__(
155155
".set\tpush\n\t"
156156
".set\tnoreorder\n\t"
157157
"mfc0\t%0, $12\n\t"
@@ -165,7 +165,7 @@ static inline int ee_set_opmode(u32 opmode)
165165
{
166166
u32 status, mask;
167167

168-
__asm__ volatile(
168+
__asm__ __volatile__(
169169
".set\tpush\n\t"
170170
".set\tnoreorder\n\t"
171171
"mfc0\t%0, $12\n\t"
@@ -185,7 +185,7 @@ static inline int ee_kmode_enter()
185185
{
186186
u32 status, mask;
187187

188-
__asm__ volatile(
188+
__asm__ __volatile__(
189189
".set\tpush\n\t"
190190
".set\tnoreorder\n\t"
191191
"mfc0\t%0, $12\n\t"
@@ -203,7 +203,7 @@ static inline int ee_kmode_exit()
203203
{
204204
int status;
205205

206-
__asm__ volatile(
206+
__asm__ __volatile__(
207207
".set\tpush\n\t"
208208
".set\tnoreorder\n\t"
209209
"mfc0\t%0, $12\n\t"

ee/kernel/src/glue.c

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,19 @@ int DIntr()
2020
{
2121
int eie, res;
2222

23-
asm volatile("mfc0\t%0, $12"
23+
__asm__ __volatile__("mfc0\t%0, $12"
2424
: "=r"(eie));
2525
eie &= 0x10000;
2626
res = eie != 0;
2727

2828
if (!eie)
2929
return 0;
3030

31-
asm(".p2align 3");
31+
__asm__ (".p2align 3");
3232
do {
33-
asm volatile("di");
34-
asm volatile("sync.p");
35-
asm volatile("mfc0\t%0, $12"
33+
__asm__ __volatile__("di");
34+
__asm__ __volatile__("sync.p");
35+
__asm__ __volatile__("mfc0\t%0, $12"
3636
: "=r"(eie));
3737
eie &= 0x10000;
3838
} while (eie);
@@ -46,10 +46,10 @@ int EIntr()
4646
{
4747
int eie;
4848

49-
asm volatile("mfc0\t%0, $12"
49+
__asm__ __volatile__("mfc0\t%0, $12"
5050
: "=r"(eie));
5151
eie &= 0x10000;
52-
asm volatile("ei");
52+
__asm__ __volatile__("ei");
5353

5454
return eie != 0;
5555
}
@@ -60,7 +60,7 @@ int EnableIntc(int intc)
6060
{
6161
int eie, res;
6262

63-
asm volatile("mfc0\t%0, $12"
63+
__asm__ __volatile__("mfc0\t%0, $12"
6464
: "=r"(eie));
6565
eie &= 0x10000;
6666

@@ -82,7 +82,7 @@ int DisableIntc(int intc)
8282
{
8383
int eie, res;
8484

85-
asm volatile("mfc0\t%0, $12"
85+
__asm__ __volatile__("mfc0\t%0, $12"
8686
: "=r"(eie));
8787
eie &= 0x10000;
8888

@@ -104,7 +104,7 @@ int EnableDmac(int dmac)
104104
{
105105
int eie, res;
106106

107-
asm volatile("mfc0\t%0, $12"
107+
__asm__ __volatile__("mfc0\t%0, $12"
108108
: "=r"(eie));
109109
eie &= 0x10000;
110110

@@ -126,7 +126,7 @@ int DisableDmac(int dmac)
126126
{
127127
int eie, res;
128128

129-
asm volatile("mfc0\t%0, $12"
129+
__asm__ __volatile__("mfc0\t%0, $12"
130130
: "=r"(eie));
131131
eie &= 0x10000;
132132

@@ -148,7 +148,7 @@ int SetAlarm(u16 time, void (*callback)(s32 alarm_id, u16 time, void *common), v
148148
{
149149
int eie, res;
150150

151-
asm volatile("mfc0\t%0, $12"
151+
__asm__ __volatile__("mfc0\t%0, $12"
152152
: "=r"(eie));
153153
eie &= 0x10000;
154154

@@ -170,7 +170,7 @@ int ReleaseAlarm(int alarm_id)
170170
{
171171
int eie, res;
172172

173-
asm volatile("mfc0\t%0, $12"
173+
__asm__ __volatile__("mfc0\t%0, $12"
174174
: "=r"(eie));
175175
eie &= 0x10000;
176176

@@ -252,7 +252,7 @@ void SyncDCache(void *start, void *end)
252252
{
253253
int eie;
254254

255-
asm volatile("mfc0\t%0, $12"
255+
__asm__ __volatile__("mfc0\t%0, $12"
256256
: "=r"(eie));
257257
eie &= 0x10000;
258258

@@ -278,7 +278,7 @@ void InvalidDCache(void *start, void *end)
278278
{
279279
int eie;
280280

281-
asm volatile("mfc0\t%0, $12"
281+
__asm__ __volatile__("mfc0\t%0, $12"
282282
: "=r"(eie));
283283
eie &= 0x10000;
284284

ee/kernel/src/timer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -956,7 +956,7 @@ u32 cpu_ticks(void)
956956
{
957957
u32 out;
958958

959-
asm("mfc0\t%0, $9\n"
959+
__asm__ __volatile__("mfc0\t%0, $9\n"
960960
: "=r"(out));
961961
return out;
962962
}

ee/kernel/src/tlbfunc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ static int InitTLB32MB(void)
149149

150150
kprintf("# TLB spad=0 kernel=1:%d default=%d:%d extended=%d:%d\n", TLBInfo.NumKernelTLBEntries - 1, TLBInfo.NumKernelTLBEntries, TLBInfo.NumKernelTLBEntries + TLBInfo.NumDefaultTLBEntries - 1, TLBInfo.NumKernelTLBEntries + TLBInfo.NumDefaultTLBEntries, TLBInfo.NumKernelTLBEntries + TLBInfo.NumDefaultTLBEntries + TLBInfo.NumExtendedTLBEntries - 1);
151151

152-
__asm volatile("mtc0 $zero, $6\n"
152+
__asm__ __volatile__("mtc0 $zero, $6\n"
153153
"sync.p\n");
154154

155155
if (TLBInfo.NumKernelTLBEntries >= 0x31) {
@@ -171,7 +171,7 @@ static int InitTLB32MB(void)
171171
}
172172

173173
TLBInfo.NumWiredEntries = NumTlbEntries = i;
174-
__asm volatile("mtc0 %0, $6\n"
174+
__asm__ __volatile__("mtc0 %0, $6\n"
175175
"sync.p\n" ::"r"(NumTlbEntries));
176176

177177
if (TLBInfo.NumExtendedTLBEntries > 0) {

0 commit comments

Comments
 (0)