-/* $OpenBSD: frame.h,v 1.9 2023/11/14 10:12:24 claudio Exp $ */
+/* $OpenBSD: frame.h,v 1.10 2024/03/29 21:04:37 miod Exp $ */
/* $NetBSD: frame.h,v 1.9 2001/03/04 09:28:35 mrg Exp $ */
/*
#ifndef _MACHINE_FRAME_H_
#define _MACHINE_FRAME_H_
+/*
+ * CC64FSZ (C Compiler 64-bit Frame SiZe) is the size of a stack frame used
+ * by the compiler in 64-bit mode. It is (16)*8; space for 8 ins, 8 outs.
+ */
+#define CC64FSZ 176
+
+/*
+ * v9 stacks all have a bias of 2047 added to the %sp and %fp, so you can easily
+ * detect it by testing the register for an odd value. Why 2K-1 I don't know.
+ */
+#define BIAS (2048-1)
+
+#if defined(_KERNEL) && !defined(_LOCORE)
+
/*
* Sparc v9 stack frame format.
*
* V9 frames have an odd bias, so you can tell a v9 frame from
* a v8 frame by testing the stack pointer's lsb.
*/
-#if !defined(_LOCORE) && !defined(_LIBC)
struct frame {
int64_t fr_local[8]; /* space to save locals (%l0..%l7) */
int64_t fr_arg[6]; /* space to save arguments (%i0..%i5) */
};
#define v9next_frame(f) ((struct frame*)(f->fr_fp+BIAS))
-#endif
-/*
- * CC64FSZ (C Compiler 64-bit Frame SiZe) is the size of a stack frame used
- * by the compiler in 64-bit mode. It is (16)*8; space for 8 ins, 8 outs.
- */
-#define CC64FSZ 176
-
-/*
- * v9 stacks all have a bias of 2047 added to the %sp and %fp, so you can easily
- * detect it by testing the register for an odd value. Why 2K-1 I don't know.
- */
-#define BIAS (2048-1)
-
-#ifndef _LOCORE
/*
* The v9 trapframe. Since we don't get a free register window with
* each trap we need some way to keep track of pending traps. We use
int64_t tf_local[8]; /* local registers in trap's caller */
int64_t tf_in[8]; /* in registers in trap's caller (for debug) */
};
-#endif
+
+#endif /* _KERNEL && !_LOCORE */
#endif /* _MACHINE_FRAME_H_ */