diff --git a/sched_boundary/process.py b/sched_boundary/process.py index b6ec506cb9be8658f671550a2232400f04d8b2ee..821546c99873655dbc171aaec0663971aa85ca3e 100644 --- a/sched_boundary/process.py +++ b/sched_boundary/process.py @@ -232,6 +232,6 @@ if __name__ == '__main__': for fn in func_class['undefined']]) f.write('{%s}' % array) with open(tmpdir + 'interface_fn_ptrs', 'w') as f: - f.write('\n'.join([fn[0] for fn in config['function']['interface']])) - f.write('\n') - f.write('\n'.join(['__mod_' + fn[0] for fn in config['function']['fn_ptr']])) + lst = [fn[0] for fn in config['function']['interface']] + ['__mod_' + fn[0] for fn in config['function']['fn_ptr']] + lst.sort() + f.write('\n'.join(lst)) diff --git a/src/Makefile b/src/Makefile index 071827bb5d3aa576ca3578243917d5c092da147f..219131f5f79919678d6ab2d7d1b8d131d8d33cd8 100644 --- a/src/Makefile +++ b/src/Makefile @@ -33,6 +33,19 @@ $(obj)/%.o: $(src)/%.c FORCE $(obj)/%.stub.o: $(obj)/%.o FORCE $(call cmd,objcopy) +$(obj)/removed_interface.h: $(addprefix $(obj)/,$(objs-y)) + awk '{print "#define REMOVE_"$$1}' $(plugsched_tmpdir)/interface_fn_ptrs > $@ + readelf -sW $^ | \ + awk '$$7!="UND" && $$4=="FUNC" {print $$NF}' | \ + LANG=C sort | \ + LANG=C comm -1 -3 - $(plugsched_tmpdir)/interface_fn_ptrs | \ + awk '{print "#undef REMOVE_"$$1"\n" \ + "#define REMOVE_"$$1" __alias(interface_placeholder)"}' >> $@ + +$(obj)/main.o: $(src)/main.c $(obj)/removed_interface.h + $(call cmd,force_checksrc) + $(call if_changed_rule,cc_o_c) + obj-stubs := $(patsubst %.o,%.stub.o,$(objs-y)) scheduler-objs := $(obj-stubs) main.o sched_rebuild.o diff --git a/src/head_jump.h b/src/head_jump.h index 9e64ba5a0d5728aa9ca714e7ee1978ac2ebe3cd4..b232b8201fc21b7912cbae44d7a01c3560e6b7c4 100644 --- a/src/head_jump.h +++ b/src/head_jump.h @@ -8,6 +8,7 @@ #include #include +#include "removed_interface.h" #define EXPORT_SIDECAR(fn, file, ...) EXPORT_PLUGSCHED(fn, __VA_ARGS__) #define PLUGSCHED_FN_PTR EXPORT_PLUGSCHED @@ -25,8 +26,8 @@ static unsigned long mod_func_addr[NR_INTERFACE_FN]; static unsigned long mod_func_size[NR_INTERFACE_FN]; /* Used to declare the extern function set */ -#define PLUGSCHED_FN_PTR(fn, ret, ...) extern ret __mod_##fn(__VA_ARGS__); -#define EXPORT_PLUGSCHED(fn, ret, ...) extern ret fn(__VA_ARGS__); +#define PLUGSCHED_FN_PTR(fn, ret, ...) extern ret __mod_##fn(__VA_ARGS__) REMOVE___mod_##fn; +#define EXPORT_PLUGSCHED(fn, ret, ...) extern ret fn(__VA_ARGS__) REMOVE_##fn; #include "export_jump.h" #undef EXPORT_PLUGSCHED #undef PLUGSCHED_FN_PTR diff --git a/src/main.c b/src/main.c index 0767962404d3148a4946e1a62342475a63d90ab6..dae41ea65c697f0f2c0e94e3fa1869bdf10c8165 100644 --- a/src/main.c +++ b/src/main.c @@ -72,6 +72,8 @@ static inline void parallel_state_check_init(void) atomic_set(&redirect_done, 0); } +void interface_placeholder(void) { } + static inline void process_id_init(void) { int cpu, idx = 0;