summaryrefslogtreecommitdiffstats
path: root/hwaccess.h
diff options
context:
space:
mode:
authorCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2012-08-27 00:44:42 +0000
committerStefan Tauner <stefan.tauner@alumni.tuwien.ac.at>2012-08-27 00:44:42 +0000
commit1c6d2ff03d16acf87c96d019153dcd10c779a5f6 (patch)
treeb211be01cc5f25fa78321dd434e42aafa9ea3f0e /hwaccess.h
parent6745d6f39d2642908035c7e4a6481f5349c767a7 (diff)
downloadast2050-flashrom-1c6d2ff03d16acf87c96d019153dcd10c779a5f6.zip
ast2050-flashrom-1c6d2ff03d16acf87c96d019153dcd10c779a5f6.tar.gz
Some ISO C fixes
This patch just fixes a limited number of bits not conforming to c99 by using - __asm__ instead of just asm - {0} instead of {} for struct initialization - h_addr_list[0] instead of h_addr to access the host address in struct hostent - #include <strings.h> where needed (for ffs and strcasecmp) Based on a previous patch by Carl-Daniel. Corresponding to flashrom svn r1585. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Diffstat (limited to 'hwaccess.h')
-rw-r--r--hwaccess.h13
1 files changed, 6 insertions, 7 deletions
diff --git a/hwaccess.h b/hwaccess.h
index 12496bb..dc52118 100644
--- a/hwaccess.h
+++ b/hwaccess.h
@@ -174,7 +174,6 @@ cpu_to_be(64)
/* for iopl and outb under Solaris */
#if defined (__sun) && (defined(__i386) || defined(__amd64))
-#include <strings.h>
#include <sys/sysi86.h>
#include <sys/psw.h>
#include <asm/sunddi.h>
@@ -263,37 +262,37 @@ cpu_to_be(64)
static inline void outb(uint8_t value, uint16_t port)
{
- asm volatile ("outb %b0,%w1": :"a" (value), "Nd" (port));
+ __asm__ volatile ("outb %b0,%w1": :"a" (value), "Nd" (port));
}
static inline uint8_t inb(uint16_t port)
{
uint8_t value;
- asm volatile ("inb %w1,%0":"=a" (value):"Nd" (port));
+ __asm__ volatile ("inb %w1,%0":"=a" (value):"Nd" (port));
return value;
}
static inline void outw(uint16_t value, uint16_t port)
{
- asm volatile ("outw %w0,%w1": :"a" (value), "Nd" (port));
+ __asm__ volatile ("outw %w0,%w1": :"a" (value), "Nd" (port));
}
static inline uint16_t inw(uint16_t port)
{
uint16_t value;
- asm volatile ("inw %w1,%0":"=a" (value):"Nd" (port));
+ __asm__ volatile ("inw %w1,%0":"=a" (value):"Nd" (port));
return value;
}
static inline void outl(uint32_t value, uint16_t port)
{
- asm volatile ("outl %0,%w1": :"a" (value), "Nd" (port));
+ __asm__ volatile ("outl %0,%w1": :"a" (value), "Nd" (port));
}
static inline uint32_t inl(uint16_t port)
{
uint32_t value;
- asm volatile ("inl %1,%0":"=a" (value):"Nd" (port));
+ __asm__ volatile ("inl %1,%0":"=a" (value):"Nd" (port));
return value;
}
#endif
OpenPOWER on IntegriCloud