summaryrefslogtreecommitdiffstats
path: root/bmc_epoch.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Implement HostEpoch set time logicLei YU2017-10-161-3/+116
| | | | | | | | | | | | | | | | | | | | | | | 1. When setting host epoch, follow below logic: Mode | Owner | Set Host Time ----- | ----- | ------------- NTP | BMC | Not allowed NTP | HOST | Not allowed NTP | SPLIT | OK, and just save offset NTP | BOTH | Not allowed MANUAL| BMC | Not allowed MANUAL| HOST | OK, and set time to BMC MANUAL| SPLIT | OK, and just save offset MANUAL| BOTH | OK, and set time to BMC 2. If owner is SPLIT and BMC time is changed, update the offset accordinly; 3. Use timerfd to get notified on BMC time change, and update host time diff accordingly; 4. Add unit test cases. Change-Id: I2d60a821f7da9b689c579ae7ab672cc37967322c Signed-off-by: Lei YU <mine260309@gmail.com>
* Initial implementation of HostEpochLei YU2017-08-011-2/+2
| | | | | | | | | | | | When host time is set, the diff between the BmcTime and the value is saved to persistent storage; When host time is retrieved, return the BmcTime plus the diff as host's time. Add the unit test cases for HostEpoch. Change-Id: Ia55b93bfcba4f226ceaed8491136ea7afda7bd77 Signed-off-by: Lei YU <mine260309@gmail.com>
* Implement BmcEpoch set/get elapsed()Lei YU2017-08-011-15/+14
| | | | | | | | | | | Getting elapsed returns BMC's time; Setting elapsed will check the current time mode/owner, and will return error when mode is NTP or owner is HOST. Add unit test cases. Change-Id: Ibf4e90957f3b26b68c4a1b6dc66dc364c66bef10 Signed-off-by: Lei YU <mine260309@gmail.com>
* Implement part of BmcEpochLei YU2017-08-011-0/+50
Add BmcEpoch which inherits EpochBase and will handle times for BMC, it is partly implemented. Add unit test cases to test basic functions. Change-Id: Ia5e4d0f884156d238f3f84df490a2efbce43e89a Signed-off-by: Lei YU <mine260309@gmail.com>
OpenPOWER on IntegriCloud