summaryrefslogtreecommitdiffstats
path: root/bsps
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2021-05-11 17:27:20 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2021-05-12 21:25:37 +0200
commit523867de9d274d2bdc29ce649d764b42a9167c0e (patch)
tree88d38e4054d3c24eaa9bbd5327faed8bffe406f8 /bsps
parentrtems: Document rtems_task_set_scheduler() errors (diff)
downloadrtems-523867de9d274d2bdc29ce649d764b42a9167c0e.tar.bz2
rtems: Constify rtems_task_wake_when()
Add a parameter to _TOD_Validate() to disable the validation of the ticks member. There are two reasons for this change. Firstly, in rtems_task_wake_when() was a double check for time_buffer == NULL (one in rtems_task_wake_when() and one in _TOD_Validate()). Secondly, the ticks member is ignored by rtems_task_wake_when(). This was done with a write of zero to the ticks member and thus a modification of the user-provided structure. Now the structure is no longer modified. Using a mask parameter is quite efficient. You just have to load an immediate value and there are no additional branches in _TOD_Validate(). Close #4406.
Diffstat (limited to 'bsps')
-rw-r--r--bsps/arm/altera-cyclone-v/rtc/rtc.c2
-rw-r--r--bsps/shared/dev/rtc/rtc-support.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/bsps/arm/altera-cyclone-v/rtc/rtc.c b/bsps/arm/altera-cyclone-v/rtc/rtc.c
index fb30da8d66..2ff9791871 100644
--- a/bsps/arm/altera-cyclone-v/rtc/rtc.c
+++ b/bsps/arm/altera-cyclone-v/rtc/rtc.c
@@ -353,7 +353,7 @@ static int altera_cyclone_v_ds1339_get_time(int minor, rtems_time_of_day* tod)
temp_tod.month = ds1339_get_month(&time);
temp_tod.year = ds1339_get_year(&time);
- sc = _TOD_Validate(&temp_tod)
+ sc = _TOD_Validate(&temp_tod, TOD_ENABLE_TICKS_VALIDATION)
if (sc == RTEMS_SUCCESSFUL)
memcpy(tod, &temp_tod, sizeof(temp_tod));
}
diff --git a/bsps/shared/dev/rtc/rtc-support.c b/bsps/shared/dev/rtc/rtc-support.c
index 04b8f0c847..c0b639ec7c 100644
--- a/bsps/shared/dev/rtc/rtc-support.c
+++ b/bsps/shared/dev/rtc/rtc-support.c
@@ -255,7 +255,7 @@ int setRealTime(
if (!RTC_Is_present())
return -1;
- if (_TOD_Validate(tod) != RTEMS_SUCCESSFUL)
+ if (_TOD_Validate(tod, TOD_ENABLE_TICKS_VALIDATION) != RTEMS_SUCCESSFUL)
return -1;
RTC_Table[RTC_Minor].pDeviceFns->deviceSetTime(RTC_Minor, tod);