1*1b761ed3Sjsg /* $OpenBSD: pcb.h,v 1.6 2024/10/15 09:16:39 jsg Exp $ */ 2f24071e5Spatrick /* 3f24071e5Spatrick * Copyright (c) 2016 Dale Rahn <drahn@dalerahn.com> 4f24071e5Spatrick * 5f24071e5Spatrick * Permission to use, copy, modify, and distribute this software for any 6f24071e5Spatrick * purpose with or without fee is hereby granted, provided that the above 7f24071e5Spatrick * copyright notice and this permission notice appear in all copies. 8f24071e5Spatrick * 9f24071e5Spatrick * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10f24071e5Spatrick * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11f24071e5Spatrick * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12f24071e5Spatrick * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13f24071e5Spatrick * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14f24071e5Spatrick * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15f24071e5Spatrick * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16f24071e5Spatrick */ 17f24071e5Spatrick #ifndef _MACHINE_PCB_H_ 18f24071e5Spatrick #define _MACHINE_PCB_H_ 19f24071e5Spatrick 20f24071e5Spatrick #include <machine/frame.h> 21f24071e5Spatrick #include <machine/reg.h> 22f24071e5Spatrick 23f24071e5Spatrick struct trapframe; 24f24071e5Spatrick 25f24071e5Spatrick /* 26f24071e5Spatrick * Warning certain fields must be within 256 bytes of the beginning 27f24071e5Spatrick * of this structure. 28f24071e5Spatrick */ 29f24071e5Spatrick struct pcb { 30f24071e5Spatrick u_int pcb_flags; 31f24071e5Spatrick #define PCB_FPU 0x00000001 /* Process had FPU initialized */ 32c7d5b2abSdrahn #define PCB_SINGLESTEP 0x00000002 /* Single step process */ 33f24071e5Spatrick struct trapframe *pcb_tf; 34f24071e5Spatrick 35f24071e5Spatrick register_t pcb_sp; // stack pointer of switchframe 36f24071e5Spatrick 37f24071e5Spatrick caddr_t pcb_onfault; // On fault handler 38f24071e5Spatrick struct fpreg pcb_fpstate; // Floating Point state */ 39f24071e5Spatrick 40e39d21cdSpatrick void *pcb_tcb; 41f24071e5Spatrick }; 42f24071e5Spatrick #endif /* _MACHINE_PCB_H_ */ 43