Move timer from os to base repository

Since the timer and timeout handling is part of the base library (the
dynamic linker), it belongs to the base repository.

Besides moving the timer and its related infrastructure (alarm, timeout
libs, tests) to the base repository, this patch also moves the timer
from the 'drivers' subdirectory directly to 'src' and disamibuates the
timer's build locations for the various kernels. Otherwise the different
timer implementations could interfere with each other when using one
build directory with multiple kernels.

Note that this patch changes the include paths for the former os/timer,
os/alarm.h, os/duration.h, and os/timed_semaphore.h to base/.

Issue #3101
This commit is contained in:
Norman Feske 2019-01-03 18:01:49 +01:00
parent 14cd115c82
commit bf62d6b896
222 changed files with 272 additions and 454 deletions

View File

@ -1,20 +1,5 @@
include $(GENODE_DIR)/repos/base/recipes/src/base_content.inc include $(GENODE_DIR)/repos/base/recipes/src/base_content.inc
TIMER_SRC := main.cc target.inc include periodic fiasco
content: src/drivers/timer
src/drivers/timer:
mkdir -p $@
cp -r $(addprefix $(GENODE_DIR)/repos/os/$@/,$(TIMER_SRC)) $@
content: include/spec/x86_32/trace/timestamp.h include/spec/x86_64/trace/timestamp.h
include/spec/%/trace/timestamp.h:
mkdir -p $(dir $@)
cp $(GENODE_DIR)/repos/os/$@ $@
content: README content: README
README: README:
cp $(REP_DIR)/recipes/src/base-fiasco/README $@ cp $(REP_DIR)/recipes/src/base-fiasco/README $@
@ -32,11 +17,10 @@ KERNEL_PORT_DIR := $(call port_dir,$(REP_DIR)/ports/fiasco)
src/kernel/fiasco: src/kernel src/kernel/fiasco: src/kernel
cp -r $(KERNEL_PORT_DIR)/src/kernel/fiasco/* $@ cp -r $(KERNEL_PORT_DIR)/src/kernel/fiasco/* $@
content: content:
for spec in x86_32; do \ for spec in x86_32; do \
mv lib/mk/spec/$$spec/ld-fiasco.mk lib/mk/spec/$$spec/ld.mk; \ mv lib/mk/spec/$$spec/ld-fiasco.mk lib/mk/spec/$$spec/ld.mk; \
done; done;
sed -i "s/ld-fiasco/ld/" src/lib/ld/fiasco/target.mk sed -i "s/ld-fiasco/ld/" src/lib/ld/fiasco/target.mk
sed -i "s/fiasco_timer_drv/timer/" src/drivers/timer/fiasco/target.mk sed -i "s/fiasco_timer_drv/timer/" src/timer/fiasco/target.mk

View File

@ -0,0 +1,9 @@
TARGET = fiasco_timer_drv
LIBS += syscall-fiasco
GEN_DIR := $(dir $(call select_from_repositories,src/timer/main.cc))
INC_DIR += $(GEN_DIR)/periodic
SRC_CC += periodic/time_source.cc fiasco/time_source.cc
vpath %.cc $(GEN_DIR)
include $(GEN_DIR)/target.inc

View File

@ -7,21 +7,6 @@ content: $(FROM_BASE_FOC)
$(FROM_BASE_FOC): $(FROM_BASE_FOC):
$(mirror_from_rep_dir) $(mirror_from_rep_dir)
TIMER_SRC := main.cc target.inc foc include periodic fiasco
content: src/drivers/timer
src/drivers/timer:
mkdir -p $@
cp -r $(addprefix $(GENODE_DIR)/repos/os/$@/,$(TIMER_SRC)) $@
content: include/spec/x86_32/trace/timestamp.h include/spec/x86_64/trace/timestamp.h
include/spec/%/trace/timestamp.h:
mkdir -p $(dir $@)
cp $(GENODE_DIR)/repos/os/$@ $@
content: README content: README
README: README:
cp $(RECIPE_DIR)/README $@ cp $(RECIPE_DIR)/README $@
@ -39,11 +24,10 @@ KERNEL_PORT_DIR := $(call port_dir,$(REP_DIR)/ports/foc)
src/kernel/foc: src/kernel src/kernel/foc: src/kernel
cp -r $(KERNEL_PORT_DIR)/src/kernel/foc/* $@ cp -r $(KERNEL_PORT_DIR)/src/kernel/foc/* $@
content: content:
for spec in x86_32 x86_64 arm; do \ for spec in x86_32 x86_64 arm; do \
mv lib/mk/spec/$$spec/ld-foc.mk lib/mk/spec/$$spec/ld.mk; \ mv lib/mk/spec/$$spec/ld-foc.mk lib/mk/spec/$$spec/ld.mk; \
done; done;
sed -i "s/ld-foc/ld/" src/lib/ld/foc/target.mk sed -i "s/ld-foc/ld/" src/lib/ld/foc/target.mk
sed -i "s/foc_timer_drv/timer/" src/drivers/timer/foc/target.mk sed -i "s/foc_timer_drv/timer/" src/timer/foc/target.mk

View File

@ -0,0 +1,9 @@
TARGET = foc_timer_drv
LIBS += syscall-foc
GEN_DIR := $(dir $(call select_from_repositories,src/timer/main.cc))
INC_DIR += $(GEN_DIR)/periodic
SRC_CC += periodic/time_source.cc fiasco/time_source.cc
include $(GEN_DIR)/target.inc
vpath %.cc $(GEN_DIR)

View File

@ -8,4 +8,4 @@ LIBS += alarm
INC_DIR += $(BASE_DIR)/src/include INC_DIR += $(BASE_DIR)/src/include
vpath % $(BASE_DIR)/../os/src/lib/timeout vpath % $(BASE_DIR)/src/lib/timeout

View File

@ -5,27 +5,12 @@ content: src/bootstrap
src/bootstrap: src/bootstrap:
$(mirror_from_rep_dir) $(mirror_from_rep_dir)
TIMER_SRC := main.cc target.inc hw include
content: src/drivers/timer
src/drivers/timer:
mkdir -p $@
cp -r $(addprefix $(GENODE_DIR)/repos/os/$@/,$(TIMER_SRC)) $@
content: include/spec/x86_32/trace/timestamp.h include/spec/x86_64/trace/timestamp.h
include/spec/%/trace/timestamp.h:
mkdir -p $(dir $@)
cp $(GENODE_DIR)/repos/os/$@ $@
content: generalize_target_names content: generalize_target_names
generalize_target_names: lib/mk src/lib src/drivers/timer generalize_target_names: lib/mk src/lib src/timer
for spec in arm riscv x86_64; do \ for spec in arm riscv x86_64; do \
mv lib/mk/spec/$$spec/ld-hw.mk lib/mk/spec/$$spec/ld.mk; \ mv lib/mk/spec/$$spec/ld-hw.mk lib/mk/spec/$$spec/ld.mk; \
done; done;
sed -i "s/ld-hw/ld/" src/lib/ld/hw/target.mk sed -i "s/ld-hw/ld/" src/lib/ld/hw/target.mk
sed -i "s/hw_timer_drv/timer/" src/drivers/timer/hw/target.mk sed -i "s/hw_timer_drv/timer/" src/timer/hw/target.mk

View File

@ -0,0 +1,7 @@
TARGET = hw_timer_drv
REQUIRES = hw
LIBS = syscall-hw
INC_DIR += $(PRG_DIR)
SRC_CC += time_source.cc
include $(call select_from_repositories,src/timer/target.inc)

View File

@ -15,7 +15,7 @@
#define _TIME_SOURCE_H_ #define _TIME_SOURCE_H_
/* Genode includes */ /* Genode includes */
#include <os/duration.h> #include <base/duration.h>
/* local includes */ /* local includes */
#include <signalled_time_source.h> #include <signalled_time_source.h>

View File

@ -1,7 +1,8 @@
FROM_BASE_LINUX := etc src/lib/syscall src/lib/lx_hybrid lib/import FROM_BASE_LINUX := etc src/lib/syscall src/lib/lx_hybrid lib/import
FROM_BASE_LINUX_AND_BASE := lib/mk src/lib/base src/include FROM_BASE_LINUX_AND_BASE := lib/mk src/lib/base src/include
FROM_BASE := src/lib/alarm src/lib/timeout
content: $(FROM_BASE_LINUX) $(FROM_BASE_LINUX_AND_BASE) LICENSE content: $(FROM_BASE_LINUX) $(FROM_BASE_LINUX_AND_BASE) $(FROM_BASE) LICENSE
$(FROM_BASE_LINUX): $(FROM_BASE_LINUX):
mkdir -p $@ mkdir -p $@
@ -12,5 +13,9 @@ $(FROM_BASE_LINUX_AND_BASE):
cp -r $(GENODE_DIR)/repos/base/$@/* $@ cp -r $(GENODE_DIR)/repos/base/$@/* $@
cp -r $(REP_DIR)/$@/* $@ cp -r $(REP_DIR)/$@/* $@
$(FROM_BASE):
mkdir -p $@
cp -r $(GENODE_DIR)/repos/base/$@/* $@
LICENSE: LICENSE:
cp $(GENODE_DIR)/LICENSE $@ cp $(GENODE_DIR)/LICENSE $@

View File

@ -5,18 +5,10 @@ content: lib/import src/ld
lib/import src/ld: lib/import src/ld:
$(mirror_from_rep_dir) $(mirror_from_rep_dir)
content: src/drivers/timer
TIMER_SRC := main.cc target.inc linux include periodic
src/drivers/timer:
mkdir -p $@
cp -r $(addprefix $(GENODE_DIR)/repos/os/$@/,$(TIMER_SRC)) $@
content: content:
for spec in x86_32 x86_64 arm; do \ for spec in x86_32 x86_64 arm; do \
mv lib/mk/spec/$$spec/ld-linux.mk lib/mk/spec/$$spec/ld.mk; done; mv lib/mk/spec/$$spec/ld-linux.mk lib/mk/spec/$$spec/ld.mk; done;
sed -i "s/core-linux/core/" src/core/linux/target.mk sed -i "s/core-linux/core/" src/core/linux/target.mk
sed -i "s/ld-linux/ld/" src/lib/ld/linux/target.mk sed -i "s/ld-linux/ld/" src/lib/ld/linux/target.mk
sed -i "s/linux_timer_drv/timer/" src/drivers/timer/linux/target.mk sed -i "s/linux_timer_drv/timer/" src/timer/linux/target.mk

View File

@ -1,4 +1,4 @@
build "core init test/region_map_mmap drivers/timer test/signal" build "core init test/region_map_mmap timer test/signal"
create_boot_directory create_boot_directory

View File

@ -0,0 +1,9 @@
TARGET = linux_timer_drv
GEN_DIR := $(call select_from_repositories,src/timer/periodic)/..
INC_DIR += $(GEN_DIR)/periodic
SRC_CC += periodic/time_source.cc time_source.cc
LIBS += syscall-linux
include $(GEN_DIR)/target.inc
vpath periodic/time_source.cc $(GEN_DIR)

View File

@ -1,9 +1,15 @@
FROM_BASE_NOVA := etc include FROM_BASE_NOVA := etc include
FROM_BASE := lib/mk/timeout.mk src/lib/timeout \
lib/mk/alarm.mk src/lib/alarm
content: $(FROM_BASE_NOVA) LICENSE content: $(FROM_BASE_NOVA) $(FROM_BASE) LICENSE
$(FROM_BASE_NOVA): $(FROM_BASE_NOVA):
$(mirror_from_rep_dir) $(mirror_from_rep_dir)
$(FROM_BASE):
mkdir -p $(dir $@)
cp -r $(GENODE_DIR)/repos/base/$@ $@
LICENSE: LICENSE:
cp $(GENODE_DIR)/LICENSE $@ cp $(GENODE_DIR)/LICENSE $@

View File

@ -1,25 +1,9 @@
include $(GENODE_DIR)/repos/base/recipes/src/base_content.inc include $(GENODE_DIR)/repos/base/recipes/src/base_content.inc
TIMER_SRC := main.cc target.inc nova include
content: src/drivers/timer
src/drivers/timer:
mkdir -p $@
cp -r $(addprefix $(GENODE_DIR)/repos/os/$@/,$(TIMER_SRC)) $@
content: include/spec/x86_32/trace/timestamp.h include/spec/x86_64/trace/timestamp.h
include/spec/%/trace/timestamp.h:
mkdir -p $(dir $@)
cp $(GENODE_DIR)/repos/os/$@ $@
content: README content: README
README: README:
cp $(REP_DIR)/recipes/src/base-nova/README $@ cp $(REP_DIR)/recipes/src/base-nova/README $@
content: src/kernel/nova content: src/kernel/nova
src/kernel: src/kernel:
$(mirror_from_rep_dir) $(mirror_from_rep_dir)
@ -29,11 +13,10 @@ KERNEL_PORT_DIR := $(call port_dir,$(REP_DIR)/ports/nova)
src/kernel/nova: src/kernel src/kernel/nova: src/kernel
cp -r $(KERNEL_PORT_DIR)/src/kernel/nova/* $@ cp -r $(KERNEL_PORT_DIR)/src/kernel/nova/* $@
content: content:
for spec in x86_32 x86_64; do \ for spec in x86_32 x86_64; do \
mv lib/mk/spec/$$spec/ld-nova.mk lib/mk/spec/$$spec/ld.mk; \ mv lib/mk/spec/$$spec/ld-nova.mk lib/mk/spec/$$spec/ld.mk; \
done; done;
sed -i "s/ld-nova/ld/" src/lib/ld/nova/target.mk sed -i "s/ld-nova/ld/" src/lib/ld/nova/target.mk
sed -i "s/nova_timer_drv/timer/" src/drivers/timer/nova/target.mk sed -i "s/nova_timer_drv/timer/" src/timer/nova/target.mk

View File

@ -0,0 +1,5 @@
TARGET = nova_timer_drv
INC_DIR += $(PRG_DIR)
SRC_CC += time_source.cc
include $(call select_from_repositories,src/timer/target.inc)

View File

@ -1,20 +1,5 @@
include $(GENODE_DIR)/repos/base/recipes/src/base_content.inc include $(GENODE_DIR)/repos/base/recipes/src/base_content.inc
TIMER_SRC := main.cc target.inc pit include
content: src/drivers/timer
src/drivers/timer:
mkdir -p $@
cp -r $(addprefix $(GENODE_DIR)/repos/os/$@/,$(TIMER_SRC)) $@
content: include/spec/x86_32/trace/timestamp.h include/spec/x86_64/trace/timestamp.h
include/spec/%/trace/timestamp.h:
mkdir -p $(dir $@)
cp $(GENODE_DIR)/repos/os/$@ $@
content: README content: README
README: README:
cp $(REP_DIR)/recipes/src/base-okl4/README $@ cp $(REP_DIR)/recipes/src/base-okl4/README $@
@ -32,11 +17,10 @@ KERNEL_PORT_DIR := $(call port_dir,$(REP_DIR)/ports/okl4)
src/kernel/okl4: src/kernel src/kernel/okl4: src/kernel
cp -r $(KERNEL_PORT_DIR)/src/kernel/okl4/* $@ cp -r $(KERNEL_PORT_DIR)/src/kernel/okl4/* $@
content: content:
for spec in x86_32; do \ for spec in x86_32; do \
mv lib/mk/spec/$$spec/ld-okl4.mk lib/mk/spec/$$spec/ld.mk; \ mv lib/mk/spec/$$spec/ld-okl4.mk lib/mk/spec/$$spec/ld.mk; \
done; done;
sed -i "s/ld-okl4/ld/" src/lib/ld/okl4/target.mk sed -i "s/ld-okl4/ld/" src/lib/ld/okl4/target.mk
sed -i "s/pit_timer_drv/timer/" src/drivers/timer/pit/target.mk sed -i "s/pit_timer_drv/timer/" src/timer/pit/target.inc

View File

@ -0,0 +1 @@
include $(call select_from_repositories,src/timer/pit/target.inc)

View File

@ -1,20 +1,5 @@
include $(GENODE_DIR)/repos/base/recipes/src/base_content.inc include $(GENODE_DIR)/repos/base/recipes/src/base_content.inc
TIMER_SRC := main.cc target.inc pit include
content: src/drivers/timer
src/drivers/timer:
mkdir -p $@
cp -r $(addprefix $(GENODE_DIR)/repos/os/$@/,$(TIMER_SRC)) $@
content: include/spec/x86_32/trace/timestamp.h include/spec/x86_64/trace/timestamp.h
include/spec/%/trace/timestamp.h:
mkdir -p $(dir $@)
cp $(GENODE_DIR)/repos/os/$@ $@
content: README content: README
README: README:
cp $(REP_DIR)/recipes/src/base-pistachio/README $@ cp $(REP_DIR)/recipes/src/base-pistachio/README $@
@ -32,11 +17,10 @@ KERNEL_PORT_DIR := $(call port_dir,$(REP_DIR)/ports/pistachio)
src/kernel/pistachio: src/kernel src/kernel/pistachio: src/kernel
cp -r $(KERNEL_PORT_DIR)/src/kernel/pistachio/* $@ cp -r $(KERNEL_PORT_DIR)/src/kernel/pistachio/* $@
content: content:
for spec in x86_32; do \ for spec in x86_32; do \
mv lib/mk/spec/$$spec/ld-pistachio.mk lib/mk/spec/$$spec/ld.mk; \ mv lib/mk/spec/$$spec/ld-pistachio.mk lib/mk/spec/$$spec/ld.mk; \
done; done;
sed -i "s/ld-pistachio/ld/" src/lib/ld/pistachio/target.mk sed -i "s/ld-pistachio/ld/" src/lib/ld/pistachio/target.mk
sed -i "s/pit_timer_drv/timer/" src/drivers/timer/pit/target.mk sed -i "s/pit_timer_drv/timer/" src/timer/pit/target.inc

View File

@ -0,0 +1 @@
include $(call select_from_repositories,src/timer/pit/target.inc)

View File

@ -1,18 +1,10 @@
include $(GENODE_DIR)/repos/base/recipes/src/base_content.inc include $(GENODE_DIR)/repos/base/recipes/src/base_content.inc
TIMER_SRC := main.cc target.inc epit include
content: enable_board_spec content: enable_board_spec
enable_board_spec: etc/specs.conf enable_board_spec: etc/specs.conf
echo "SPECS += wand_quad" >> etc/specs.conf echo "SPECS += wand_quad" >> etc/specs.conf
content: src/drivers/timer content: include/os/attached_mmio.h
src/drivers/timer:
mkdir -p $@
cp -r $(addprefix $(GENODE_DIR)/repos/os/$@/,$(TIMER_SRC)) $@
content: include/spec/arm_v7/trace/timestamp.h include/os/attached_mmio.h
include/%.h: include/%.h:
mkdir -p $(dir $@) mkdir -p $(dir $@)
@ -43,5 +35,5 @@ src/tool/elfloader: src/kernel/sel4
content: content:
mv lib/mk/spec/arm/ld-sel4.mk lib/mk/spec/arm/ld.mk; mv lib/mk/spec/arm/ld-sel4.mk lib/mk/spec/arm/ld.mk;
sed -i "s/ld-sel4/ld/" src/lib/ld/sel4/target.mk sed -i "s/ld-sel4/ld/" src/lib/ld/sel4/target.mk
sed -i "s/wand_quad_timer_drv/timer/" src/drivers/timer/epit/wand_quad/target.mk sed -i "s/wand_quad_timer_drv/timer/" src/timer/epit/wand_quad/target.inc

View File

@ -1,20 +1,5 @@
include $(GENODE_DIR)/repos/base/recipes/src/base_content.inc include $(GENODE_DIR)/repos/base/recipes/src/base_content.inc
TIMER_SRC := main.cc target.inc pit include
content: src/drivers/timer
src/drivers/timer:
mkdir -p $@
cp -r $(addprefix $(GENODE_DIR)/repos/os/$@/,$(TIMER_SRC)) $@
content: include/spec/x86_32/trace/timestamp.h include/spec/x86_64/trace/timestamp.h
include/spec/%/trace/timestamp.h:
mkdir -p $(dir $@)
cp $(GENODE_DIR)/repos/os/$@ $@
content: README content: README
README: README:
cp $(REP_DIR)/recipes/src/base-sel4-x86/README $@ cp $(REP_DIR)/recipes/src/base-sel4-x86/README $@
@ -32,11 +17,10 @@ KERNEL_PORT_DIR := $(call port_dir,$(REP_DIR)/ports/sel4)
src/kernel/sel4: src/kernel src/kernel/sel4: src/kernel
cp -r $(KERNEL_PORT_DIR)/src/kernel/sel4/* $@ cp -r $(KERNEL_PORT_DIR)/src/kernel/sel4/* $@
content: content:
for spec in x86_32 x86_64 arm; do \ for spec in x86_32 x86_64 arm; do \
mv lib/mk/spec/$$spec/ld-sel4.mk lib/mk/spec/$$spec/ld.mk; \ mv lib/mk/spec/$$spec/ld-sel4.mk lib/mk/spec/$$spec/ld.mk; \
done; done;
sed -i "s/ld-sel4/ld/" src/lib/ld/sel4/target.mk sed -i "s/ld-sel4/ld/" src/lib/ld/sel4/target.mk
sed -i "s/pit_timer_drv/timer/" src/drivers/timer/pit/target.mk sed -i "s/pit_timer_drv/timer/" src/timer/pit/target.inc

View File

@ -0,0 +1 @@
include $(call select_from_repositories,src/timer/epit/wand_quad/target.inc)

View File

@ -0,0 +1 @@
include $(call select_from_repositories,src/timer/pit/target.inc)

View File

@ -11,8 +11,8 @@
* under the terms of the GNU Affero General Public License version 3. * under the terms of the GNU Affero General Public License version 3.
*/ */
#ifndef _INCLUDE__OS__ALARM_H_ #ifndef _INCLUDE__BASE__ALARM_H_
#define _INCLUDE__OS__ALARM_H_ #define _INCLUDE__BASE__ALARM_H_
#include <base/lock.h> #include <base/lock.h>
@ -186,4 +186,4 @@ class Genode::Alarm_scheduler
bool head_timeout(const Alarm * alarm) { return _head == alarm; } bool head_timeout(const Alarm * alarm) { return _head == alarm; }
}; };
#endif /* _INCLUDE__OS__ALARM_H_ */ #endif /* _INCLUDE__BASE__ALARM_H_ */

View File

@ -11,8 +11,8 @@
* under the terms of the GNU Affero General Public License version 3. * under the terms of the GNU Affero General Public License version 3.
*/ */
#ifndef _OS__DURATION_H_ #ifndef _INCLUDE__BASE__DURATION_H_
#define _OS__DURATION_H_ #define _INCLUDE__BASE__DURATION_H_
/* Genode includes */ /* Genode includes */
#include <base/stdint.h> #include <base/stdint.h>
@ -115,4 +115,4 @@ namespace Genode
return (x.value > y.value) ? x : y; } return (x.value > y.value) ? x : y; }
}; };
#endif /* _OS__DURATION_H_ */ #endif /* _INCLUDE__BASE__DURATION_H_ */

View File

@ -16,13 +16,13 @@
* under the terms of the GNU Affero General Public License version 3. * under the terms of the GNU Affero General Public License version 3.
*/ */
#ifndef _INCLUDE__OS__TIMED_SEMAPHORE_H_ #ifndef _INCLUDE__BASE__TIMED_SEMAPHORE_H_
#define _INCLUDE__OS__TIMED_SEMAPHORE_H_ #define _INCLUDE__BASE__TIMED_SEMAPHORE_H_
#include <base/thread.h> #include <base/thread.h>
#include <base/semaphore.h> #include <base/semaphore.h>
#include <base/alarm.h>
#include <timer_session/connection.h> #include <timer_session/connection.h>
#include <os/alarm.h>
namespace Genode { namespace Genode {
@ -254,4 +254,4 @@ class Genode::Timed_semaphore : public Semaphore
void up() { Semaphore::up(); } void up() { Semaphore::up(); }
}; };
#endif /* _INCLUDE__OS__TIMED_SEMAPHORE_H_ */ #endif /* _INCLUDE__BASE__TIMED_SEMAPHORE_H_ */

View File

@ -23,7 +23,7 @@
#include <util/noncopyable.h> #include <util/noncopyable.h>
#include <base/lock.h> #include <base/lock.h>
#include <base/log.h> #include <base/log.h>
#include <os/duration.h> #include <base/duration.h>
namespace Genode { namespace Genode {

View File

@ -0,0 +1,3 @@
SRC_CC = alarm.cc
vpath alarm.cc $(call select_from_repositories,src/lib/alarm)

View File

@ -7,4 +7,4 @@ LIBS += alarm
INC_DIR += $(BASE_DIR)/src/include INC_DIR += $(BASE_DIR)/src/include
vpath % $(BASE_DIR)/../os/src/lib/timeout vpath % $(BASE_DIR)/src/lib/timeout

View File

@ -8,4 +8,4 @@ LIBS += alarm
INC_DIR += $(BASE_DIR)/src/include INC_DIR += $(BASE_DIR)/src/include
vpath % $(REP_DIR)/src/lib/timeout vpath % $(call select_from_repositories,src/lib/timeout)

View File

@ -6,11 +6,6 @@ ARCHS := riscv arm_v6 arm_v7 x86_32 x86_64
include: include:
mkdir -p include mkdir -p include
cp -r $(REP_DIR)/include/* $@/ cp -r $(REP_DIR)/include/* $@/
for a in ${ARCHS}; do \
mkdir -p include/spec/$$a/trace; \
cp $(GENODE_DIR)/repos/os/include/spec/$$a/trace/timestamp.h \
include/spec/$$a/trace; \
done
LIB_MK_FILES := base.mk ld.mk ldso-startup.mk LIB_MK_FILES := base.mk ld.mk ldso-startup.mk

View File

@ -0,0 +1,9 @@
MIRRORED_FROM_REP_DIR := include/timer_session include/timer
content: $(MIRRORED_FROM_REP_DIR) LICENSE
$(MIRRORED_FROM_REP_DIR):
$(mirror_from_rep_dir)
LICENSE:
cp $(GENODE_DIR)/LICENSE $@

View File

@ -2,9 +2,9 @@
# Common content rules shared among all base-<kernel> source archives # Common content rules shared among all base-<kernel> source archives
# #
content: src/include src/core src/lib src/drivers/timer lib/mk LICENSE content: src/include src/core src/lib src/timer lib/mk LICENSE
src/include src/core src/lib lib/mk: src/include src/core src/lib src/timer lib/mk:
mkdir -p $@ mkdir -p $@
cp -r $(GENODE_DIR)/repos/base/$@/* $@ cp -r $(GENODE_DIR)/repos/base/$@/* $@
cp -r $(REP_DIR)/$@/* $@ cp -r $(REP_DIR)/$@/* $@
@ -16,17 +16,3 @@ content: etc/specs.conf
etc/specs.conf: etc/specs.conf:
$(mirror_from_rep_dir) $(mirror_from_rep_dir)
MIRRORED_FROM_OS := $(addprefix lib/mk/,timeout.mk timeout-arm.mk alarm.mk timed_semaphore.mk)\
$(addprefix src/lib/,timeout alarm timed_semaphore) \
$(addprefix include/os/,alarm.h duration.h timed_semaphore.h) \
include/timer/timeout.h \
include/timer_session
content: $(MIRRORED_FROM_OS)
$(MIRRORED_FROM_OS): lib/mk
$(MIRRORED_FROM_OS):
mkdir -p $(dir $@)
cp -r $(GENODE_DIR)/repos/os/$@ $(dir $@)

View File

@ -1,7 +1,7 @@
SRC_DIR = src/test/timed_semaphore src/lib/timed_semaphore SRC_DIR = src/test/timed_semaphore src/lib/timed_semaphore src/lib/alarm
include $(GENODE_DIR)/repos/base/recipes/src/content.inc include $(GENODE_DIR)/repos/base/recipes/src/content.inc
MIRROR_FROM_REP_DIR := lib/mk/timed_semaphore.mk MIRROR_FROM_REP_DIR := lib/mk/timed_semaphore.mk lib/mk/alarm.mk
content: $(MIRROR_FROM_REP_DIR) content: $(MIRROR_FROM_REP_DIR)

View File

@ -1,5 +1,5 @@
# build program images # build program images
build { core init drivers/timer test/timer_accuracy } build { core init timer test/timer_accuracy }
# create directory where boot files are written to # create directory where boot files are written to
create_boot_directory create_boot_directory

View File

@ -12,7 +12,7 @@
*/ */
#include <base/log.h> #include <base/log.h>
#include <os/alarm.h> #include <base/alarm.h>
using namespace Genode; using namespace Genode;

View File

@ -19,7 +19,7 @@
#include <util/string.h> #include <util/string.h>
#include <base/thread.h> #include <base/thread.h>
#include <base/heap.h> #include <base/heap.h>
#include <os/timed_semaphore.h> #include <base/timed_semaphore.h>
/* base-internal includes */ /* base-internal includes */
#include <base/internal/unmanaged_singleton.h> #include <base/internal/unmanaged_singleton.h>

View File

@ -11,7 +11,7 @@
* under the terms of the GNU Affero General Public License version 3. * under the terms of the GNU Affero General Public License version 3.
*/ */
#include <os/timed_semaphore.h> #include <base/timed_semaphore.h>
Genode::Env *Genode::Timeout_thread::_env = nullptr; Genode::Env *Genode::Timeout_thread::_env = nullptr;

View File

@ -12,7 +12,7 @@
*/ */
/* Genode includes */ /* Genode includes */
#include <os/duration.h> #include <base/duration.h>
using namespace Genode; using namespace Genode;

View File

@ -14,7 +14,7 @@
/* Genode includes */ /* Genode includes */
#include <timer_session/connection.h> #include <timer_session/connection.h>
#include <os/timed_semaphore.h> #include <base/timed_semaphore.h>
#include <base/thread.h> #include <base/thread.h>
#include <base/component.h> #include <base/component.h>

View File

@ -0,0 +1,9 @@
TARGET = wand_quad_timer_drv
REQUIRES = wand_quad
GEN_DIR := $(dir $(call select_from_repositories,src/timer/main.cc))
INC_DIR += $(GEN_DIR)/epit
SRC_CC += epit/time_source.cc epit/wand_quad/timer.cc
include $(GEN_DIR)/target.inc
vpath %.cc $(GEN_DIR)

View File

@ -0,0 +1,9 @@
TARGET = pit_timer_drv
REQUIRES = x86
GEN_DIR := $(dir $(call select_from_repositories,src/timer/main.cc))
INC_DIR += $(GEN_DIR)/pit
SRC_CC += time_source.cc
include $(GEN_DIR)/target.inc
vpath time_source.cc $(GEN_DIR)/pit

View File

@ -18,7 +18,7 @@
/* Genode includes */ /* Genode includes */
#include <io_port_session/connection.h> #include <io_port_session/connection.h>
#include <irq_session/connection.h> #include <irq_session/connection.h>
#include <os/duration.h> #include <base/duration.h>
/* local includes */ /* local includes */
#include <signalled_time_source.h> #include <signalled_time_source.h>

View File

@ -0,0 +1,5 @@
SRC_CC += main.cc
LIBS += base
INC_DIR += $(call select_from_repositories,src/timer/include)
vpath main.cc $(dir $(call select_from_repositories,src/timer/main.cc))

View File

@ -16,8 +16,7 @@ if {[have_spec linux]} {
# #
set build_components { set build_components {
core init core init timer
drivers/timer
drivers/audio drivers/audio
test/audio_in test/audio_in
} }

View File

@ -17,8 +17,7 @@ set use_mixer 0
# #
set build_components { set build_components {
core init core init timer
drivers/timer
drivers/audio drivers/audio
test/audio_out test/audio_out
} }

View File

@ -3,8 +3,7 @@
# #
set build_components { set build_components {
core init core init timer
drivers/timer
drivers/framebuffer/intel drivers/framebuffer/intel
test/framebuffer test/framebuffer
server/report_rom server/report_rom

View File

@ -12,8 +12,8 @@ proc gpio_drv { } { if {[have_spec rpi] && [have_spec hw]} { return hw_gpio_drv
return gpio_drv } return gpio_drv }
set build_components { set build_components {
core init core init timer
drivers/timer drivers/nic drivers/nic
test/lxip/http_srv test/lxip/http_srv
} }

View File

@ -6,8 +6,8 @@ set use_nic_driver [expr [have_spec linux] || [expr !$use_usb_driver && ![have_s
# #
set build_components { set build_components {
core init core init timer
drivers/timer drivers/nic drivers/nic
test/lxip/udp_echo test/lxip/udp_echo
} }

View File

@ -25,7 +25,7 @@ proc platform_drv_priority {} { return { priority="-1"} }
append build_components { core } append build_components { core }
append build_components { init } append build_components { init }
append build_components { drivers/timer } append build_components { timer }
append build_components { server/nic_router } append build_components { server/nic_router }
append build_components { server/dynamic_rom } append build_components { server/dynamic_rom }
append build_components { server/report_rom } append build_components { server/report_rom }

View File

@ -58,8 +58,7 @@ if { [get_cmd_switch --autopilot] && ![have_spec x86_64] } {
# #
set build_components { set build_components {
core init core init timer
drivers/timer
drivers/usb_host drivers/usb_host
drivers/usb_hid drivers/usb_hid
test/input test/input

View File

@ -3,8 +3,7 @@
# #
set build_components { set build_components {
core init core init timer
drivers/timer
drivers/usb drivers/usb
test/input test/input
} }

View File

@ -23,8 +23,7 @@ if { [get_cmd_switch --autopilot] && ![have_spec x86_64] } {
# #
set build_components { set build_components {
core init core init timer
drivers/timer
drivers/usb drivers/usb
test/input test/input
server/dynamic_rom server/dynamic_rom

Some files were not shown because too many files have changed in this diff Show More