-/* $OpenBSD: cpu.h,v 1.2 2017/12/30 08:39:49 kettenis Exp $ */
+/* $OpenBSD: cpu.h,v 1.3 2018/01/05 17:42:35 kettenis Exp $ */
/*
* Copyright (c) 2016 Dale Rahn <drahn@dalerahn.com>
*
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+
#ifndef _MACHINE_CPU_H_
#define _MACHINE_CPU_H_
*/
#include <machine/intr.h>
-#ifndef _LOCORE
#include <machine/frame.h>
-#endif /* !_LOCORE */
-
#include <machine/armreg.h>
-#ifndef _LOCORE
-
/* All the CLKF_* macros take a struct clockframe * as an argument. */
#define clockframe trapframe
#include <sys/device.h>
#include <sys/sched.h>
+
struct cpu_info {
struct device *ci_dev; /* Device corresponding to this CPU */
struct cpu_info *ci_next;
void delay (unsigned);
#define DELAY(x) delay(x)
-#endif /* !_LOCORE */
-
#endif /* _KERNEL */
#ifdef MULTIPROCESSOR
#endif /* MULTIPROCESSOR */
#endif /* !_MACHINE_CPU_H_ */
-
-/* End of cpu.h */
-/* $OpenBSD: mplock.h,v 1.2 2017/12/04 09:51:03 mpi Exp $ */
+/* $OpenBSD: mplock.h,v 1.3 2018/01/05 17:42:35 kettenis Exp $ */
-/*
- * Copyright (c) 2004 Niklas Hallqvist. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
+/* public domain */
#ifndef _MACHINE_MPLOCK_H_
#define _MACHINE_MPLOCK_H_
-struct __mp_lock_cpu {
- u_int mplc_ticket;
- u_int mplc_depth;
-};
-
-struct __mp_lock {
- struct __mp_lock_cpu mpl_cpus[MAXCPUS];
- atomic_int mpl_ticket;
- atomic_int mpl_users;
-};
-
-#ifndef _LOCORE
-
-void __mp_lock_init(struct __mp_lock *);
-void __mp_lock(struct __mp_lock *);
-void __mp_unlock(struct __mp_lock *);
-int __mp_release_all(struct __mp_lock *);
-int __mp_release_all_but_one(struct __mp_lock *);
-void __mp_acquire_count(struct __mp_lock *, int);
-int __mp_lock_held(struct __mp_lock *, struct cpu_info *);
-
-#endif
+#define __USE_MI_MPLOCK
#endif /* !_MACHINE_MPLOCK_H */
-/* $OpenBSD: param.h,v 1.2 2017/08/09 03:06:55 jsg Exp $ */
+/* $OpenBSD: param.h,v 1.3 2018/01/05 17:42:35 kettenis Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
#define _MACHINE_PARAM_H_
#ifdef _KERNEL
+#ifndef _LOCORE
#include <machine/cpu.h>
#endif
+#endif
#define _MACHINE arm64
#define MACHINE "arm64"
#ifdef _KERNEL
-//#define KERNBASE_HI 0xffffffff
-//#define KERNBASE_LO 0x80000000
-
#define NBPG PAGE_SIZE /* bytes/page */
#define PGSHIFT PAGE_SHIFT /* LOG2(PAGE_SIZE) */
#define PGOFSET PAGE_MASK /* byte offset into page */
#define USPACE (UPAGES * PAGE_SIZE) /* total size of u-area */
#define USPACE_ALIGN 0 /* u-area alignment 0-none */
-#define NMBCLUSTERS 4096 /* map size, max cluster allocation */
+#define NMBCLUSTERS 4096 /* max cluster allocation */
#ifndef MSGBUFSIZE
#define MSGBUFSIZE (16 * PAGE_SIZE) /* default message buffer size */
*/
#define NKMEMPAGES_MAX_DEFAULT ((128 * 1024 * 1024) >> PAGE_SHIFT)
-#define STACKALIGNBYTES (16 - 1)
-#define STACKALIGN(p) ((u_long)(p) &~ STACKALIGNBYTES)
+#define STACKALIGNBYTES (16 - 1)
+#define STACKALIGN(p) ((u_long)(p) &~ STACKALIGNBYTES)
#endif /* _KERNEL */