forked from PAWPAW-Mirror/lib_xua
All inline asm in decouple now marked volatile
This commit is contained in:
@@ -176,7 +176,7 @@ __builtin_unreachable();
|
|||||||
int mult;
|
int mult;
|
||||||
int h;
|
int h;
|
||||||
unsigned l;
|
unsigned l;
|
||||||
asm("ldw %0, %1[%2]":"=r"(mult):"r"(p_multIn),"r"(i));
|
asm volatile("ldw %0, %1[%2]":"=r"(mult):"r"(p_multIn),"r"(i));
|
||||||
{h, l} = macs(mult, sample, 0, 0);
|
{h, l} = macs(mult, sample, 0, 0);
|
||||||
sample = h << 3;
|
sample = h << 3;
|
||||||
|
|
||||||
@@ -207,7 +207,7 @@ __builtin_unreachable();
|
|||||||
int mult;
|
int mult;
|
||||||
int h;
|
int h;
|
||||||
unsigned l;
|
unsigned l;
|
||||||
asm("ldw %0, %1[%2]":"=r"(mult):"r"(p_multIn),"r"(i));
|
asm volatile("ldw %0, %1[%2]":"=r"(mult):"r"(p_multIn),"r"(i));
|
||||||
{h, l} = macs(mult, sample, 0, 0);
|
{h, l} = macs(mult, sample, 0, 0);
|
||||||
sample = h << 3;
|
sample = h << 3;
|
||||||
#if (STREAM_FORMAT_INPUT_RESOLUTION_32BIT_USED == 1)
|
#if (STREAM_FORMAT_INPUT_RESOLUTION_32BIT_USED == 1)
|
||||||
@@ -240,7 +240,7 @@ __builtin_unreachable();
|
|||||||
int mult;
|
int mult;
|
||||||
int h;
|
int h;
|
||||||
unsigned l;
|
unsigned l;
|
||||||
asm("ldw %0, %1[%2]":"=r"(mult):"r"(p_multIn),"r"(i));
|
asm volatile("ldw %0, %1[%2]":"=r"(mult):"r"(p_multIn),"r"(i));
|
||||||
{h, l} = macs(mult, sample, 0, 0);
|
{h, l} = macs(mult, sample, 0, 0);
|
||||||
sample = h << 3;
|
sample = h << 3;
|
||||||
#endif
|
#endif
|
||||||
@@ -343,7 +343,7 @@ __builtin_unreachable();
|
|||||||
sample <<= 16;
|
sample <<= 16;
|
||||||
|
|
||||||
#if (OUTPUT_VOLUME_CONTROL == 1) && !defined(OUT_VOLUME_IN_MIXER)
|
#if (OUTPUT_VOLUME_CONTROL == 1) && !defined(OUT_VOLUME_IN_MIXER)
|
||||||
asm("ldw %0, %1[%2]":"=r"(mult):"r"(p_multOut),"r"(i));
|
asm volatile("ldw %0, %1[%2]":"=r"(mult):"r"(p_multOut),"r"(i));
|
||||||
{h, l} = macs(mult, sample, 0, 0);
|
{h, l} = macs(mult, sample, 0, 0);
|
||||||
/* Note, in 2 byte subslot mode - ignore lower result of macs */
|
/* Note, in 2 byte subslot mode - ignore lower result of macs */
|
||||||
h <<= 3;
|
h <<= 3;
|
||||||
@@ -371,7 +371,7 @@ __builtin_unreachable();
|
|||||||
g_aud_from_host_rdptr+=4;
|
g_aud_from_host_rdptr+=4;
|
||||||
|
|
||||||
#if (OUTPUT_VOLUME_CONTROL == 1) && !defined(OUT_VOLUME_IN_MIXER)
|
#if (OUTPUT_VOLUME_CONTROL == 1) && !defined(OUT_VOLUME_IN_MIXER)
|
||||||
asm("ldw %0, %1[%2]":"=r"(mult):"r"(p_multOut),"r"(i));
|
asm volatile("ldw %0, %1[%2]":"=r"(mult):"r"(p_multOut),"r"(i));
|
||||||
{h, l} = macs(mult, sample, 0, 0);
|
{h, l} = macs(mult, sample, 0, 0);
|
||||||
h <<= 3;
|
h <<= 3;
|
||||||
#if (STREAM_FORMAT_OUTPUT_RESOLUTION_32BIT_USED == 1)
|
#if (STREAM_FORMAT_OUTPUT_RESOLUTION_32BIT_USED == 1)
|
||||||
@@ -426,7 +426,7 @@ __builtin_unreachable();
|
|||||||
unpackState++;
|
unpackState++;
|
||||||
|
|
||||||
#if (OUTPUT_VOLUME_CONTROL == 1) && !defined(OUT_VOLUME_IN_MIXER)
|
#if (OUTPUT_VOLUME_CONTROL == 1) && !defined(OUT_VOLUME_IN_MIXER)
|
||||||
asm("ldw %0, %1[%2]":"=r"(mult):"r"(p_multOut),"r"(i));
|
asm volatile("ldw %0, %1[%2]":"=r"(mult):"r"(p_multOut),"r"(i));
|
||||||
{h, l} = macs(mult, sample, 0, 0);
|
{h, l} = macs(mult, sample, 0, 0);
|
||||||
h <<= 3;
|
h <<= 3;
|
||||||
outuint(c_mix_out, h);
|
outuint(c_mix_out, h);
|
||||||
@@ -476,7 +476,7 @@ __builtin_unreachable();
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Get feedback val - ideally this would be syncronised */
|
/* Get feedback val - ideally this would be syncronised */
|
||||||
asm("ldw %0, dp[g_speed]" : "=r" (speed) :);
|
asm volatile("ldw %0, dp[g_speed]" : "=r" (speed) :);
|
||||||
|
|
||||||
/* Calc packet size to send back based on our fb */
|
/* Calc packet size to send back based on our fb */
|
||||||
speedRem += speed;
|
speedRem += speed;
|
||||||
@@ -587,7 +587,7 @@ static inline void SetupZerosSendBuffer(XUD_ep aud_to_host_usb_ep, unsigned samp
|
|||||||
|
|
||||||
mid *= g_numUsbChan_In * slotSize;
|
mid *= g_numUsbChan_In * slotSize;
|
||||||
|
|
||||||
asm("stw %0, %1[0]"::"r"(mid),"r"(g_aud_to_host_zeros));
|
asm volatile("stw %0, %1[0]"::"r"(mid),"r"(g_aud_to_host_zeros));
|
||||||
|
|
||||||
/* Mark EP ready with the zero buffer. Note this will simply update the packet size
|
/* Mark EP ready with the zero buffer. Note this will simply update the packet size
|
||||||
* if it is already ready */
|
* if it is already ready */
|
||||||
@@ -648,14 +648,14 @@ void decouple(chanend c_mix_out
|
|||||||
#ifndef OUT_VOLUME_IN_MIXER
|
#ifndef OUT_VOLUME_IN_MIXER
|
||||||
for (int i = 0; i < NUM_USB_CHAN_OUT + 1; i++)
|
for (int i = 0; i < NUM_USB_CHAN_OUT + 1; i++)
|
||||||
{
|
{
|
||||||
asm("stw %0, %1[%2]"::"r"(MAX_VOL),"r"(p_multOut),"r"(i));
|
asm volatile("stw %0, %1[%2]"::"r"(MAX_VOL),"r"(p_multOut),"r"(i));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef IN_VOLUME_IN_MIXER
|
#ifndef IN_VOLUME_IN_MIXER
|
||||||
for (int i = 0; i < NUM_USB_CHAN_IN + 1; i++)
|
for (int i = 0; i < NUM_USB_CHAN_IN + 1; i++)
|
||||||
{
|
{
|
||||||
asm("stw %0, %1[%2]"::"r"(MAX_VOL),"r"(p_multIn),"r"(i));
|
asm volatile("stw %0, %1[%2]"::"r"(MAX_VOL),"r"(p_multIn),"r"(i));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -751,7 +751,7 @@ void decouple(chanend c_mix_out
|
|||||||
chkct(c_mix_out, XS1_CT_END);
|
chkct(c_mix_out, XS1_CT_END);
|
||||||
|
|
||||||
SET_SHARED_GLOBAL(g_freqChange, 0);
|
SET_SHARED_GLOBAL(g_freqChange, 0);
|
||||||
asm("outct res[%0],%1"::"r"(buffer_aud_ctl_chan),"r"(XS1_CT_END));
|
asm volatile("outct res[%0],%1"::"r"(buffer_aud_ctl_chan),"r"(XS1_CT_END));
|
||||||
|
|
||||||
ENABLE_INTERRUPTS();
|
ENABLE_INTERRUPTS();
|
||||||
|
|
||||||
@@ -795,7 +795,7 @@ void decouple(chanend c_mix_out
|
|||||||
}
|
}
|
||||||
|
|
||||||
SET_SHARED_GLOBAL(g_freqChange, 0);
|
SET_SHARED_GLOBAL(g_freqChange, 0);
|
||||||
asm("outct res[%0],%1"::"r"(buffer_aud_ctl_chan),"r"(XS1_CT_END));
|
asm volatile("outct res[%0],%1"::"r"(buffer_aud_ctl_chan),"r"(XS1_CT_END));
|
||||||
|
|
||||||
ENABLE_INTERRUPTS();
|
ENABLE_INTERRUPTS();
|
||||||
}
|
}
|
||||||
@@ -840,7 +840,7 @@ void decouple(chanend c_mix_out
|
|||||||
|
|
||||||
/* Wait for handshake back */
|
/* Wait for handshake back */
|
||||||
chkct(c_mix_out, XS1_CT_END);
|
chkct(c_mix_out, XS1_CT_END);
|
||||||
asm("outct res[%0],%1"::"r"(buffer_aud_ctl_chan),"r"(XS1_CT_END));
|
asm volatile("outct res[%0],%1"::"r"(buffer_aud_ctl_chan),"r"(XS1_CT_END));
|
||||||
|
|
||||||
SET_SHARED_GLOBAL(g_freqChange, 0);
|
SET_SHARED_GLOBAL(g_freqChange, 0);
|
||||||
ENABLE_INTERRUPTS();
|
ENABLE_INTERRUPTS();
|
||||||
@@ -1000,7 +1000,7 @@ void decouple(chanend c_mix_out
|
|||||||
{
|
{
|
||||||
int p, len;
|
int p, len;
|
||||||
GET_SHARED_GLOBAL(p, g_aud_to_host_buffer);
|
GET_SHARED_GLOBAL(p, g_aud_to_host_buffer);
|
||||||
asm("ldw %0, %1[0]":"=r"(len):"r"(p));
|
asm volatile("ldw %0, %1[0]":"=r"(len):"r"(p));
|
||||||
XUD_SetReady_InPtr(aud_to_host_usb_ep, p+4, len);
|
XUD_SetReady_InPtr(aud_to_host_usb_ep, p+4, len);
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
Reference in New Issue
Block a user