aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2005-02-09 00:07:08 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2005-02-09 00:07:08 +0000
commitd7ce296f57740c076279fd6a0282bea255ec0842 (patch)
tree78605761a6686a3355a0e2aea2859d123679559f /hw
parentf8407028b40d7f17309dc3d470eba080451fa0a2 (diff)
power down support + date fix (Thayne Harbaugh)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1275 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw')
-rw-r--r--hw/cuda.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/hw/cuda.c b/hw/cuda.c
index c05cdeb5fe..b196862805 100644
--- a/hw/cuda.c
+++ b/hw/cuda.c
@@ -87,6 +87,9 @@
#define CUDA_TIMER_FREQ (4700000 / 6)
#define CUDA_ADB_POLL_FREQ 50
+/* CUDA returns time_t's offset from Jan 1, 1904, not 1970 */
+#define RTC_OFFSET 2082844800
+
typedef struct CUDATimer {
unsigned int latch;
uint16_t counter_value; /* counter value at load time */
@@ -503,7 +506,7 @@ static void cuda_receive_packet(CUDAState *s,
break;
case CUDA_GET_TIME:
/* XXX: add time support ? */
- ti = time(NULL);
+ ti = time(NULL) + RTC_OFFSET;
obuf[0] = CUDA_PACKET;
obuf[1] = 0;
obuf[2] = 0;
@@ -522,6 +525,12 @@ static void cuda_receive_packet(CUDAState *s,
obuf[1] = 0;
cuda_send_packet_to_host(s, obuf, 2);
break;
+ case CUDA_POWERDOWN:
+ obuf[0] = CUDA_PACKET;
+ obuf[1] = 0;
+ cuda_send_packet_to_host(s, obuf, 2);
+ qemu_system_shutdown_request();
+ break;
default:
break;
}