mirror of
https://github.com/xen-project/xen.git
synced 2026-10-30 03:00:05 +01:00
This patch places some tcpa calls into the rombios that had previously not applied anymore or were not set. Force the reads from MMIO memory locations that the compiler otherwise optimizes away (-O2) if there was an immediate write to the same memory location before. Use #define'd constants wherever possible. Fix all remaining compiler warnings. Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
44 lines
1.2 KiB
C
44 lines
1.2 KiB
C
#ifndef UTIL_H
|
|
#define UTIL_H
|
|
|
|
void outb(uint16_t addr, uint8_t val);
|
|
void outw(uint16_t addr, uint16_t val);
|
|
void outl(uint16_t addr, uint32_t val);
|
|
uint8_t inb(uint16_t addr);
|
|
uint16_t inw(uint16_t addr);
|
|
uint32_t inl(uint16_t addr);
|
|
void mssleep(uint32_t time);
|
|
|
|
char *itoa(char *a, unsigned int i);
|
|
int strcmp(const char *cs, const char *ct);
|
|
int strncmp(const char *s1, const char *s2, uint32_t n);
|
|
void *memcpy(void *dest, const void *src, unsigned n);
|
|
void *memmove(void *dest, const void *src, unsigned n);
|
|
char *strcpy(char *dest, const char *src);
|
|
char *strncpy(char *dest, const char *src, unsigned n);
|
|
unsigned strlen(const char *s);
|
|
void * memset(void *s, int c, unsigned n);
|
|
int memcmp(const void *s1, const void *s2, unsigned n);
|
|
void cpuid(uint32_t idx, uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t *edx);
|
|
void byte_to_hex(char *digits, uint8_t byte);
|
|
void uuid_to_string(char *dest, uint8_t *uuid);
|
|
int printf(const char *fmt, ...);
|
|
|
|
static inline uint8_t mmio_readb(uint8_t *addr)
|
|
{
|
|
return *(volatile uint8_t *)addr;
|
|
}
|
|
|
|
static inline uint16_t mmio_readw(uint16_t *addr)
|
|
{
|
|
return *(volatile uint16_t *)addr;
|
|
}
|
|
|
|
static inline uint32_t mmio_readl(uint32_t *addr)
|
|
{
|
|
return *(volatile uint32_t *)addr;
|
|
}
|
|
|
|
|
|
#endif
|