pseries: Implement set-time-of-day RTAS function

Currently there is no implementation for set-time-of-day rtas function,
which causes the following warning "setting the clock failed (-1)" on
the guest.

This patch just creates this function, get the timedate diff and store in
the papr environment, so that the correct value will be returned by
get-time-of-day.

In order to try it, just adjust the hardware time, run hwclock --systohc,
so that, on when the system runs hwclock --hctosys, the value is correctly
adjusted, i.e. the host time plus the timediff.

Signed-off-by: Breno Leitao <brenohl@br.ibm.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Alexander Graf <agraf@suse.de>
This commit is contained in:
Breno Leitao 2011-09-28 16:53:16 +00:00 committed by Alexander Graf
parent e6c866d417
commit ac26f8c389
2 changed files with 24 additions and 1 deletions

View file

@ -18,6 +18,7 @@ typedef struct sPAPREnvironment {
void *fdt_skel;
target_ulong entry_point;
int next_irq;
int rtc_offset;
} sPAPREnvironment;
#define H_SUCCESS 0