From d4b56eb3ccdbe1e5054811b4de6a18a04c1ae36d Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 8 Aug 2014 14:43:02 -0600 Subject: [PATCH] Move clock functions from sched/ to sched/clock --- arch/8051/src/up_timerisr.c | 2 +- arch/8051/src/up_unblocktask.c | 2 +- arch/arm/src/arm/up_unblocktask.c | 2 +- arch/arm/src/armv6-m/up_unblocktask.c | 2 +- arch/arm/src/armv7-a/arm_unblocktask.c | 2 +- arch/arm/src/armv7-m/up_unblocktask.c | 2 +- arch/arm/src/c5471/c5471_timerisr.c | 2 +- arch/arm/src/dm320/dm320_timerisr.c | 2 +- arch/arm/src/imx/imx_timerisr.c | 2 +- arch/arm/src/kinetis/kinetis_timerisr.c | 2 +- arch/arm/src/kl/kl_timerisr.c | 2 +- arch/arm/src/lpc17xx/lpc17_timerisr.c | 2 +- arch/arm/src/lpc214x/lpc214x_timerisr.c | 2 +- arch/arm/src/lpc2378/lpc23xx_timerisr.c | 2 +- arch/arm/src/lpc31xx/lpc31_timerisr.c | 2 +- arch/arm/src/lpc43xx/lpc43_timerisr.c | 2 +- arch/arm/src/nuc1xx/nuc_timerisr.c | 2 +- arch/arm/src/sam34/sam_timerisr.c | 2 +- arch/arm/src/samd/sam_timerisr.c | 2 +- arch/arm/src/stm32/stm32_timerisr.c | 2 +- arch/arm/src/str71x/str71x_timerisr.c | 2 +- arch/arm/src/tiva/tiva_timerisr.c | 2 +- arch/avr/src/avr/up_unblocktask.c | 2 +- arch/avr/src/avr32/up_unblocktask.c | 2 +- arch/hc/src/common/up_unblocktask.c | 2 +- arch/hc/src/m9s12/m9s12_timerisr.c | 2 +- arch/mips/src/mips32/up_unblocktask.c | 2 +- arch/mips/src/pic32mx/pic32mx-timerisr.c | 2 +- arch/sh/src/common/up_unblocktask.c | 2 +- arch/sh/src/m16c/m16c_timerisr.c | 2 +- arch/sh/src/sh1/sh1_timerisr.c | 2 +- arch/sim/src/up_unblocktask.c | 2 +- arch/x86/src/common/up_unblocktask.c | 2 +- arch/x86/src/qemu/qemu_timerisr.c | 2 +- arch/z16/src/common/up_unblocktask.c | 2 +- arch/z16/src/z16f/z16f_timerisr.c | 2 +- arch/z80/src/common/up_unblocktask.c | 2 +- arch/z80/src/ez80/ez80_timerisr.c | 2 +- arch/z80/src/z180/z180_timerisr.c | 2 +- arch/z80/src/z8/z8_timerisr.c | 2 +- configs/xtrs/src/xtr_timerisr.c | 2 +- configs/z80sim/src/z80_timerisr.c | 2 +- sched/Makefile | 9 ++--- sched/clock/Make.defs | 43 +++++++++++++++++++++++ sched/{clock_internal.h => clock/clock.h} | 8 ++--- sched/{ => clock}/clock_abstime2ticks.c | 6 ++-- sched/{ => clock}/clock_dow.c | 4 +-- sched/{ => clock}/clock_getres.c | 4 +-- sched/{ => clock}/clock_gettime.c | 4 +-- sched/{ => clock}/clock_gettimeofday.c | 4 +-- sched/{ => clock}/clock_initialize.c | 4 +-- sched/{ => clock}/clock_settime.c | 4 +-- sched/{ => clock}/clock_systimer.c | 4 +-- sched/{ => clock}/clock_ticks2time.c | 4 +-- sched/{ => clock}/clock_time2ticks.c | 4 +-- sched/mqueue/mq_timedreceive.c | 2 +- sched/mqueue/mq_timedsend.c | 2 +- sched/nanosleep.c | 2 +- sched/os_start.c | 2 +- sched/pthread/pthread_condtimedwait.c | 2 +- sched/pthread/pthread_create.c | 2 +- sched/sched_processtimer.c | 2 +- sched/sched_rrgetinterval.c | 2 +- sched/sched_setscheduler.c | 2 +- sched/sched_timerexpiration.c | 2 +- sched/semaphore/sem_timedwait.c | 2 +- sched/signal/sig_timedwait.c | 2 +- sched/timer_gettime.c | 2 +- sched/timer_settime.c | 2 +- 69 files changed, 127 insertions(+), 87 deletions(-) create mode 100644 sched/clock/Make.defs rename sched/{clock_internal.h => clock/clock.h} (96%) rename sched/{ => clock}/clock_abstime2ticks.c (98%) rename sched/{ => clock}/clock_dow.c (98%) rename sched/{ => clock}/clock_getres.c (98%) rename sched/{ => clock}/clock_gettime.c (99%) rename sched/{ => clock}/clock_gettimeofday.c (98%) rename sched/{ => clock}/clock_initialize.c (99%) rename sched/{ => clock}/clock_settime.c (98%) rename sched/{ => clock}/clock_systimer.c (98%) rename sched/{ => clock}/clock_ticks2time.c (98%) rename sched/{ => clock}/clock_time2ticks.c (98%) diff --git a/arch/8051/src/up_timerisr.c b/arch/8051/src/up_timerisr.c index edf7e50592..7abe5d2fe6 100644 --- a/arch/8051/src/up_timerisr.c +++ b/arch/8051/src/up_timerisr.c @@ -45,7 +45,7 @@ #include #include <8052.h> -#include "clock_internal.h" +#include "clock/clock.h" #include "up_internal.h" /************************************************************************ diff --git a/arch/8051/src/up_unblocktask.c b/arch/8051/src/up_unblocktask.c index cb4e65fc0b..451487f1ba 100644 --- a/arch/8051/src/up_unblocktask.c +++ b/arch/8051/src/up_unblocktask.c @@ -44,7 +44,7 @@ #include -#include "clock_internal.h" +#include "clock/clock.h" #include "os_internal.h" #include "up_internal.h" diff --git a/arch/arm/src/arm/up_unblocktask.c b/arch/arm/src/arm/up_unblocktask.c index 3476441b41..696007b80e 100644 --- a/arch/arm/src/arm/up_unblocktask.c +++ b/arch/arm/src/arm/up_unblocktask.c @@ -44,7 +44,7 @@ #include #include "os_internal.h" -#include "clock_internal.h" +#include "clock/clock.h" #include "up_internal.h" /**************************************************************************** diff --git a/arch/arm/src/armv6-m/up_unblocktask.c b/arch/arm/src/armv6-m/up_unblocktask.c index 7a76a24d83..fa6b8c6525 100644 --- a/arch/arm/src/armv6-m/up_unblocktask.c +++ b/arch/arm/src/armv6-m/up_unblocktask.c @@ -44,7 +44,7 @@ #include #include "os_internal.h" -#include "clock_internal.h" +#include "clock/clock.h" #include "up_internal.h" /**************************************************************************** diff --git a/arch/arm/src/armv7-a/arm_unblocktask.c b/arch/arm/src/armv7-a/arm_unblocktask.c index c5ca090928..71106fd252 100644 --- a/arch/arm/src/armv7-a/arm_unblocktask.c +++ b/arch/arm/src/armv7-a/arm_unblocktask.c @@ -44,7 +44,7 @@ #include #include "os_internal.h" -#include "clock_internal.h" +#include "clock/clock.h" #include "up_internal.h" /**************************************************************************** diff --git a/arch/arm/src/armv7-m/up_unblocktask.c b/arch/arm/src/armv7-m/up_unblocktask.c index f2455e594a..bd83ace9ff 100644 --- a/arch/arm/src/armv7-m/up_unblocktask.c +++ b/arch/arm/src/armv7-m/up_unblocktask.c @@ -44,7 +44,7 @@ #include #include "os_internal.h" -#include "clock_internal.h" +#include "clock/clock.h" #include "up_internal.h" /**************************************************************************** diff --git a/arch/arm/src/c5471/c5471_timerisr.c b/arch/arm/src/c5471/c5471_timerisr.c index fc1143162d..d253ee1436 100644 --- a/arch/arm/src/c5471/c5471_timerisr.c +++ b/arch/arm/src/c5471/c5471_timerisr.c @@ -45,7 +45,7 @@ #include "chip.h" #include "up_arch.h" -#include "clock_internal.h" +#include "clock/clock.h" #include "up_internal.h" /************************************************************ diff --git a/arch/arm/src/dm320/dm320_timerisr.c b/arch/arm/src/dm320/dm320_timerisr.c index fae3407148..193138a2b0 100644 --- a/arch/arm/src/dm320/dm320_timerisr.c +++ b/arch/arm/src/dm320/dm320_timerisr.c @@ -46,7 +46,7 @@ #include "chip.h" #include "up_arch.h" -#include "clock_internal.h" +#include "clock/clock.h" #include "up_internal.h" /**************************************************************************** diff --git a/arch/arm/src/imx/imx_timerisr.c b/arch/arm/src/imx/imx_timerisr.c index d21b804c60..eab5f24e44 100644 --- a/arch/arm/src/imx/imx_timerisr.c +++ b/arch/arm/src/imx/imx_timerisr.c @@ -48,7 +48,7 @@ #include "chip.h" #include "up_arch.h" -#include "clock_internal.h" +#include "clock/clock.h" #include "up_internal.h" /**************************************************************************** diff --git a/arch/arm/src/kinetis/kinetis_timerisr.c b/arch/arm/src/kinetis/kinetis_timerisr.c index b4bde4caea..f00c29babc 100644 --- a/arch/arm/src/kinetis/kinetis_timerisr.c +++ b/arch/arm/src/kinetis/kinetis_timerisr.c @@ -47,7 +47,7 @@ #include #include "nvic.h" -#include "clock_internal.h" +#include "clock/clock.h" #include "up_internal.h" #include "up_arch.h" diff --git a/arch/arm/src/kl/kl_timerisr.c b/arch/arm/src/kl/kl_timerisr.c index fe1cd16816..31dc2ba5de 100644 --- a/arch/arm/src/kl/kl_timerisr.c +++ b/arch/arm/src/kl/kl_timerisr.c @@ -46,7 +46,7 @@ #include #include "nvic.h" -#include "clock_internal.h" +#include "clock/clock.h" #include "up_internal.h" #include "up_arch.h" diff --git a/arch/arm/src/lpc17xx/lpc17_timerisr.c b/arch/arm/src/lpc17xx/lpc17_timerisr.c index 4aec2da40a..572712e907 100644 --- a/arch/arm/src/lpc17xx/lpc17_timerisr.c +++ b/arch/arm/src/lpc17xx/lpc17_timerisr.c @@ -47,7 +47,7 @@ #include #include "nvic.h" -#include "clock_internal.h" +#include "clock/clock.h" #include "up_internal.h" #include "up_arch.h" diff --git a/arch/arm/src/lpc214x/lpc214x_timerisr.c b/arch/arm/src/lpc214x/lpc214x_timerisr.c index 6039939abf..f80bce0183 100644 --- a/arch/arm/src/lpc214x/lpc214x_timerisr.c +++ b/arch/arm/src/lpc214x/lpc214x_timerisr.c @@ -46,7 +46,7 @@ #include "chip.h" #include "up_arch.h" -#include "clock_internal.h" +#include "clock/clock.h" #include "up_internal.h" #include "lpc214x_timer.h" diff --git a/arch/arm/src/lpc2378/lpc23xx_timerisr.c b/arch/arm/src/lpc2378/lpc23xx_timerisr.c index 1b655fc9af..9005283d15 100644 --- a/arch/arm/src/lpc2378/lpc23xx_timerisr.c +++ b/arch/arm/src/lpc2378/lpc23xx_timerisr.c @@ -48,7 +48,7 @@ #include #include -#include "clock_internal.h" +#include "clock/clock.h" #include "internal.h" #include "up_arch.h" diff --git a/arch/arm/src/lpc31xx/lpc31_timerisr.c b/arch/arm/src/lpc31xx/lpc31_timerisr.c index 9678433992..1564096778 100644 --- a/arch/arm/src/lpc31xx/lpc31_timerisr.c +++ b/arch/arm/src/lpc31xx/lpc31_timerisr.c @@ -46,7 +46,7 @@ #include #include -#include "clock_internal.h" +#include "clock/clock.h" #include "up_internal.h" #include "up_arch.h" diff --git a/arch/arm/src/lpc43xx/lpc43_timerisr.c b/arch/arm/src/lpc43xx/lpc43_timerisr.c index 81a2937c50..e384be7015 100644 --- a/arch/arm/src/lpc43xx/lpc43_timerisr.c +++ b/arch/arm/src/lpc43xx/lpc43_timerisr.c @@ -47,7 +47,7 @@ #include #include "nvic.h" -#include "clock_internal.h" +#include "clock/clock.h" #include "up_internal.h" #include "up_arch.h" diff --git a/arch/arm/src/nuc1xx/nuc_timerisr.c b/arch/arm/src/nuc1xx/nuc_timerisr.c index 6b895ca095..3840a13c1d 100644 --- a/arch/arm/src/nuc1xx/nuc_timerisr.c +++ b/arch/arm/src/nuc1xx/nuc_timerisr.c @@ -46,7 +46,7 @@ #include #include "nvic.h" -#include "clock_internal.h" +#include "clock/clock.h" #include "up_internal.h" #include "up_arch.h" diff --git a/arch/arm/src/sam34/sam_timerisr.c b/arch/arm/src/sam34/sam_timerisr.c index d4793a114c..98c1ac1934 100644 --- a/arch/arm/src/sam34/sam_timerisr.c +++ b/arch/arm/src/sam34/sam_timerisr.c @@ -46,7 +46,7 @@ #include #include "nvic.h" -#include "clock_internal.h" +#include "clock/clock.h" #include "up_internal.h" #include "up_arch.h" diff --git a/arch/arm/src/samd/sam_timerisr.c b/arch/arm/src/samd/sam_timerisr.c index 766486f02b..d169869436 100644 --- a/arch/arm/src/samd/sam_timerisr.c +++ b/arch/arm/src/samd/sam_timerisr.c @@ -46,7 +46,7 @@ #include #include "nvic.h" -#include "clock_internal.h" +#include "clock/clock.h" #include "up_internal.h" #include "up_arch.h" diff --git a/arch/arm/src/stm32/stm32_timerisr.c b/arch/arm/src/stm32/stm32_timerisr.c index 6d739eb2cf..1822bbc52a 100644 --- a/arch/arm/src/stm32/stm32_timerisr.c +++ b/arch/arm/src/stm32/stm32_timerisr.c @@ -46,7 +46,7 @@ #include #include "nvic.h" -#include "clock_internal.h" +#include "clock/clock.h" #include "up_internal.h" #include "up_arch.h" diff --git a/arch/arm/src/str71x/str71x_timerisr.c b/arch/arm/src/str71x/str71x_timerisr.c index c11bd53bf4..39c257671c 100644 --- a/arch/arm/src/str71x/str71x_timerisr.c +++ b/arch/arm/src/str71x/str71x_timerisr.c @@ -47,7 +47,7 @@ #include "chip.h" #include "up_arch.h" -#include "clock_internal.h" +#include "clock/clock.h" #include "up_internal.h" #include "str71x_internal.h" diff --git a/arch/arm/src/tiva/tiva_timerisr.c b/arch/arm/src/tiva/tiva_timerisr.c index 6f371a33a9..70cfacc821 100644 --- a/arch/arm/src/tiva/tiva_timerisr.c +++ b/arch/arm/src/tiva/tiva_timerisr.c @@ -46,7 +46,7 @@ #include #include "nvic.h" -#include "clock_internal.h" +#include "clock/clock.h" #include "up_internal.h" #include "up_arch.h" diff --git a/arch/avr/src/avr/up_unblocktask.c b/arch/avr/src/avr/up_unblocktask.c index 6fb2e67e5c..3947c3e8b7 100644 --- a/arch/avr/src/avr/up_unblocktask.c +++ b/arch/avr/src/avr/up_unblocktask.c @@ -44,7 +44,7 @@ #include #include "os_internal.h" -#include "clock_internal.h" +#include "clock/clock.h" #include "up_internal.h" /**************************************************************************** diff --git a/arch/avr/src/avr32/up_unblocktask.c b/arch/avr/src/avr32/up_unblocktask.c index f53550da90..c124d97332 100644 --- a/arch/avr/src/avr32/up_unblocktask.c +++ b/arch/avr/src/avr32/up_unblocktask.c @@ -44,7 +44,7 @@ #include #include "os_internal.h" -#include "clock_internal.h" +#include "clock/clock.h" #include "up_internal.h" /**************************************************************************** diff --git a/arch/hc/src/common/up_unblocktask.c b/arch/hc/src/common/up_unblocktask.c index 425db0f981..379ccdde20 100644 --- a/arch/hc/src/common/up_unblocktask.c +++ b/arch/hc/src/common/up_unblocktask.c @@ -44,7 +44,7 @@ #include #include "os_internal.h" -#include "clock_internal.h" +#include "clock/clock.h" #include "up_internal.h" /**************************************************************************** diff --git a/arch/hc/src/m9s12/m9s12_timerisr.c b/arch/hc/src/m9s12/m9s12_timerisr.c index 2658e440a9..dd954c097e 100644 --- a/arch/hc/src/m9s12/m9s12_timerisr.c +++ b/arch/hc/src/m9s12/m9s12_timerisr.c @@ -46,7 +46,7 @@ #include #include -#include "clock_internal.h" +#include "clock/clock.h" #include "up_internal.h" #include "up_arch.h" diff --git a/arch/mips/src/mips32/up_unblocktask.c b/arch/mips/src/mips32/up_unblocktask.c index dab958b159..470942b846 100644 --- a/arch/mips/src/mips32/up_unblocktask.c +++ b/arch/mips/src/mips32/up_unblocktask.c @@ -46,7 +46,7 @@ #include #include "os_internal.h" -#include "clock_internal.h" +#include "clock/clock.h" #include "up_internal.h" /**************************************************************************** diff --git a/arch/mips/src/pic32mx/pic32mx-timerisr.c b/arch/mips/src/pic32mx/pic32mx-timerisr.c index 0a8b096f6b..a08b7b8563 100644 --- a/arch/mips/src/pic32mx/pic32mx-timerisr.c +++ b/arch/mips/src/pic32mx/pic32mx-timerisr.c @@ -46,7 +46,7 @@ #include #include -#include "clock_internal.h" +#include "clock/clock.h" #include "up_internal.h" #include "up_arch.h" diff --git a/arch/sh/src/common/up_unblocktask.c b/arch/sh/src/common/up_unblocktask.c index a4b598499d..3978594cf6 100644 --- a/arch/sh/src/common/up_unblocktask.c +++ b/arch/sh/src/common/up_unblocktask.c @@ -44,7 +44,7 @@ #include #include "os_internal.h" -#include "clock_internal.h" +#include "clock/clock.h" #include "up_internal.h" /**************************************************************************** diff --git a/arch/sh/src/m16c/m16c_timerisr.c b/arch/sh/src/m16c/m16c_timerisr.c index 04d4a619bb..9b02099c4b 100644 --- a/arch/sh/src/m16c/m16c_timerisr.c +++ b/arch/sh/src/m16c/m16c_timerisr.c @@ -46,7 +46,7 @@ #include #include -#include "clock_internal.h" +#include "clock/clock.h" #include "up_internal.h" #include "up_arch.h" diff --git a/arch/sh/src/sh1/sh1_timerisr.c b/arch/sh/src/sh1/sh1_timerisr.c index fe0ab89c50..2f988984f0 100644 --- a/arch/sh/src/sh1/sh1_timerisr.c +++ b/arch/sh/src/sh1/sh1_timerisr.c @@ -46,7 +46,7 @@ #include #include -#include "clock_internal.h" +#include "clock/clock.h" #include "up_internal.h" #include "up_arch.h" diff --git a/arch/sim/src/up_unblocktask.c b/arch/sim/src/up_unblocktask.c index 2da05edcc4..66f7a6d34f 100644 --- a/arch/sim/src/up_unblocktask.c +++ b/arch/sim/src/up_unblocktask.c @@ -43,7 +43,7 @@ #include #include -#include "clock_internal.h" +#include "clock/clock.h" #include "os_internal.h" #include "up_internal.h" diff --git a/arch/x86/src/common/up_unblocktask.c b/arch/x86/src/common/up_unblocktask.c index 9e5597f16c..89dcf5418c 100644 --- a/arch/x86/src/common/up_unblocktask.c +++ b/arch/x86/src/common/up_unblocktask.c @@ -44,7 +44,7 @@ #include #include "os_internal.h" -#include "clock_internal.h" +#include "clock/clock.h" #include "up_internal.h" /**************************************************************************** diff --git a/arch/x86/src/qemu/qemu_timerisr.c b/arch/x86/src/qemu/qemu_timerisr.c index 4ca7cf5209..111b521269 100644 --- a/arch/x86/src/qemu/qemu_timerisr.c +++ b/arch/x86/src/qemu/qemu_timerisr.c @@ -51,7 +51,7 @@ #include #include -#include "clock_internal.h" +#include "clock/clock.h" #include "up_internal.h" #include "up_arch.h" diff --git a/arch/z16/src/common/up_unblocktask.c b/arch/z16/src/common/up_unblocktask.c index 28bb954178..fab6e9a84c 100644 --- a/arch/z16/src/common/up_unblocktask.c +++ b/arch/z16/src/common/up_unblocktask.c @@ -46,7 +46,7 @@ #include "chip/chip.h" #include "os_internal.h" -#include "clock_internal.h" +#include "clock/clock.h" #include "up_internal.h" /**************************************************************************** diff --git a/arch/z16/src/z16f/z16f_timerisr.c b/arch/z16/src/z16f/z16f_timerisr.c index 2016b557df..79f1dc2eb9 100644 --- a/arch/z16/src/z16f/z16f_timerisr.c +++ b/arch/z16/src/z16f/z16f_timerisr.c @@ -46,7 +46,7 @@ #include #include "chip/chip.h" -#include "clock_internal.h" +#include "clock/clock.h" #include "up_internal.h" /*************************************************************************** diff --git a/arch/z80/src/common/up_unblocktask.c b/arch/z80/src/common/up_unblocktask.c index bc829db0d0..3ce1e5a172 100644 --- a/arch/z80/src/common/up_unblocktask.c +++ b/arch/z80/src/common/up_unblocktask.c @@ -47,7 +47,7 @@ #include "chip/chip.h" #include "chip/switch.h" #include "os_internal.h" -#include "clock_internal.h" +#include "clock/clock.h" #include "up_internal.h" /**************************************************************************** diff --git a/arch/z80/src/ez80/ez80_timerisr.c b/arch/z80/src/ez80/ez80_timerisr.c index abda728771..4fbc49c0db 100644 --- a/arch/z80/src/ez80/ez80_timerisr.c +++ b/arch/z80/src/ez80/ez80_timerisr.c @@ -46,7 +46,7 @@ #include #include "chip/chip.h" -#include "clock_internal.h" +#include "clock/clock.h" #include "up_internal.h" /*************************************************************************** diff --git a/arch/z80/src/z180/z180_timerisr.c b/arch/z80/src/z180/z180_timerisr.c index 55a52c9cb6..35d21c5a0a 100644 --- a/arch/z80/src/z180/z180_timerisr.c +++ b/arch/z80/src/z180/z180_timerisr.c @@ -45,7 +45,7 @@ #include -#include "clock_internal.h" +#include "clock/clock.h" #include "up_internal.h" #include "chip.h" diff --git a/arch/z80/src/z8/z8_timerisr.c b/arch/z80/src/z8/z8_timerisr.c index 92113e4823..b4b620f2bd 100644 --- a/arch/z80/src/z8/z8_timerisr.c +++ b/arch/z80/src/z8/z8_timerisr.c @@ -46,7 +46,7 @@ #include #include "chip/chip.h" -#include "clock_internal.h" +#include "clock/clock.h" #include "up_internal.h" /*************************************************************************** diff --git a/configs/xtrs/src/xtr_timerisr.c b/configs/xtrs/src/xtr_timerisr.c index 893a41493e..fea2c682d1 100644 --- a/configs/xtrs/src/xtr_timerisr.c +++ b/configs/xtrs/src/xtr_timerisr.c @@ -43,7 +43,7 @@ #include -#include "clock_internal.h" +#include "clock/clock.h" #include "up_internal.h" /**************************************************************************** diff --git a/configs/z80sim/src/z80_timerisr.c b/configs/z80sim/src/z80_timerisr.c index 51ae04add9..8616894851 100644 --- a/configs/z80sim/src/z80_timerisr.c +++ b/configs/z80sim/src/z80_timerisr.c @@ -43,7 +43,7 @@ #include -#include "clock_internal.h" +#include "clock/clock.h" #include "up_internal.h" /**************************************************************************** diff --git a/sched/Makefile b/sched/Makefile index cc2d1f3e8e..fb34c75894 100644 --- a/sched/Makefile +++ b/sched/Makefile @@ -110,10 +110,6 @@ ifneq ($(CONFIG_DISABLE_SIGNALS),y) TIME_SRCS += nanosleep.c endif -CLOCK_SRCS = clock_initialize.c clock_settime.c clock_gettime.c clock_getres.c -CLOCK_SRCS += clock_time2ticks.c clock_abstime2ticks.c clock_ticks2time.c -CLOCK_SRCS += clock_gettimeofday.c clock_systimer.c - ifneq ($(CONFIG_DISABLE_POSIX_TIMERS),y) TIMER_SRCS += timer_initialize.c timer_create.c timer_delete.c timer_getoverrun.c TIMER_SRCS += timer_gettime.c timer_settime.c timer_release.c @@ -130,11 +126,12 @@ include semaphore/Make.defs include signal/Make.defs include pthread/Make.defs include mqueue/Make.defs +include clock/Make.defs include environ/Make.defs CSRCS = $(MISC_SRCS) $(TSK_SRCS) $(SCHED_SRCS) -CSRCS += $(TIME_SRCS) $(TIMER_SRCS) $(PGFILL_SRCS) $(CLOCK_SRCS) -CSRCS += $(IRQ_SRCS) $(GRP_SRCS) $(WDOG_SRCS) $(SEM_SRCS) $(SIGNAL_SRCS) $(PTHREAD_SRCS) $(MQUEUE_SRCS) $(ENV_SRCS) +CSRCS += $(TIME_SRCS) $(TIMER_SRCS) $(PGFILL_SRCS) +CSRCS += $(IRQ_SRCS) $(GRP_SRCS) $(WDOG_SRCS) $(SEM_SRCS) $(SIGNAL_SRCS) $(PTHREAD_SRCS) $(MQUEUE_SRCS) $(CLOCK_SRCS) $(ENV_SRCS) COBJS = $(CSRCS:.c=$(OBJEXT)) diff --git a/sched/clock/Make.defs b/sched/clock/Make.defs new file mode 100644 index 0000000000..aa7dce762a --- /dev/null +++ b/sched/clock/Make.defs @@ -0,0 +1,43 @@ +############################################################################ +# sched/clock/Make.defs +# +# Copyright (C) 2014 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# 3. Neither the name NuttX nor the names of its contributors may be +# used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# +############################################################################ + +CLOCK_SRCS = clock_initialize.c clock_settime.c clock_gettime.c clock_getres.c +CLOCK_SRCS += clock_time2ticks.c clock_abstime2ticks.c clock_ticks2time.c +CLOCK_SRCS += clock_gettimeofday.c clock_systimer.c + +# Include clock build support + +DEPPATH += --dep-path clock +VPATH += :clock diff --git a/sched/clock_internal.h b/sched/clock/clock.h similarity index 96% rename from sched/clock_internal.h rename to sched/clock/clock.h index db857743e2..976ec117fb 100644 --- a/sched/clock_internal.h +++ b/sched/clock/clock.h @@ -1,5 +1,5 @@ /******************************************************************************** - * sched/clock_internal.h + * sched/clock/clock.h * * Copyright (C) 2007-2009, 2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -33,8 +33,8 @@ * ********************************************************************************/ -#ifndef __SCHED_CLOCK_INTERNAL_H -#define __SCHED_CLOCK_INTERNAL_H +#ifndef __SCHED_CLOCK_CLOCK_H +#define __SCHED_CLOCK_CLOCK_H /******************************************************************************** * Included Files @@ -90,4 +90,4 @@ int clock_abstime2ticks(clockid_t clockid, int clock_time2ticks(FAR const struct timespec *reltime, FAR int *ticks); int clock_ticks2time(int ticks, FAR struct timespec *reltime); -#endif /* __SCHED_CLOCK_INTERNAL_H */ +#endif /* __SCHED_CLOCK_CLOCK_H */ diff --git a/sched/clock_abstime2ticks.c b/sched/clock/clock_abstime2ticks.c similarity index 98% rename from sched/clock_abstime2ticks.c rename to sched/clock/clock_abstime2ticks.c index 4f436dc144..1f8845d05d 100644 --- a/sched/clock_abstime2ticks.c +++ b/sched/clock/clock_abstime2ticks.c @@ -1,5 +1,5 @@ /******************************************************************************** - * clock_abstime2ticks.c + * sched/clock/clock_abstime2ticks.c * * Copyright (C) 2007, 2008, 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -42,10 +42,10 @@ #include #include #include -#include "clock_internal.h" +#include "clock/clock.h" /******************************************************************************** - * Definitions + * Pre-processor Definitions ********************************************************************************/ /******************************************************************************** diff --git a/sched/clock_dow.c b/sched/clock/clock_dow.c similarity index 98% rename from sched/clock_dow.c rename to sched/clock/clock_dow.c index 93bcfc2d94..00e9703bc5 100644 --- a/sched/clock_dow.c +++ b/sched/clock/clock_dow.c @@ -1,5 +1,5 @@ /**************************************************************************** - * sched/clock_dow.c + * sched/clock/clock_dow.c * * Copyright (C) 2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -43,7 +43,7 @@ #include -#include "clock_internal.h" +#include "clock/clock.h" /**************************************************************************** * Pre-processor Definitions diff --git a/sched/clock_getres.c b/sched/clock/clock_getres.c similarity index 98% rename from sched/clock_getres.c rename to sched/clock/clock_getres.c index edbc87bf04..5f4a0b6e86 100644 --- a/sched/clock_getres.c +++ b/sched/clock/clock_getres.c @@ -1,5 +1,5 @@ /************************************************************************ - * sched/clock_getres.c + * sched/clock/clock_getres.c * * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -44,7 +44,7 @@ #include #include -#include "clock_internal.h" +#include "clock/clock.h" /************************************************************************ * Definitions diff --git a/sched/clock_gettime.c b/sched/clock/clock_gettime.c similarity index 99% rename from sched/clock_gettime.c rename to sched/clock/clock_gettime.c index 5244bc531b..d0cc483708 100644 --- a/sched/clock_gettime.c +++ b/sched/clock/clock_gettime.c @@ -1,5 +1,5 @@ /************************************************************************ - * sched/clock_gettime.c + * sched/clock/clock_gettime.c * * Copyright (C) 2007, 2009, 2011, 2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -48,7 +48,7 @@ #include -#include "clock_internal.h" +#include "clock/clock.h" /************************************************************************ * Pre-processor Definitions diff --git a/sched/clock_gettimeofday.c b/sched/clock/clock_gettimeofday.c similarity index 98% rename from sched/clock_gettimeofday.c rename to sched/clock/clock_gettimeofday.c index 6437ef955d..46db6e6982 100644 --- a/sched/clock_gettimeofday.c +++ b/sched/clock/clock_gettimeofday.c @@ -1,5 +1,5 @@ /**************************************************************************** - * sched/clock_gettimeofday.c + * sched/clock/clock_gettimeofday.c * * Copyright (C) 2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -43,7 +43,7 @@ #include #include -#include "clock_internal.h" +#include "clock/clock.h" /**************************************************************************** * Definitions diff --git a/sched/clock_initialize.c b/sched/clock/clock_initialize.c similarity index 99% rename from sched/clock_initialize.c rename to sched/clock/clock_initialize.c index 374e675ac0..62a41cd696 100644 --- a/sched/clock_initialize.c +++ b/sched/clock/clock_initialize.c @@ -1,5 +1,5 @@ /**************************************************************************** - * sched/clock_initialize.c + * sched/clock/clock_initialize.c * * Copyright (C) 2007, 2009, 2011-2012 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -53,7 +53,7 @@ #include #include -#include "clock_internal.h" +#include "clock/clock.h" /**************************************************************************** * Definitions diff --git a/sched/clock_settime.c b/sched/clock/clock_settime.c similarity index 98% rename from sched/clock_settime.c rename to sched/clock/clock_settime.c index 302bead248..8d26da1559 100644 --- a/sched/clock_settime.c +++ b/sched/clock/clock_settime.c @@ -1,5 +1,5 @@ /************************************************************************ - * sched/clock_settime.c + * sched/clock/clock_settime.c * * Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -46,7 +46,7 @@ #include #include -#include "clock_internal.h" +#include "clock/clock.h" /************************************************************************ * Definitions diff --git a/sched/clock_systimer.c b/sched/clock/clock_systimer.c similarity index 98% rename from sched/clock_systimer.c rename to sched/clock/clock_systimer.c index 65487da6e7..1d24803efe 100644 --- a/sched/clock_systimer.c +++ b/sched/clock/clock_systimer.c @@ -1,5 +1,5 @@ /**************************************************************************** - * sched/clock_systimer.c + * sched/clock/clock_systimer.c * * Copyright (C) 2011, 2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -44,7 +44,7 @@ #include #include -#include "clock_internal.h" +#include "clock/clock.h" /**************************************************************************** * Pre-processor Definitions diff --git a/sched/clock_ticks2time.c b/sched/clock/clock_ticks2time.c similarity index 98% rename from sched/clock_ticks2time.c rename to sched/clock/clock_ticks2time.c index fd300692d2..4164876678 100644 --- a/sched/clock_ticks2time.c +++ b/sched/clock/clock_ticks2time.c @@ -1,5 +1,5 @@ /******************************************************************************** - * clock_ticks2time.c + * sched/clock/clock_ticks2time.c * * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -40,7 +40,7 @@ #include #include -#include "clock_internal.h" +#include "clock/clock.h" /******************************************************************************** * Definitions diff --git a/sched/clock_time2ticks.c b/sched/clock/clock_time2ticks.c similarity index 98% rename from sched/clock_time2ticks.c rename to sched/clock/clock_time2ticks.c index fc900c18cf..c54cc949bd 100644 --- a/sched/clock_time2ticks.c +++ b/sched/clock/clock_time2ticks.c @@ -1,5 +1,5 @@ /******************************************************************************** - * sched/clock_time2ticks.c + * sched/clock/clock_time2ticks.c * * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -42,7 +42,7 @@ #include #include -#include "clock_internal.h" +#include "clock/clock.h" /******************************************************************************** * Definitions diff --git a/sched/mqueue/mq_timedreceive.c b/sched/mqueue/mq_timedreceive.c index 081959c9c2..9ff42c86dc 100644 --- a/sched/mqueue/mq_timedreceive.c +++ b/sched/mqueue/mq_timedreceive.c @@ -51,7 +51,7 @@ #include #include "os_internal.h" -#include "clock_internal.h" +#include "clock/clock.h" #include "mqueue/mqueue.h" /**************************************************************************** diff --git a/sched/mqueue/mq_timedsend.c b/sched/mqueue/mq_timedsend.c index b3e79d48ed..3174c341bd 100644 --- a/sched/mqueue/mq_timedsend.c +++ b/sched/mqueue/mq_timedsend.c @@ -49,7 +49,7 @@ #include #include -#include "clock_internal.h" +#include "clock/clock.h" #include "os_internal.h" #include "mqueue/mqueue.h" diff --git a/sched/nanosleep.c b/sched/nanosleep.c index 4dc76de568..43414f2f23 100644 --- a/sched/nanosleep.c +++ b/sched/nanosleep.c @@ -47,7 +47,7 @@ #include #include -#include "clock_internal.h" +#include "clock/clock.h" /**************************************************************************** * Definitions diff --git a/sched/os_start.c b/sched/os_start.c index dc610222b8..dd5d79620a 100644 --- a/sched/os_start.c +++ b/sched/os_start.c @@ -61,7 +61,7 @@ #ifndef CONFIG_DISABLE_PTHREAD # include "pthread/pthread.h" #endif -#include "clock_internal.h" +#include "clock/clock.h" #include "timer_internal.h" #include "irq/irq.h" #ifdef HAVE_TASK_GROUP diff --git a/sched/pthread/pthread_condtimedwait.c b/sched/pthread/pthread_condtimedwait.c index bd883d253c..16cce86900 100644 --- a/sched/pthread/pthread_condtimedwait.c +++ b/sched/pthread/pthread_condtimedwait.c @@ -52,7 +52,7 @@ #include "os_internal.h" #include "pthread/pthread.h" -#include "clock_internal.h" +#include "clock/clock.h" #include "signal/signal.h" /**************************************************************************** diff --git a/sched/pthread/pthread_create.c b/sched/pthread/pthread_create.c index a4b583e231..b3969e4f7b 100644 --- a/sched/pthread/pthread_create.c +++ b/sched/pthread/pthread_create.c @@ -54,7 +54,7 @@ #include "os_internal.h" #include "group/group.h" -#include "clock_internal.h" +#include "clock/clock.h" #include "pthread/pthread.h" /**************************************************************************** diff --git a/sched/sched_processtimer.c b/sched/sched_processtimer.c index 281bfe3856..86bee80b80 100644 --- a/sched/sched_processtimer.c +++ b/sched/sched_processtimer.c @@ -48,7 +48,7 @@ #include "os_internal.h" #include "wdog/wdog.h" -#include "clock_internal.h" +#include "clock/clock.h" /************************************************************************ * Pre-processor Definitions diff --git a/sched/sched_rrgetinterval.c b/sched/sched_rrgetinterval.c index 0dd9ec0406..9790f461d1 100644 --- a/sched/sched_rrgetinterval.c +++ b/sched/sched_rrgetinterval.c @@ -46,7 +46,7 @@ #include #include "os_internal.h" -#include "clock_internal.h" +#include "clock/clock.h" /************************************************************************ * Definitions diff --git a/sched/sched_setscheduler.c b/sched/sched_setscheduler.c index cabf81beca..3aaae4013a 100644 --- a/sched/sched_setscheduler.c +++ b/sched/sched_setscheduler.c @@ -47,7 +47,7 @@ #include #include "os_internal.h" -#include "clock_internal.h" +#include "clock/clock.h" /**************************************************************************** * Definitions diff --git a/sched/sched_timerexpiration.c b/sched/sched_timerexpiration.c index d060b921bc..60acda509f 100644 --- a/sched/sched_timerexpiration.c +++ b/sched/sched_timerexpiration.c @@ -51,7 +51,7 @@ #include "os_internal.h" #include "wdog/wdog.h" -#include "clock_internal.h" +#include "clock/clock.h" #ifdef CONFIG_SCHED_TICKLESS diff --git a/sched/semaphore/sem_timedwait.c b/sched/semaphore/sem_timedwait.c index 971251f564..c18ddf3fea 100644 --- a/sched/semaphore/sem_timedwait.c +++ b/sched/semaphore/sem_timedwait.c @@ -50,7 +50,7 @@ #include #include "os_internal.h" -#include "clock_internal.h" +#include "clock/clock.h" #include "semaphore/semaphore.h" /**************************************************************************** diff --git a/sched/signal/sig_timedwait.c b/sched/signal/sig_timedwait.c index e01f358074..a71b78c6b5 100644 --- a/sched/signal/sig_timedwait.c +++ b/sched/signal/sig_timedwait.c @@ -54,7 +54,7 @@ #include "os_internal.h" #include "signal/signal.h" -#include "clock_internal.h" +#include "clock/clock.h" /**************************************************************************** * Pre-processor Definitions diff --git a/sched/timer_gettime.c b/sched/timer_gettime.c index 7598dbec5e..c624badd18 100644 --- a/sched/timer_gettime.c +++ b/sched/timer_gettime.c @@ -42,7 +42,7 @@ #include #include -#include "clock_internal.h" +#include "clock/clock.h" #include "timer_internal.h" #ifndef CONFIG_DISABLE_POSIX_TIMERS diff --git a/sched/timer_settime.c b/sched/timer_settime.c index 747a258348..e3cd2cb156 100644 --- a/sched/timer_settime.c +++ b/sched/timer_settime.c @@ -45,7 +45,7 @@ #include #include "os_internal.h" -#include "clock_internal.h" +#include "clock/clock.h" #include "signal/signal.h" #include "timer_internal.h"