forked from Imagelibrary/rtems
2011-02-11 Ralf Corsépius <ralf.corsepius@rtems.org>
* console/console.c, console/ns16550cfg.c, console/polled_io.c, include/bsp.h, include/tm27.h, startup/bspstart.c: Use "__asm__" instead of "asm" for improved c99-compliance.
This commit is contained in:
@@ -1,3 +1,9 @@
|
|||||||
|
2011-02-11 Ralf Corsépius <ralf.corsepius@rtems.org>
|
||||||
|
|
||||||
|
* console/console.c, console/ns16550cfg.c, console/polled_io.c,
|
||||||
|
include/bsp.h, include/tm27.h, startup/bspstart.c:
|
||||||
|
Use "__asm__" instead of "asm" for improved c99-compliance.
|
||||||
|
|
||||||
2011-02-02 Ralf Corsépius <ralf.corsepius@rtems.org>
|
2011-02-02 Ralf Corsépius <ralf.corsepius@rtems.org>
|
||||||
|
|
||||||
* configure.ac: Require autoconf-2.68, automake-1.11.1.
|
* configure.ac: Require autoconf-2.68, automake-1.11.1.
|
||||||
|
|||||||
@@ -259,12 +259,12 @@ debug_putc_onlcr(const char c)
|
|||||||
|
|
||||||
if ('\n'==c){
|
if ('\n'==c){
|
||||||
*ptr = '\r';
|
*ptr = '\r';
|
||||||
asm volatile("sync");
|
__asm__ volatile("sync");
|
||||||
for (i=0;i<0x0fff;i++);
|
for (i=0;i<0x0fff;i++);
|
||||||
}
|
}
|
||||||
|
|
||||||
*ptr = c;
|
*ptr = c;
|
||||||
asm volatile("sync");
|
__asm__ volatile("sync");
|
||||||
for (i=0;i<0x0fff;i++);
|
for (i=0;i<0x0fff;i++);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ uint8_t Read_ns16550_register(
|
|||||||
volatile struct uart_reg *p = (volatile struct uart_reg *)ulCtrlPort;
|
volatile struct uart_reg *p = (volatile struct uart_reg *)ulCtrlPort;
|
||||||
uint8_t ucData;
|
uint8_t ucData;
|
||||||
ucData = p[ucRegNum].reg;
|
ucData = p[ucRegNum].reg;
|
||||||
asm volatile("sync");
|
__asm__ volatile("sync");
|
||||||
return ucData;
|
return ucData;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -42,9 +42,9 @@ void Write_ns16550_register(
|
|||||||
volatile struct uart_reg *p = (volatile struct uart_reg *)ulCtrlPort;
|
volatile struct uart_reg *p = (volatile struct uart_reg *)ulCtrlPort;
|
||||||
volatile int i;
|
volatile int i;
|
||||||
p[ucRegNum].reg = ucData;
|
p[ucRegNum].reg = ucData;
|
||||||
asm volatile("sync");
|
__asm__ volatile("sync");
|
||||||
asm volatile("isync");
|
__asm__ volatile("isync");
|
||||||
asm volatile("eieio");
|
__asm__ volatile("eieio");
|
||||||
for (i=0;i<0x08ff;i++)
|
for (i=0;i<0x08ff;i++)
|
||||||
asm volatile("isync");
|
__asm__ volatile("isync");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -925,7 +925,7 @@ int printk(const char *fmt, ...) {
|
|||||||
/* Necessary to avoid including a library, and GCC won't do this inline. */
|
/* Necessary to avoid including a library, and GCC won't do this inline. */
|
||||||
#define div10(num, rmd) \
|
#define div10(num, rmd) \
|
||||||
do { u32 t1, t2, t3; \
|
do { u32 t1, t2, t3; \
|
||||||
asm("lis %4,0xcccd; " \
|
__asm__ ("lis %4,0xcccd; " \
|
||||||
"addi %4,%4,0xffffcccd; " /* Build 0xcccccccd */ \
|
"addi %4,%4,0xffffcccd; " /* Build 0xcccccccd */ \
|
||||||
"mulhwu %3,%0+1,%4; " /* (num.l*cst.l).h */ \
|
"mulhwu %3,%0+1,%4; " /* (num.l*cst.l).h */ \
|
||||||
"mullw %2,%0,%4; " /* (num.h*cst.l).l */ \
|
"mullw %2,%0,%4; " /* (num.h*cst.l).l */ \
|
||||||
|
|||||||
@@ -174,7 +174,7 @@ extern unsigned int BSP_time_base_divisor;
|
|||||||
((unsigned long long) ((((unsigned long long)BSP_time_base_divisor) * 1000000ULL) /((unsigned long long) BSP_bus_frequency)) * ((unsigned long long) (_value)))
|
((unsigned long long) ((((unsigned long long)BSP_time_base_divisor) * 1000000ULL) /((unsigned long long) BSP_bus_frequency)) * ((unsigned long long) (_value)))
|
||||||
|
|
||||||
#define Processor_Synchronize() \
|
#define Processor_Synchronize() \
|
||||||
asm(" eieio ")
|
__asm__ (" eieio ")
|
||||||
|
|
||||||
extern void BSP_panic(char *s);
|
extern void BSP_panic(char *s);
|
||||||
extern int BSP_disconnect_clock_handler (void);
|
extern int BSP_disconnect_clock_handler (void);
|
||||||
|
|||||||
@@ -39,22 +39,22 @@ void Install_tm27_vector(void (*_handler)())
|
|||||||
#define Cause_tm27_intr() \
|
#define Cause_tm27_intr() \
|
||||||
do { \
|
do { \
|
||||||
uint32_t _clicks = 8; \
|
uint32_t _clicks = 8; \
|
||||||
asm volatile( "mtdec %0" : "=r" ((_clicks)) : "r" ((_clicks)) ); \
|
__asm__ volatile( "mtdec %0" : "=r" ((_clicks)) : "r" ((_clicks)) ); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
|
||||||
#define Clear_tm27_intr() \
|
#define Clear_tm27_intr() \
|
||||||
do { \
|
do { \
|
||||||
uint32_t _clicks = 0xffffffff; \
|
uint32_t _clicks = 0xffffffff; \
|
||||||
asm volatile( "mtdec %0" : "=r" ((_clicks)) : "r" ((_clicks)) ); \
|
__asm__ volatile( "mtdec %0" : "=r" ((_clicks)) : "r" ((_clicks)) ); \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define Lower_tm27_intr() \
|
#define Lower_tm27_intr() \
|
||||||
do { \
|
do { \
|
||||||
uint32_t _msr = 0; \
|
uint32_t _msr = 0; \
|
||||||
_ISR_Set_level( 0 ); \
|
_ISR_Set_level( 0 ); \
|
||||||
asm volatile( "mfmsr %0 ;" : "=r" (_msr) : "r" (_msr) ); \
|
__asm__ volatile( "mfmsr %0 ;" : "=r" (_msr) : "r" (_msr) ); \
|
||||||
_msr |= 0x8002; \
|
_msr |= 0x8002; \
|
||||||
asm volatile( "mtmsr %0 ;" : "=r" (_msr) : "r" (_msr) ); \
|
__asm__ volatile( "mtmsr %0 ;" : "=r" (_msr) : "r" (_msr) ); \
|
||||||
} while (0)
|
} while (0)
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -184,18 +184,18 @@ unsigned int EUMBBAR;
|
|||||||
unsigned int get_eumbbar(void) {
|
unsigned int get_eumbbar(void) {
|
||||||
register int a, e;
|
register int a, e;
|
||||||
|
|
||||||
asm volatile( "lis %0,0xfec0; ori %0,%0,0x0000": "=r" (a) );
|
__asm__ volatile( "lis %0,0xfec0; ori %0,%0,0x0000": "=r" (a) );
|
||||||
asm volatile("sync");
|
__asm__ volatile("sync");
|
||||||
|
|
||||||
asm volatile("lis %0,0x8000; ori %0,%0,0x0078": "=r"(e) );
|
__asm__ volatile("lis %0,0x8000; ori %0,%0,0x0078": "=r"(e) );
|
||||||
asm volatile("stwbrx %0,0x0,%1": "=r"(e): "r"(a));
|
__asm__ volatile("stwbrx %0,0x0,%1": "=r"(e): "r"(a));
|
||||||
asm volatile("sync");
|
__asm__ volatile("sync");
|
||||||
|
|
||||||
asm volatile("lis %0,0xfee0; ori %0,%0,0x0000": "=r" (a) );
|
__asm__ volatile("lis %0,0xfee0; ori %0,%0,0x0000": "=r" (a) );
|
||||||
asm volatile("sync");
|
__asm__ volatile("sync");
|
||||||
|
|
||||||
asm volatile("lwbrx %0,0x0,%1": "=r" (e): "r" (a));
|
__asm__ volatile("lwbrx %0,0x0,%1": "=r" (e): "r" (a));
|
||||||
asm volatile("isync");
|
__asm__ volatile("isync");
|
||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user