change function names
This commit is contained in:
@@ -4,11 +4,11 @@
|
||||
#include <ihk/debug.h>
|
||||
#include <ihk/lock.h>
|
||||
|
||||
struct aal_kmsg_buf kmsg_buf AAL_KMSG_ALIGN;
|
||||
struct ihk_kmsg_buf kmsg_buf IHK_KMSG_ALIGN;
|
||||
|
||||
extern int vsnprintf(char *buf, size_t size, const char *fmt, va_list args);
|
||||
extern int sprintf(char * buf, const char *fmt, ...);
|
||||
static aal_spinlock_t kmsg_lock;
|
||||
static ihk_spinlock_t kmsg_lock;
|
||||
|
||||
/* TODO: lock */
|
||||
void kputs(char *buf)
|
||||
@@ -16,7 +16,7 @@ void kputs(char *buf)
|
||||
int len = strlen(buf);
|
||||
unsigned long flags;
|
||||
|
||||
flags = aal_mc_spinlock_lock(&kmsg_lock);
|
||||
flags = ihk_mc_spinlock_lock(&kmsg_lock);
|
||||
|
||||
if (len + kmsg_buf.tail > kmsg_buf.len) {
|
||||
kmsg_buf.tail = 0;
|
||||
@@ -25,19 +25,19 @@ void kputs(char *buf)
|
||||
strncpy(kmsg_buf.str + kmsg_buf.tail, buf, len);
|
||||
kmsg_buf.tail += len;
|
||||
|
||||
aal_mc_spinlock_unlock(&kmsg_lock, flags);
|
||||
ihk_mc_spinlock_unlock(&kmsg_lock, flags);
|
||||
}
|
||||
|
||||
#define KPRINTF_LOCAL_BUF_LEN 1024
|
||||
|
||||
int kprintf_lock()
|
||||
{
|
||||
return aal_mc_spinlock_lock(&kmsg_lock);
|
||||
return ihk_mc_spinlock_lock(&kmsg_lock);
|
||||
}
|
||||
|
||||
void kprintf_unlock(int irqflags)
|
||||
{
|
||||
aal_mc_spinlock_unlock(&kmsg_lock, irqflags);
|
||||
ihk_mc_spinlock_unlock(&kmsg_lock, irqflags);
|
||||
}
|
||||
|
||||
/* Caller must hold kmsg_lock! */
|
||||
@@ -70,7 +70,7 @@ int kprintf(const char *format, ...)
|
||||
unsigned long flags;
|
||||
char buf[KPRINTF_LOCAL_BUF_LEN];
|
||||
|
||||
flags = aal_mc_spinlock_lock(&kmsg_lock);
|
||||
flags = ihk_mc_spinlock_lock(&kmsg_lock);
|
||||
|
||||
/* Copy into the local buf */
|
||||
va_start(va, format);
|
||||
@@ -85,14 +85,14 @@ int kprintf(const char *format, ...)
|
||||
memcpy(kmsg_buf.str + kmsg_buf.tail, buf, len);
|
||||
kmsg_buf.tail += len;
|
||||
|
||||
aal_mc_spinlock_unlock(&kmsg_lock, flags);
|
||||
ihk_mc_spinlock_unlock(&kmsg_lock, flags);
|
||||
|
||||
return len;
|
||||
}
|
||||
|
||||
void kmsg_init(void)
|
||||
{
|
||||
aal_mc_spinlock_init(&kmsg_lock);
|
||||
ihk_mc_spinlock_init(&kmsg_lock);
|
||||
kmsg_buf.tail = 0;
|
||||
kmsg_buf.len = sizeof(kmsg_buf.str);
|
||||
memset(kmsg_buf.str, 0, kmsg_buf.len);
|
||||
|
||||
Reference in New Issue
Block a user