Use -iquote for xv6 headers when compiling for Linux

上级 9c295417
...@@ -10,10 +10,9 @@ ...@@ -10,10 +10,9 @@
#include <stddef.h> #include <stddef.h>
#include <errno.h> #include <errno.h>
typedef uint64_t u64; typedef uint64_t u64;
#include "include/wq.hh" #include "wq.hh"
#include "reducer.hh"
#include "user/dirit.hh" #include "user/dirit.hh"
#include "include/percpu.hh"
#include "include/reducer.hh"
#define ST_SIZE(st) (st).st_size #define ST_SIZE(st) (st).st_size
#define ST_ISDIR(st) S_ISDIR((st).st_mode) #define ST_ISDIR(st) S_ISDIR((st).st_mode)
#define BSIZ 256 #define BSIZ 256
......
#include "percpu.hh"
template <typename T> template <typename T>
struct reducer_opadd struct reducer_opadd
{ {
......
#pragma once #pragma once
#if defined(LINUX)
#include <stdlib.h>
#include <assert.h>
#include <atomic>
#define xmalloc(n) malloc(n)
#define xfree(p, sz) free(p)
#elif defined(XV6_KERNEL)
#define xmalloc(n) kmalloc(n)
#define xfree(p, sz) kmfree(p, sz)
#else
#warning "Unknown wq implementation"
#endif
#define WQSIZE 8192 #define WQSIZE 8192
class work; class work;
...@@ -40,4 +27,17 @@ struct cwork : public work { ...@@ -40,4 +27,17 @@ struct cwork : public work {
void *arg4; void *arg4;
}; };
#if defined(LINUX)
#include <stdlib.h>
#include <assert.h>
#include <atomic>
#define xmalloc(n) malloc(n)
#define xfree(p, sz) free(p)
#elif defined(XV6_KERNEL)
#define xmalloc(n) kmalloc(n)
#define xfree(p, sz) kmfree(p, sz)
#else
#warning "Unknown wq implementation"
#endif
#include "wqfor.hh" #include "wqfor.hh"
#if defined(LINUX) #if defined(LINUX)
#include "user/wqlinux.hh" #include "user/wqlinux.hh"
#include "include/percpu.hh" #include "percpu.hh"
#elif defined(XV6_KERNEL) #elif defined(XV6_KERNEL)
#include "wqkernel.hh" #include "wqkernel.hh"
#include "percpu.hh" #include "percpu.hh"
......
...@@ -2,7 +2,8 @@ NCXXFLAGS = -static -g -MD -m64 -O3 -Wall -Werror -DHW_$(HW) \ ...@@ -2,7 +2,8 @@ NCXXFLAGS = -static -g -MD -m64 -O3 -Wall -Werror -DHW_$(HW) \
-fno-builtin -fno-strict-aliasing -fno-omit-frame-pointer \ -fno-builtin -fno-strict-aliasing -fno-omit-frame-pointer \
-fms-extensions -mcx16 -mno-red-zone -std=c++0x \ -fms-extensions -mcx16 -mno-red-zone -std=c++0x \
-Wno-sign-compare -fno-exceptions -fno-rtti -fcheck-new \ -Wno-sign-compare -fno-exceptions -fno-rtti -fcheck-new \
-I. -include param.h -include include/compiler.h -iquote . -iquote include \
-include param.h -include include/compiler.h
$(O)/user/%.o: lib/%.cc $(O)/user/%.o: lib/%.cc
@echo " CXX $@" @echo " CXX $@"
......
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论