summaryrefslogtreecommitdiffstats
path: root/sys/riscv/include
diff options
context:
space:
mode:
Diffstat (limited to 'sys/riscv/include')
-rw-r--r--sys/riscv/include/atomic.h13
-rw-r--r--sys/riscv/include/ucontext.h2
-rw-r--r--sys/riscv/include/vmparam.h37
3 files changed, 34 insertions, 18 deletions
diff --git a/sys/riscv/include/atomic.h b/sys/riscv/include/atomic.h
index f86570a..2d7d819 100644
--- a/sys/riscv/include/atomic.h
+++ b/sys/riscv/include/atomic.h
@@ -310,6 +310,19 @@ atomic_readandclear_64(volatile uint64_t *p)
return (ret);
}
+static __inline uint32_t
+atomic_swap_32(volatile uint32_t *p, uint32_t val)
+{
+ uint32_t old;
+
+ __asm __volatile("amoswap.w %0, %2, %1"
+ : "=&r"(old), "+A" (*p)
+ : "r" (val)
+ : "memory");
+
+ return (old);
+}
+
static __inline uint64_t
atomic_swap_64(volatile uint64_t *p, uint64_t val)
{
diff --git a/sys/riscv/include/ucontext.h b/sys/riscv/include/ucontext.h
index 20b593c..4c3d39d 100644
--- a/sys/riscv/include/ucontext.h
+++ b/sys/riscv/include/ucontext.h
@@ -50,7 +50,7 @@ struct gpregs {
};
struct fpregs {
- __uint64_t fp_x[64] __aligned(16);
+ __uint64_t fp_x[32][2];
__uint64_t fp_fcsr;
int fp_flags;
int pad;
diff --git a/sys/riscv/include/vmparam.h b/sys/riscv/include/vmparam.h
index 08d3c3b..4f27615 100644
--- a/sys/riscv/include/vmparam.h
+++ b/sys/riscv/include/vmparam.h
@@ -43,19 +43,19 @@
* Virtual memory related constants, all in bytes
*/
#ifndef MAXTSIZ
-#define MAXTSIZ (32*1024*1024) /* max text size */
+#define MAXTSIZ (1*1024*1024*1024) /* max text size */
#endif
#ifndef DFLDSIZ
#define DFLDSIZ (128*1024*1024) /* initial data size limit */
#endif
#ifndef MAXDSIZ
-#define MAXDSIZ (128*1024*1024) /* max data size */
+#define MAXDSIZ (1*1024*1024*1024) /* max data size */
#endif
#ifndef DFLSSIZ
-#define DFLSSIZ (2*1024*1024) /* initial stack size limit */
+#define DFLSSIZ (128*1024*1024) /* initial stack size limit */
#endif
#ifndef MAXSSIZ
-#define MAXSSIZ (8*1024*1024) /* max stack size */
+#define MAXSSIZ (1*1024*1024*1024) /* max stack size */
#endif
#ifndef SGROWSIZ
#define SGROWSIZ (128*1024) /* amount to grow stack */
@@ -128,12 +128,12 @@
* We limit the size of the two spaces to 39 bits each.
*
* Upper region: 0xffffffffffffffff
- * 0xffffffffc0000000
+ * 0xffffff8000000000
*
- * Hole: 0xffffffffbfffffff
- * 0x0000000080000000
+ * Hole: 0xffffff7fffffffff
+ * 0x0000008000000000
*
- * Lower region: 0x000000007fffffff
+ * Lower region: 0x0000007fffffffff
* 0x0000000000000000
*
* We use the upper region for the kernel, and the lower region for userland.
@@ -152,19 +152,20 @@
#define VM_MIN_ADDRESS (0x0000000000000000UL)
#define VM_MAX_ADDRESS (0xffffffffffffffffUL)
-/* 256 MiB of kernel addresses */
-#define VM_MIN_KERNEL_ADDRESS (0xffffffffc0000000UL)
-#define VM_MAX_KERNEL_ADDRESS (0xffffffffcfffffffUL)
+/* 32 GiB of kernel addresses */
+#define VM_MIN_KERNEL_ADDRESS (0xffffff8000000000UL)
+#define VM_MAX_KERNEL_ADDRESS (0xffffff8800000000UL)
-/* Direct Map for 512 MiB of PA: 0x0 - 0x1fffffff */
-#define DMAP_MIN_ADDRESS (0xffffffffd0000000UL)
-#define DMAP_MAX_ADDRESS (0xffffffffefffffffUL)
+/* Direct Map for 128 GiB of PA: 0x0 - 0x1fffffffff */
+#define DMAP_MIN_ADDRESS (0xffffffc000000000UL)
+#define DMAP_MAX_ADDRESS (0xffffffdfffffffffUL)
#define DMAP_MIN_PHYSADDR (0x0000000000000000UL)
#define DMAP_MAX_PHYSADDR (DMAP_MAX_ADDRESS - DMAP_MIN_ADDRESS)
/* True if pa is in the dmap range */
-#define PHYS_IN_DMAP(pa) ((pa) <= DMAP_MAX_PHYSADDR)
+#define PHYS_IN_DMAP(pa) ((pa) >= DMAP_MIN_PHYSADDR && \
+ (pa) <= DMAP_MAX_PHYSADDR)
/* True if va is in the dmap range */
#define VIRT_IN_DMAP(va) ((va) >= DMAP_MIN_ADDRESS && \
(va) <= DMAP_MAX_ADDRESS)
@@ -186,13 +187,15 @@
})
#define VM_MIN_USER_ADDRESS (0x0000000000000000UL)
-#define VM_MAX_USER_ADDRESS (0x0000000080000000UL)
+#define VM_MAX_USER_ADDRESS (0x0000008000000000UL)
#define VM_MINUSER_ADDRESS (VM_MIN_USER_ADDRESS)
#define VM_MAXUSER_ADDRESS (VM_MAX_USER_ADDRESS)
#define KERNBASE (VM_MIN_KERNEL_ADDRESS)
-#define USRSTACK (VM_MAX_USER_ADDRESS)
+#define SHAREDPAGE (VM_MAXUSER_ADDRESS - PAGE_SIZE)
+#define USRSTACK SHAREDPAGE
+
#define KERNENTRY (0x200)
/*
OpenPOWER on IntegriCloud