Re: [PATCH 05/23] Add common PPC64 KVM asm helpers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 08.07.2009, at 06:17, Benjamin Herrenschmidt wrote:

On Tue, 2009-07-07 at 16:17 +0200, Alexander Graf wrote:

+#define HOST_STACK_R1	(0 * ULONG_SIZE)
+/* We need to keep some space here that the C function */
+/* we jump into later can clobber */
+#define HOST_STACK_LR	(8 * ULONG_SIZE)
+#define HOST_STACK_RUN	(9 * ULONG_SIZE)
+#define HOST_STACK_VCPU	(10 * ULONG_SIZE)
+#define HOST_STACK_R14	(14 * ULONG_SIZE)
+#define HOST_STACK_R15	(15 * ULONG_SIZE)
+#define HOST_STACK_R16	(16 * ULONG_SIZE)
+#define HOST_STACK_R17	(17 * ULONG_SIZE)
+#define HOST_STACK_R18	(18 * ULONG_SIZE)
+#define HOST_STACK_R19	(19 * ULONG_SIZE)
+#define HOST_STACK_R20	(20 * ULONG_SIZE)
+#define HOST_STACK_R21	(21 * ULONG_SIZE)
+#define HOST_STACK_R22	(22 * ULONG_SIZE)
+#define HOST_STACK_R23	(23 * ULONG_SIZE)
+#define HOST_STACK_R24	(24 * ULONG_SIZE)
+#define HOST_STACK_R25	(25 * ULONG_SIZE)
+#define HOST_STACK_R26	(26 * ULONG_SIZE)
+#define HOST_STACK_R27	(27 * ULONG_SIZE)
+#define HOST_STACK_R28	(28 * ULONG_SIZE)
+#define HOST_STACK_R29	(29 * ULONG_SIZE)
+#define HOST_STACK_R30	(30 * ULONG_SIZE)
+#define HOST_STACK_R31	(31 * ULONG_SIZE)
+#define HOST_STACK_MIN_SIZE (HOST_STACK_R31 + ULONG_SIZE)
+#define HOST_STACK_SIZE (((HOST_STACK_MIN_SIZE + 15) / 16) * 16) / * Align. */
+#define VCPU_GPR(n)     (VCPU_GPRS + (n * ULONG_SIZE))

Can't you define a C structure and generate offsets in asm-offsets.h
using asm-offsets.c like we do for most other stuff ?

Oh looking at asm-offsets.c you already do define a pt_regs structure on stack. I guess I could reuse that.

Alex

--
To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [KVM Development]     [KVM ARM]     [KVM ia64]     [Linux Virtualization]     [Linux USB Devel]     [Linux Video]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux