Merge branch 'master' of postpeta.pccluster.org:mckernel

This commit is contained in:
simin
2013-05-21 03:53:18 +09:00
14 changed files with 1144 additions and 1561 deletions

View File

@@ -1,16 +0,0 @@
#CC=/usr/linux-k1om-4.7/bin/x86_64-k1om-linux-gcc
CC=gcc
CFLAGS=-Wall -O
TARGET=mcexec
all: $(TARGET)
mcexec: mcexec.c
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -pthread -o $@ $^ $(EXTRA_OBJS)
clean:
$(RM) $(TARGET) *.o
.PHONY: all clean

View File

@@ -6,7 +6,7 @@ TARGET=mcexec
all: $(TARGET)
mcexec: mcexec.c
$(CC) $(CFLAGS) -pthread -o $@ $^
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -pthread -o $@ $^ $(EXTRA_OBJS)
clean:
$(RM) $(TARGET) *.o

View File

@@ -549,6 +549,7 @@ int main_loop(int fd, int cpu, pthread_mutex_t *lock)
{
struct syscall_wait_desc w;
long ret;
char *fn;
w.cpu = cpu;
@@ -573,7 +574,17 @@ int main_loop(int fd, int cpu, pthread_mutex_t *lock)
__dprintf("open: %s\n", dma_buf);
ret = open((char *)dma_buf, w.sr.args[1], w.sr.args[2]);
fn = (char *)dma_buf;
if(!strcmp(fn, "/proc/meminfo")){
fn = "/admin/fs/attached/files/proc/meminfo";
}
else if(!strcmp(fn, "/proc/cpuinfo")){
fn = "/admin/fs/attached/files/proc/cpuinfo";
}
else if(!strcmp(fn, "/sys/devices/system/cpu/online")){
fn = "/admin/fs/attached/files/sys/devices/system/cpu/online";
}
ret = open(fn, w.sr.args[1], w.sr.args[2]);
SET_ERR(ret);
do_syscall_return(fd, cpu, ret, 0, 0, 0, 0);
break;