sync with OpenBSD -current

This commit is contained in:
purplerain 2024-07-30 22:07:21 +00:00
parent f172bc2cf7
commit bd64e7d325
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
26 changed files with 476 additions and 158 deletions

View file

@ -1,4 +1,4 @@
.\" $OpenBSD: ps.1,v 1.135 2024/07/22 09:44:37 claudio Exp $ .\" $OpenBSD: ps.1,v 1.136 2024/07/29 09:50:30 claudio Exp $
.\" $NetBSD: ps.1,v 1.16 1996/03/21 01:36:28 jtc Exp $ .\" $NetBSD: ps.1,v 1.16 1996/03/21 01:36:28 jtc Exp $
.\" .\"
.\" Copyright (c) 1980, 1990, 1991, 1993, 1994 .\" Copyright (c) 1980, 1990, 1991, 1993, 1994
@ -30,7 +30,7 @@
.\" .\"
.\" @(#)ps.1 8.3 (Berkeley) 4/18/94 .\" @(#)ps.1 8.3 (Berkeley) 4/18/94
.\" .\"
.Dd $Mdocdate: July 22 2024 $ .Dd $Mdocdate: July 29 2024 $
.Dt PS 1 .Dt PS 1
.Os .Os
.Sh NAME .Sh NAME
@ -239,7 +239,6 @@ P_TIMEOUT 0x400 timing out during sleep
P_WEXIT 0x2000 working on exiting P_WEXIT 0x2000 working on exiting
P_OWEUPC 0x8000 profiling sample needs recording P_OWEUPC 0x8000 profiling sample needs recording
P_SUSPSINGLE 0x80000 need to suspend for single threading P_SUSPSINGLE 0x80000 need to suspend for single threading
P_CONTINUED 0x800000 thread has continued after a stop
P_THREAD 0x4000000 not the original thread P_THREAD 0x4000000 not the original thread
P_SUSPSIG 0x8000000 stopped because of a signal P_SUSPSIG 0x8000000 stopped because of a signal
P_CPUPEG 0x40000000 do not move to another cpu P_CPUPEG 0x40000000 do not move to another cpu
@ -361,6 +360,8 @@ PS_NOBTCFI 0x02000000 no Branch Target CFI
PS_PIN 0x08000000 ld.so or static executable that PS_PIN 0x08000000 ld.so or static executable that
has syscalls pinned has syscalls pinned
PS_LIBCPIN 0x10000000 libc.so has syscalls pinned PS_LIBCPIN 0x10000000 libc.so has syscalls pinned
PS_CONTINUED 0x20000000 process continued from stopped state
but has not been waited for yet
.Ed .Ed
.It Cm re .It Cm re
Core residency time (in seconds; 127 = infinity). Core residency time (in seconds; 127 = infinity).

View file

@ -1,4 +1,4 @@
/* $OpenBSD: evp_names.c,v 1.16 2024/04/09 13:52:41 beck Exp $ */ /* $OpenBSD: evp_names.c,v 1.17 2024/07/29 06:05:31 tb Exp $ */
/* /*
* Copyright (c) 2023 Theo Buehler <tb@openbsd.org> * Copyright (c) 2023 Theo Buehler <tb@openbsd.org>
* *
@ -1010,7 +1010,7 @@ static const struct cipher_name cipher_names[] = {
/* /*
* Keep this table alphabetically sorted by increasing .name. * Keep this table alphabetically sorted by increasing .name.
* regresss/lib/libcrypto/evp/evp_test.c checks that. * regress/lib/libcrypto/evp/evp_test.c checks that.
*/ */
static const struct digest_name digest_names[] = { static const struct digest_name digest_names[] = {

View file

@ -1,4 +1,4 @@
/* $OpenBSD: t_sendrecv.c,v 1.3 2021/12/13 16:56:48 deraadt Exp $ */ /* $OpenBSD: t_sendrecv.c,v 1.4 2024/07/30 13:28:27 claudio Exp $ */
/* $NetBSD: t_sendrecv.c,v 1.8 2021/03/28 17:30:01 christos Exp $ */ /* $NetBSD: t_sendrecv.c,v 1.8 2021/03/28 17:30:01 christos Exp $ */
/*- /*-
@ -97,7 +97,7 @@ receiver(int sd)
if (p.seq != seq) if (p.seq != seq)
printf("%ju != %ju\n", p.seq, seq); printf("%ju != %ju\n", p.seq, seq);
if (seq % 10 == 0) if (seq % 10 == 0)
sched_yield(); usleep(100);
seq = p.seq + 1; seq = p.seq + 1;
} }
// printf("<<%zd %d %ju\n", n, errno, seq); // printf("<<%zd %d %ju\n", n, errno, seq);

View file

@ -22,14 +22,43 @@ handler(int sig, siginfo_t *si, void *context)
} }
#if defined(__amd64__) #if defined(__amd64__)
static int static int
has_cet_ibt(void) has_btcfi(void)
{ {
uint32_t d; uint32_t d;
asm("cpuid" : "=d" (d) : "a" (7), "c" (0)); asm("cpuid" : "=d" (d) : "a" (7), "c" (0));
return (d & (1U << 20)) ? 1 : 0; return (d & (1U << 20)) ? 1 : 0;
} }
#elif defined(__aarch64__)
#include <sys/types.h>
#include <sys/sysctl.h>
#include <machine/armreg.h>
#include <machine/cpu.h>
static int
has_btcfi(void)
{
int mib[] = { CTL_MACHDEP, CPU_ID_AA64PFR1 };
uint64_t id_aa64pfr1 = 0;
size_t size = sizeof(id_aa64pfr1);
sysctl(mib, 2, &id_aa64pfr1, &size, NULL, 0);
return ID_AA64PFR1_BT(id_aa64pfr1) >= ID_AA64PFR1_BT_IMPL;
}
#else
static int
has_btcfi(void)
{
return 0;
}
#endif #endif
int int
@ -37,13 +66,11 @@ main(void)
{ {
struct sigaction sa; struct sigaction sa;
#if defined(__amd64__) if (!has_btcfi()) {
if (!has_cet_ibt()) {
printf("Unsupported CPU\n"); printf("Unsupported CPU\n");
printf("SKIPPED\n"); printf("SKIPPED\n");
exit(0); exit(0);
} }
#endif
sa.sa_sigaction = handler; sa.sa_sigaction = handler;
sa.sa_mask = 0; sa.sa_mask = 0;

View file

@ -1,4 +1,4 @@
# $OpenBSD: airport,v 1.95 2024/07/09 03:21:47 jsg Exp $ # $OpenBSD: airport,v 1.96 2024/07/29 12:32:02 patrick Exp $
# @(#)airport 8.1 (Berkeley) 6/8/93 # @(#)airport 8.1 (Berkeley) 6/8/93
# #
# Some of this information from the Airport Search Engine at # Some of this information from the Airport Search Engine at
@ -1502,6 +1502,7 @@ SBH:St Barthelemy, Guadeloupe
SBN:Michiana Regional, South Bend, Indiana, USA SBN:Michiana Regional, South Bend, Indiana, USA
SBP:San Luis Obispo, California, USA SBP:San Luis Obispo, California, USA
SBW:Sibu, Sibu, Sarawak, Malaysia SBW:Sibu, Sibu, Sarawak, Malaysia
SBZ:Sibiu, Romania
SCE:University Park Arpt, State College, Pennsylvania, USA SCE:University Park Arpt, State College, Pennsylvania, USA
SCL:Aeropuerto Comodoro Arturo Merino Benitez, Santiago, Chile SCL:Aeropuerto Comodoro Arturo Merino Benitez, Santiago, Chile
SCN:Ensheim, Saarbruecken, Germany SCN:Ensheim, Saarbruecken, Germany

View file

@ -1,4 +1,4 @@
/* $OpenBSD: machdep.c,v 1.295 2024/06/26 01:40:49 jsg Exp $ */ /* $OpenBSD: machdep.c,v 1.296 2024/07/29 18:43:11 kettenis Exp $ */
/* $NetBSD: machdep.c,v 1.3 2003/05/07 22:58:18 fvdl Exp $ */ /* $NetBSD: machdep.c,v 1.3 2003/05/07 22:58:18 fvdl Exp $ */
/*- /*-
@ -116,6 +116,7 @@ extern int db_console;
#include "acpi.h" #include "acpi.h"
#if NACPI > 0 #if NACPI > 0
#include <dev/acpi/acpireg.h>
#include <dev/acpi/acpivar.h> #include <dev/acpi/acpivar.h>
#endif #endif
@ -881,6 +882,11 @@ struct pcb dumppcb;
__dead void __dead void
boot(int howto) boot(int howto)
{ {
#if NACPI > 0
if ((howto & RB_POWERDOWN) != 0 && acpi_softc)
acpi_softc->sc_state = ACPI_STATE_S5;
#endif
if ((howto & RB_POWERDOWN) != 0) if ((howto & RB_POWERDOWN) != 0)
lid_action = 0; lid_action = 0;

View file

@ -1,4 +1,4 @@
/* $OpenBSD: cpu.c,v 1.130 2024/07/24 21:24:18 kettenis Exp $ */ /* $OpenBSD: cpu.c,v 1.131 2024/07/30 08:59:33 kettenis Exp $ */
/* /*
* Copyright (c) 2016 Dale Rahn <drahn@dalerahn.com> * Copyright (c) 2016 Dale Rahn <drahn@dalerahn.com>
@ -884,17 +884,49 @@ cpu_identify(struct cpu_info *ci)
printf("%sDPB", sep); printf("%sDPB", sep);
sep = ","; sep = ",";
} }
if (ID_AA64ISAR1_DPB(id) >= ID_AA64ISAR1_DPB_DCCVADP)
printf("+DCCVADP");
/* /*
* ID_AA64ISAR2 * ID_AA64ISAR2
*/ */
id = READ_SPECIALREG(id_aa64isar2_el1); id = READ_SPECIALREG(id_aa64isar2_el1);
if (ID_AA64ISAR2_CSSC(id) >= ID_AA64ISAR2_CSSC_IMPL) {
printf("%sCSSC", sep);
sep = ",";
}
if (ID_AA64ISAR2_RPRFM(id) >= ID_AA64ISAR2_RPRFM_IMPL) {
printf("%sRPRFM", sep);
sep = ",";
}
if (ID_AA64ISAR2_CLRBHB(id) >= ID_AA64ISAR2_CLRBHB_IMPL) { if (ID_AA64ISAR2_CLRBHB(id) >= ID_AA64ISAR2_CLRBHB_IMPL) {
printf("%sCLRBHB", sep); printf("%sCLRBHB", sep);
sep = ","; sep = ",";
} }
if (ID_AA64ISAR2_BC(id) >= ID_AA64ISAR2_BC_IMPL) {
printf("%sBC", sep);
sep = ",";
}
if (ID_AA64ISAR2_MOPS(id) >= ID_AA64ISAR2_MOPS_IMPL) {
printf("%sMOPS", sep);
sep = ",";
}
if (ID_AA64ISAR2_RPRES(id) >= ID_AA64ISAR2_RPRES_IMPL) {
printf("%sRPRES", sep);
sep = ",";
}
if (ID_AA64ISAR2_WFXT(id) >= ID_AA64ISAR2_WFXT_IMPL) {
printf("%sWFXT", sep);
sep = ",";
}
/* /*
* ID_AA64MMFR0 * ID_AA64MMFR0
* *
@ -902,6 +934,13 @@ cpu_identify(struct cpu_info *ci)
*/ */
id = READ_SPECIALREG(id_aa64mmfr0_el1); id = READ_SPECIALREG(id_aa64mmfr0_el1);
if (ID_AA64MMFR0_ECV(id) >= ID_AA64MMFR0_ECV_IMPL) {
printf("%sECV", sep);
sep = ",";
}
if (ID_AA64MMFR0_ECV(id) >= ID_AA64MMFR0_ECV_CNTHCTL)
printf("+CNTHCTL");
if (ID_AA64MMFR0_ASID_BITS(id) == ID_AA64MMFR0_ASID_BITS_16) { if (ID_AA64MMFR0_ASID_BITS(id) == ID_AA64MMFR0_ASID_BITS_16) {
printf("%sASID16", sep); printf("%sASID16", sep);
sep = ","; sep = ",";
@ -914,6 +953,11 @@ cpu_identify(struct cpu_info *ci)
*/ */
id = READ_SPECIALREG(id_aa64mmfr1_el1); id = READ_SPECIALREG(id_aa64mmfr1_el1);
if (ID_AA64MMFR1_AFP(id) >= ID_AA64MMFR1_AFP_IMPL) {
printf("%sAFP", sep);
sep = ",";
}
if (ID_AA64MMFR1_SPECSEI(id) >= ID_AA64MMFR1_SPECSEI_IMPL) { if (ID_AA64MMFR1_SPECSEI(id) >= ID_AA64MMFR1_SPECSEI_IMPL) {
printf("%sSpecSEI", sep); printf("%sSpecSEI", sep);
sep = ","; sep = ",";
@ -965,6 +1009,11 @@ cpu_identify(struct cpu_info *ci)
sep = ","; sep = ",";
} }
if (ID_AA64MMFR2_AT(id) >= ID_AA64MMFR2_AT_IMPL) {
printf("%sAT", sep);
sep = ",";
}
/* /*
* ID_AA64PFR0 * ID_AA64PFR0
*/ */
@ -989,6 +1038,18 @@ cpu_identify(struct cpu_info *ci)
sep = ","; sep = ",";
} }
if (ID_AA64PFR0_ADV_SIMD(id) != ID_AA64PFR0_ADV_SIMD_NONE &&
ID_AA64PFR0_ADV_SIMD(id) >= ID_AA64PFR0_ADV_SIMD_HP) {
printf("%sAdvSIMD+HP", sep);
sep = ",";
}
if (ID_AA64PFR0_FP(id) != ID_AA64PFR0_FP_NONE &&
ID_AA64PFR0_FP(id) >= ID_AA64PFR0_FP_HP) {
printf("%sFP+HP", sep);
sep = ",";
}
/* /*
* ID_AA64PFR1 * ID_AA64PFR1
*/ */
@ -1070,13 +1131,19 @@ cpu_identify_cleanup(void)
cpu_id_aa64isar2 = value; cpu_id_aa64isar2 = value;
/* ID_AA64MMFR0_EL1 */ /* ID_AA64MMFR0_EL1 */
cpu_id_aa64mmfr0 = 0; value = 0;
value |= cpu_id_aa64mmfr0 & ID_AA64MMFR0_ECV_MASK;
cpu_id_aa64mmfr0 = value;
/* ID_AA64MMFR1_EL1 */ /* ID_AA64MMFR1_EL1 */
cpu_id_aa64mmfr1 = 0; value = 0;
value |= cpu_id_aa64mmfr1 & ID_AA64MMFR1_AFP_MASK;
cpu_id_aa64mmfr1 = value;
/* ID_AA64MMFR2_EL1 */ /* ID_AA64MMFR2_EL1 */
cpu_id_aa64mmfr2 = 0; value = 0;
value |= cpu_id_aa64mmfr2 & ID_AA64MMFR2_AT_MASK;
cpu_id_aa64mmfr2 = value;
/* ID_AA64PFR0_EL1 */ /* ID_AA64PFR0_EL1 */
value = 0; value = 0;
@ -1107,8 +1174,12 @@ cpu_identify_cleanup(void)
hwcap |= HWCAP_CRC32; hwcap |= HWCAP_CRC32;
if (ID_AA64ISAR0_ATOMIC(cpu_id_aa64isar0) >= ID_AA64ISAR0_ATOMIC_IMPL) if (ID_AA64ISAR0_ATOMIC(cpu_id_aa64isar0) >= ID_AA64ISAR0_ATOMIC_IMPL)
hwcap |= HWCAP_ATOMICS; hwcap |= HWCAP_ATOMICS;
/* HWCAP_FPHP */ if (ID_AA64PFR0_FP(cpu_id_aa64pfr0) != ID_AA64PFR0_FP_NONE &&
/* HWCAP_ASIMDHP */ ID_AA64PFR0_FP(cpu_id_aa64pfr0) >= ID_AA64PFR0_FP_HP)
hwcap |= HWCAP_FPHP;
if (ID_AA64PFR0_FP(cpu_id_aa64pfr0) != ID_AA64PFR0_ADV_SIMD_NONE &&
ID_AA64PFR0_FP(cpu_id_aa64pfr0) >= ID_AA64PFR0_ADV_SIMD_HP)
hwcap |= HWCAP_ASIMDHP;
id_aa64mmfr2 = READ_SPECIALREG(id_aa64mmfr2_el1); id_aa64mmfr2 = READ_SPECIALREG(id_aa64mmfr2_el1);
if (ID_AA64MMFR2_IDS(id_aa64mmfr2) >= ID_AA64MMFR2_IDS_IMPL) if (ID_AA64MMFR2_IDS(id_aa64mmfr2) >= ID_AA64MMFR2_IDS_IMPL)
hwcap |= HWCAP_CPUID; hwcap |= HWCAP_CPUID;
@ -1137,7 +1208,8 @@ cpu_identify_cleanup(void)
hwcap |= HWCAP_ASIMDFHM; hwcap |= HWCAP_ASIMDFHM;
if (ID_AA64PFR0_DIT(cpu_id_aa64pfr0) >= ID_AA64PFR0_DIT_IMPL) if (ID_AA64PFR0_DIT(cpu_id_aa64pfr0) >= ID_AA64PFR0_DIT_IMPL)
hwcap |= HWCAP_DIT; hwcap |= HWCAP_DIT;
/* HWCAP_USCAT */ if (ID_AA64MMFR2_AT(cpu_id_aa64mmfr2) >= ID_AA64MMFR2_AT_IMPL)
hwcap |= HWCAP_USCAT;
if (ID_AA64ISAR1_LRCPC(cpu_id_aa64isar1) >= ID_AA64ISAR1_LRCPC_LDAPUR) if (ID_AA64ISAR1_LRCPC(cpu_id_aa64isar1) >= ID_AA64ISAR1_LRCPC_LDAPUR)
hwcap |= HWCAP_ILRCPC; hwcap |= HWCAP_ILRCPC;
if (ID_AA64ISAR0_TS(cpu_id_aa64isar0) >= ID_AA64ISAR0_TS_BASE) if (ID_AA64ISAR0_TS(cpu_id_aa64isar0) >= ID_AA64ISAR0_TS_BASE)
@ -1154,7 +1226,8 @@ cpu_identify_cleanup(void)
hwcap |= HWCAP_PACG; hwcap |= HWCAP_PACG;
/* HWCAP2 */ /* HWCAP2 */
/* HWCAP2_DCPODP */ if (ID_AA64ISAR1_DPB(cpu_id_aa64isar1) >= ID_AA64ISAR1_DPB_DCCVADP)
hwcap2 |= HWCAP2_DCPODP;
/* HWCAP2_SVE2: OpenBSD kernel doesn't provide SVE support */ /* HWCAP2_SVE2: OpenBSD kernel doesn't provide SVE support */
/* HWCAP2_SVEAES: OpenBSD kernel doesn't provide SVE support */ /* HWCAP2_SVEAES: OpenBSD kernel doesn't provide SVE support */
/* HWCAP2_SVEPMULL: OpenBSD kernel doesn't provide SVE support */ /* HWCAP2_SVEPMULL: OpenBSD kernel doesn't provide SVE support */
@ -1180,9 +1253,12 @@ cpu_identify_cleanup(void)
if (ID_AA64PFR1_BT(cpu_id_aa64pfr1) >= ID_AA64PFR1_BT_IMPL) if (ID_AA64PFR1_BT(cpu_id_aa64pfr1) >= ID_AA64PFR1_BT_IMPL)
hwcap2 |= HWCAP2_BTI; hwcap2 |= HWCAP2_BTI;
/* HWCAP2_MTE: OpenBSD kernel doesn't provide MTE support */ /* HWCAP2_MTE: OpenBSD kernel doesn't provide MTE support */
/* HWCAP2_ECV */ if (ID_AA64MMFR0_ECV(cpu_id_aa64mmfr0) >= ID_AA64MMFR0_ECV_IMPL)
/* HWCAP2_AFP */ hwcap2 |= HWCAP2_ECV;
/* HWCAP2_RPRES */ if (ID_AA64MMFR1_AFP(cpu_id_aa64mmfr1) >= ID_AA64MMFR1_AFP_IMPL)
hwcap2 |= HWCAP2_AFP;
if (ID_AA64ISAR2_RPRES(cpu_id_aa64isar2) >= ID_AA64ISAR2_RPRES_IMPL)
hwcap2 |= HWCAP2_RPRES;
/* HWCAP2_MTE3: OpenBSD kernel doesn't provide MTE support */ /* HWCAP2_MTE3: OpenBSD kernel doesn't provide MTE support */
/* HWCAP2_SME: OpenBSD kernel doesn't provide SME support */ /* HWCAP2_SME: OpenBSD kernel doesn't provide SME support */
/* HWCAP2_SME_I16I64: OpenBSD kernel doesn't provide SME support */ /* HWCAP2_SME_I16I64: OpenBSD kernel doesn't provide SME support */
@ -1192,12 +1268,15 @@ cpu_identify_cleanup(void)
/* HWCAP2_SME_B16F32: OpenBSD kernel doesn't provide SME support */ /* HWCAP2_SME_B16F32: OpenBSD kernel doesn't provide SME support */
/* HWCAP2_SME_F32F32: OpenBSD kernel doesn't provide SME support */ /* HWCAP2_SME_F32F32: OpenBSD kernel doesn't provide SME support */
/* HWCAP2_SME_FA64: OpenBSD kernel doesn't provide SME support */ /* HWCAP2_SME_FA64: OpenBSD kernel doesn't provide SME support */
/* HWCAP2_WFXT */ if (ID_AA64ISAR2_WFXT(cpu_id_aa64isar2) >= ID_AA64ISAR2_WFXT_IMPL)
hwcap2 |= HWCAP2_WFXT;
if (ID_AA64ISAR1_BF16(cpu_id_aa64isar1) >= ID_AA64ISAR1_BF16_EBF) if (ID_AA64ISAR1_BF16(cpu_id_aa64isar1) >= ID_AA64ISAR1_BF16_EBF)
hwcap2 |= HWCAP2_EBF16; hwcap2 |= HWCAP2_EBF16;
/* HWCAP2_SVE_EBF16: OpenBSD kernel doesn't provide SVE support */ /* HWCAP2_SVE_EBF16: OpenBSD kernel doesn't provide SVE support */
/* HWCAP2_CSSC */ if (ID_AA64ISAR2_CSSC(cpu_id_aa64isar2) >= ID_AA64ISAR2_CSSC_IMPL)
/* HWCAP2_RPRFM */ hwcap2 |= HWCAP2_CSSC;
if (ID_AA64ISAR2_RPRFM(cpu_id_aa64isar2) >= ID_AA64ISAR2_RPRFM_IMPL)
hwcap2 |= HWCAP2_RPRFM;
/* HWCAP2_SVE2P1: OpenBSD kernel doesn't provide SVE support */ /* HWCAP2_SVE2P1: OpenBSD kernel doesn't provide SVE support */
/* HWCAP2_SME2: OpenBSD kernel doesn't provide SME support */ /* HWCAP2_SME2: OpenBSD kernel doesn't provide SME support */
/* HWCAP2_SME2P1: OpenBSD kernel doesn't provide SME support */ /* HWCAP2_SME2P1: OpenBSD kernel doesn't provide SME support */
@ -1205,8 +1284,10 @@ cpu_identify_cleanup(void)
/* HWCAP2_SME_BI32I32: OpenBSD kernel doesn't provide SME support */ /* HWCAP2_SME_BI32I32: OpenBSD kernel doesn't provide SME support */
/* HWCAP2_SME_B16B16: OpenBSD kernel doesn't provide SME support */ /* HWCAP2_SME_B16B16: OpenBSD kernel doesn't provide SME support */
/* HWCAP2_SME_F16F16: OpenBSD kernel doesn't provide SME support */ /* HWCAP2_SME_F16F16: OpenBSD kernel doesn't provide SME support */
/* HWCAP2_MOPS */ if (ID_AA64ISAR2_MOPS(cpu_id_aa64isar2) >= ID_AA64ISAR2_MOPS_IMPL)
/* HWCAP2_HBC */ hwcap2 |= HWCAP2_MOPS;
if (ID_AA64ISAR2_BC(cpu_id_aa64isar2) >= ID_AA64ISAR2_BC_IMPL)
hwcap2 |= HWCAP2_HBC;
} }
void cpu_init(void); void cpu_init(void);

View file

@ -1,4 +1,4 @@
# $OpenBSD: GENERIC,v 1.286 2024/03/25 17:24:03 patrick Exp $ # $OpenBSD: GENERIC,v 1.287 2024/07/30 19:47:05 mglocker Exp $
# #
# GENERIC machine description file # GENERIC machine description file
# #
@ -49,6 +49,7 @@ acpiec* at acpi?
acpige* at acpi? acpige* at acpi?
acpimcfg* at acpi? acpimcfg* at acpi?
acpiiort* at acpi? acpiiort* at acpi?
acpisectwo* at acpi?
smmu* at acpiiort? smmu* at acpiiort?
acpipci* at acpi? acpipci* at acpi?
pci* at acpipci? pci* at acpipci?

View file

@ -1,4 +1,4 @@
# $OpenBSD: RAMDISK,v 1.216 2024/03/25 17:24:03 patrick Exp $ # $OpenBSD: RAMDISK,v 1.217 2024/07/30 19:47:05 mglocker Exp $
machine arm64 machine arm64
maxusers 4 maxusers 4
@ -44,6 +44,7 @@ acpi0 at mainbus?
acpiec* at acpi? acpiec* at acpi?
acpimcfg* at acpi? acpimcfg* at acpi?
acpiiort* at acpi? acpiiort* at acpi?
acpisectwo* at acpi?
smmu* at acpiiort? smmu* at acpiiort?
acpipci* at acpi? acpipci* at acpi?
pci* at acpipci? pci* at acpipci?

View file

@ -1,4 +1,4 @@
/* $OpenBSD: armreg.h,v 1.36 2024/07/24 21:24:18 kettenis Exp $ */ /* $OpenBSD: armreg.h,v 1.37 2024/07/30 08:59:33 kettenis Exp $ */
/*- /*-
* Copyright (c) 2013, 2014 Andrew Turner * Copyright (c) 2013, 2014 Andrew Turner
* Copyright (c) 2015 The FreeBSD Foundation * Copyright (c) 2015 The FreeBSD Foundation
@ -363,6 +363,7 @@
#define ID_AA64ISAR1_DPB(x) ((x) & ID_AA64ISAR1_DPB_MASK) #define ID_AA64ISAR1_DPB(x) ((x) & ID_AA64ISAR1_DPB_MASK)
#define ID_AA64ISAR1_DPB_NONE (0x0ULL << ID_AA64ISAR1_DPB_SHIFT) #define ID_AA64ISAR1_DPB_NONE (0x0ULL << ID_AA64ISAR1_DPB_SHIFT)
#define ID_AA64ISAR1_DPB_IMPL (0x1ULL << ID_AA64ISAR1_DPB_SHIFT) #define ID_AA64ISAR1_DPB_IMPL (0x1ULL << ID_AA64ISAR1_DPB_SHIFT)
#define ID_AA64ISAR1_DPB_DCCVADP (0x2ULL << ID_AA64ISAR1_DPB_SHIFT)
#define ID_AA64ISAR1_APA_SHIFT 4 #define ID_AA64ISAR1_APA_SHIFT 4
#define ID_AA64ISAR1_APA_MASK (0xfULL << ID_AA64ISAR1_APA_SHIFT) #define ID_AA64ISAR1_APA_MASK (0xfULL << ID_AA64ISAR1_APA_SHIFT)
#define ID_AA64ISAR1_APA(x) ((x) & ID_AA64ISAR1_APA_MASK) #define ID_AA64ISAR1_APA(x) ((x) & ID_AA64ISAR1_APA_MASK)
@ -446,15 +447,45 @@
#define ID_AA64ISAR1_LS64_ACCDATA (0x3ULL << ID_AA64ISAR1_LS64_SHIFT) #define ID_AA64ISAR1_LS64_ACCDATA (0x3ULL << ID_AA64ISAR1_LS64_SHIFT)
/* ID_AA64ISAR2_EL1 */ /* ID_AA64ISAR2_EL1 */
#define ID_AA64ISAR2_MASK 0x00000000f0000000ULL #define ID_AA64ISAR2_MASK 0x00ff0000f0ff00ffULL
#define ID_AA64ISAR2_WFXT_SHIFT 0
#define ID_AA64ISAR2_WFXT_MASK (0xfULL << ID_AA64ISAR2_WFXT_SHIFT)
#define ID_AA64ISAR2_WFXT(x) ((x) & ID_AA64ISAR2_WFXT_MASK)
#define ID_AA64ISAR2_WFXT_NONE (0x0ULL << ID_AA64ISAR2_WFXT_SHIFT)
#define ID_AA64ISAR2_WFXT_IMPL (0x2ULL << ID_AA64ISAR2_WFXT_SHIFT)
#define ID_AA64ISAR2_RPRES_SHIFT 4
#define ID_AA64ISAR2_RPRES_MASK (0xfULL << ID_AA64ISAR2_RPRES_SHIFT)
#define ID_AA64ISAR2_RPRES(x) ((x) & ID_AA64ISAR2_RPRES_MASK)
#define ID_AA64ISAR2_RPRES_NONE (0x0ULL << ID_AA64ISAR2_RPRES_SHIFT)
#define ID_AA64ISAR2_RPRES_IMPL (0x1ULL << ID_AA64ISAR2_RPRES_SHIFT)
#define ID_AA64ISAR2_MOPS_SHIFT 16
#define ID_AA64ISAR2_MOPS_MASK (0xfULL << ID_AA64ISAR2_MOPS_SHIFT)
#define ID_AA64ISAR2_MOPS(x) ((x) & ID_AA64ISAR2_MOPS_MASK)
#define ID_AA64ISAR2_MOPS_NONE (0x0ULL << ID_AA64ISAR2_MOPS_SHIFT)
#define ID_AA64ISAR2_MOPS_IMPL (0x1ULL << ID_AA64ISAR2_MOPS_SHIFT)
#define ID_AA64ISAR2_BC_SHIFT 20
#define ID_AA64ISAR2_BC_MASK (0xfULL << ID_AA64ISAR2_BC_SHIFT)
#define ID_AA64ISAR2_BC(x) ((x) & ID_AA64ISAR2_BC_MASK)
#define ID_AA64ISAR2_BC_NONE (0x0ULL << ID_AA64ISAR2_BC_SHIFT)
#define ID_AA64ISAR2_BC_IMPL (0x1ULL << ID_AA64ISAR2_BC_SHIFT)
#define ID_AA64ISAR2_CLRBHB_SHIFT 28 #define ID_AA64ISAR2_CLRBHB_SHIFT 28
#define ID_AA64ISAR2_CLRBHB_MASK (0xfULL << ID_AA64ISAR2_CLRBHB_SHIFT) #define ID_AA64ISAR2_CLRBHB_MASK (0xfULL << ID_AA64ISAR2_CLRBHB_SHIFT)
#define ID_AA64ISAR2_CLRBHB(x) ((x) & ID_AA64ISAR2_CLRBHB_MASK) #define ID_AA64ISAR2_CLRBHB(x) ((x) & ID_AA64ISAR2_CLRBHB_MASK)
#define ID_AA64ISAR2_CLRBHB_NONE (0x0ULL << ID_AA64ISAR2_CLRBHB_SHIFT) #define ID_AA64ISAR2_CLRBHB_NONE (0x0ULL << ID_AA64ISAR2_CLRBHB_SHIFT)
#define ID_AA64ISAR2_CLRBHB_IMPL (0x1ULL << ID_AA64ISAR2_CLRBHB_SHIFT) #define ID_AA64ISAR2_CLRBHB_IMPL (0x1ULL << ID_AA64ISAR2_CLRBHB_SHIFT)
#define ID_AA64ISAR2_RPRFM_SHIFT 48
#define ID_AA64ISAR2_RPRFM_MASK (0xfULL << ID_AA64ISAR2_RPRFM_SHIFT)
#define ID_AA64ISAR2_RPRFM(x) ((x) & ID_AA64ISAR2_RPRFM_MASK)
#define ID_AA64ISAR2_RPRFM_NONE (0x0ULL << ID_AA64ISAR2_RPRFM_SHIFT)
#define ID_AA64ISAR2_RPRFM_IMPL (0x1ULL << ID_AA64ISAR2_RPRFM_SHIFT)
#define ID_AA64ISAR2_CSSC_SHIFT 52
#define ID_AA64ISAR2_CSSC_MASK (0xfULL << ID_AA64ISAR2_CSSC_SHIFT)
#define ID_AA64ISAR2_CSSC(x) ((x) & ID_AA64ISAR2_CSSC_MASK)
#define ID_AA64ISAR2_CSSC_NONE (0x0ULL << ID_AA64ISAR2_CSSC_SHIFT)
#define ID_AA64ISAR2_CSSC_IMPL (0x1ULL << ID_AA64ISAR2_CSSC_SHIFT)
/* ID_AA64MMFR0_EL1 */ /* ID_AA64MMFR0_EL1 */
#define ID_AA64MMFR0_MASK 0x00000000ffffffffULL #define ID_AA64MMFR0_MASK 0xf0000000ffffffffULL
#define ID_AA64MMFR0_PA_RANGE_SHIFT 0 #define ID_AA64MMFR0_PA_RANGE_SHIFT 0
#define ID_AA64MMFR0_PA_RANGE_MASK (0xfULL << ID_AA64MMFR0_PA_RANGE_SHIFT) #define ID_AA64MMFR0_PA_RANGE_MASK (0xfULL << ID_AA64MMFR0_PA_RANGE_SHIFT)
#define ID_AA64MMFR0_PA_RANGE(x) ((x) & ID_AA64MMFR0_PA_RANGE_MASK) #define ID_AA64MMFR0_PA_RANGE(x) ((x) & ID_AA64MMFR0_PA_RANGE_MASK)
@ -499,9 +530,15 @@
#define ID_AA64MMFR0_TGRAN4(x) ((x) & ID_AA64MMFR0_TGRAN4_MASK) #define ID_AA64MMFR0_TGRAN4(x) ((x) & ID_AA64MMFR0_TGRAN4_MASK)
#define ID_AA64MMFR0_TGRAN4_IMPL (0x0ULL << ID_AA64MMFR0_TGRAN4_SHIFT) #define ID_AA64MMFR0_TGRAN4_IMPL (0x0ULL << ID_AA64MMFR0_TGRAN4_SHIFT)
#define ID_AA64MMFR0_TGRAN4_NONE (0xfULL << ID_AA64MMFR0_TGRAN4_SHIFT) #define ID_AA64MMFR0_TGRAN4_NONE (0xfULL << ID_AA64MMFR0_TGRAN4_SHIFT)
#define ID_AA64MMFR0_ECV_SHIFT 60
#define ID_AA64MMFR0_ECV_MASK (0xfULL << ID_AA64MMFR0_ECV_SHIFT)
#define ID_AA64MMFR0_ECV(x) ((x) & ID_AA64MMFR0_ECV_MASK)
#define ID_AA64MMFR0_ECV_NONE (0x0ULL << ID_AA64MMFR0_ECV_SHIFT)
#define ID_AA64MMFR0_ECV_IMPL (0x1ULL << ID_AA64MMFR0_ECV_SHIFT)
#define ID_AA64MMFR0_ECV_CNTHCTL (0x2ULL << ID_AA64MMFR0_ECV_SHIFT)
/* ID_AA64MMFR1_EL1 */ /* ID_AA64MMFR1_EL1 */
#define ID_AA64MMFR1_MASK 0xf0000000ffffffffULL #define ID_AA64MMFR1_MASK 0xf000f000ffffffffULL
#define ID_AA64MMFR1_HAFDBS_SHIFT 0 #define ID_AA64MMFR1_HAFDBS_SHIFT 0
#define ID_AA64MMFR1_HAFDBS_MASK (0xfULL << ID_AA64MMFR1_HAFDBS_SHIFT) #define ID_AA64MMFR1_HAFDBS_MASK (0xfULL << ID_AA64MMFR1_HAFDBS_SHIFT)
#define ID_AA64MMFR1_HAFDBS(x) ((x) & ID_AA64MMFR1_HAFDBS_MASK) #define ID_AA64MMFR1_HAFDBS(x) ((x) & ID_AA64MMFR1_HAFDBS_MASK)
@ -545,6 +582,11 @@
#define ID_AA64MMFR1_XNX(x) ((x) & ID_AA64MMFR1_XNX_MASK) #define ID_AA64MMFR1_XNX(x) ((x) & ID_AA64MMFR1_XNX_MASK)
#define ID_AA64MMFR1_XNX_NONE (0x0ULL << ID_AA64MMFR1_XNX_SHIFT) #define ID_AA64MMFR1_XNX_NONE (0x0ULL << ID_AA64MMFR1_XNX_SHIFT)
#define ID_AA64MMFR1_XNX_IMPL (0x1ULL << ID_AA64MMFR1_XNX_SHIFT) #define ID_AA64MMFR1_XNX_IMPL (0x1ULL << ID_AA64MMFR1_XNX_SHIFT)
#define ID_AA64MMFR1_AFP_SHIFT 44
#define ID_AA64MMFR1_AFP_MASK (0xfULL << ID_AA64MMFR1_AFP_SHIFT)
#define ID_AA64MMFR1_AFP(x) ((x) & ID_AA64MMFR1_AFP_MASK)
#define ID_AA64MMFR1_AFP_NONE (0x0ULL << ID_AA64MMFR1_AFP_SHIFT)
#define ID_AA64MMFR1_AFP_IMPL (0x1ULL << ID_AA64MMFR1_AFP_SHIFT)
#define ID_AA64MMFR1_ECBHB_SHIFT 60 #define ID_AA64MMFR1_ECBHB_SHIFT 60
#define ID_AA64MMFR1_ECBHB_MASK (0xfULL << ID_AA64MMFR1_ECBHB_SHIFT) #define ID_AA64MMFR1_ECBHB_MASK (0xfULL << ID_AA64MMFR1_ECBHB_SHIFT)
#define ID_AA64MMFR1_ECBHB(x) ((x) & ID_AA64MMFR1_ECBHB_MASK) #define ID_AA64MMFR1_ECBHB(x) ((x) & ID_AA64MMFR1_ECBHB_MASK)
@ -557,9 +599,15 @@
#define ID_AA64MMFR2_CCIDX_MASK (0xfULL << ID_AA64MMFR2_CCIDX_SHIFT) #define ID_AA64MMFR2_CCIDX_MASK (0xfULL << ID_AA64MMFR2_CCIDX_SHIFT)
#define ID_AA64MMFR2_CCIDX(x) ((x) & ID_AA64MMFR2_CCIDX_MASK) #define ID_AA64MMFR2_CCIDX(x) ((x) & ID_AA64MMFR2_CCIDX_MASK)
#define ID_AA64MMFR2_CCIDX_IMPL (0x1ULL << ID_AA64MMFR2_CCIDX_SHIFT) #define ID_AA64MMFR2_CCIDX_IMPL (0x1ULL << ID_AA64MMFR2_CCIDX_SHIFT)
#define ID_AA64MMFR2_AT_SHIFT 32
#define ID_AA64MMFR2_AT_MASK (0xfULL << ID_AA64MMFR2_AT_SHIFT)
#define ID_AA64MMFR2_AT(x) ((x) & ID_AA64MMFR2_AT_MASK)
#define ID_AA64MMFR2_AT_NONE (0x0ULL << ID_AA64MMFR2_AT_SHIFT)
#define ID_AA64MMFR2_AT_IMPL (0x1ULL << ID_AA64MMFR2_AT_SHIFT)
#define ID_AA64MMFR2_IDS_SHIFT 36 #define ID_AA64MMFR2_IDS_SHIFT 36
#define ID_AA64MMFR2_IDS_MASK (0xfULL << ID_AA64MMFR2_IDS_SHIFT) #define ID_AA64MMFR2_IDS_MASK (0xfULL << ID_AA64MMFR2_IDS_SHIFT)
#define ID_AA64MMFR2_IDS(x) ((x) & ID_AA64MMFR2_IDS_MASK) #define ID_AA64MMFR2_IDS(x) ((x) & ID_AA64MMFR2_IDS_MASK)
#define ID_AA64MMFR2_IDS_NONE (0x0ULL << ID_AA64MMFR2_IDS_SHIFT)
#define ID_AA64MMFR2_IDS_IMPL (0x1ULL << ID_AA64MMFR2_IDS_SHIFT) #define ID_AA64MMFR2_IDS_IMPL (0x1ULL << ID_AA64MMFR2_IDS_SHIFT)
/* ID_AA64PFR0_EL1 */ /* ID_AA64PFR0_EL1 */
@ -590,11 +638,13 @@
#define ID_AA64PFR0_FP_MASK (0xfULL << ID_AA64PFR0_FP_SHIFT) #define ID_AA64PFR0_FP_MASK (0xfULL << ID_AA64PFR0_FP_SHIFT)
#define ID_AA64PFR0_FP(x) ((x) & ID_AA64PFR0_FP_MASK) #define ID_AA64PFR0_FP(x) ((x) & ID_AA64PFR0_FP_MASK)
#define ID_AA64PFR0_FP_IMPL (0x0ULL << ID_AA64PFR0_FP_SHIFT) #define ID_AA64PFR0_FP_IMPL (0x0ULL << ID_AA64PFR0_FP_SHIFT)
#define ID_AA64PFR0_FP_HP (0x1ULL << ID_AA64PFR0_FP_SHIFT)
#define ID_AA64PFR0_FP_NONE (0xfULL << ID_AA64PFR0_FP_SHIFT) #define ID_AA64PFR0_FP_NONE (0xfULL << ID_AA64PFR0_FP_SHIFT)
#define ID_AA64PFR0_ADV_SIMD_SHIFT 20 #define ID_AA64PFR0_ADV_SIMD_SHIFT 20
#define ID_AA64PFR0_ADV_SIMD_MASK (0xfULL << ID_AA64PFR0_ADV_SIMD_SHIFT) #define ID_AA64PFR0_ADV_SIMD_MASK (0xfULL << ID_AA64PFR0_ADV_SIMD_SHIFT)
#define ID_AA64PFR0_ADV_SIMD(x) ((x) & ID_AA64PFR0_ADV_SIMD_MASK) #define ID_AA64PFR0_ADV_SIMD(x) ((x) & ID_AA64PFR0_ADV_SIMD_MASK)
#define ID_AA64PFR0_ADV_SIMD_IMPL (0x0ULL << ID_AA64PFR0_ADV_SIMD_SHIFT) #define ID_AA64PFR0_ADV_SIMD_IMPL (0x0ULL << ID_AA64PFR0_ADV_SIMD_SHIFT)
#define ID_AA64PFR0_ADV_SIMD_HP (0x1ULL << ID_AA64PFR0_ADV_SIMD_SHIFT)
#define ID_AA64PFR0_ADV_SIMD_NONE (0xfULL << ID_AA64PFR0_ADV_SIMD_SHIFT) #define ID_AA64PFR0_ADV_SIMD_NONE (0xfULL << ID_AA64PFR0_ADV_SIMD_SHIFT)
#define ID_AA64PFR0_GIC_BITS 0x4 /* Number of bits in GIC field */ #define ID_AA64PFR0_GIC_BITS 0x4 /* Number of bits in GIC field */
#define ID_AA64PFR0_GIC_SHIFT 24 #define ID_AA64PFR0_GIC_SHIFT 24

View file

@ -1,4 +1,4 @@
/* $OpenBSD: machdep.c,v 1.673 2024/07/09 07:28:12 mlarkin Exp $ */ /* $OpenBSD: machdep.c,v 1.674 2024/07/29 18:43:11 kettenis Exp $ */
/* $NetBSD: machdep.c,v 1.214 1996/11/10 03:16:17 thorpej Exp $ */ /* $NetBSD: machdep.c,v 1.214 1996/11/10 03:16:17 thorpej Exp $ */
/*- /*-
@ -115,6 +115,7 @@
#include "acpi.h" #include "acpi.h"
#if NACPI > 0 #if NACPI > 0
#include <dev/acpi/acpireg.h>
#include <dev/acpi/acpivar.h> #include <dev/acpi/acpivar.h>
#endif #endif
@ -2598,6 +2599,11 @@ struct pcb dumppcb;
__dead void __dead void
boot(int howto) boot(int howto)
{ {
#if NACPI > 0
if ((howto & RB_POWERDOWN) != 0 && acpi_softc)
acpi_softc->sc_state = ACPI_STATE_S5;
#endif
if ((howto & RB_POWERDOWN) != 0) if ((howto & RB_POWERDOWN) != 0)
lid_action = 0; lid_action = 0;

View file

@ -1,4 +1,4 @@
/* $OpenBSD: acpi.c,v 1.435 2024/07/14 13:58:57 jmatthew Exp $ */ /* $OpenBSD: acpi.c,v 1.436 2024/07/30 19:47:06 mglocker Exp $ */
/* /*
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com> * Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
* Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org> * Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org>
@ -95,6 +95,9 @@ int acpi_gpe(struct acpi_softc *, int, void *);
void acpi_enable_rungpes(struct acpi_softc *); void acpi_enable_rungpes(struct acpi_softc *);
#ifdef __arm64__
int acpi_foundsectwo(struct aml_node *, void *);
#endif
int acpi_foundec(struct aml_node *, void *); int acpi_foundec(struct aml_node *, void *);
int acpi_foundsony(struct aml_node *node, void *arg); int acpi_foundsony(struct aml_node *node, void *arg);
int acpi_foundhid(struct aml_node *, void *); int acpi_foundhid(struct aml_node *, void *);
@ -1231,6 +1234,10 @@ acpi_attach_common(struct acpi_softc *sc, paddr_t base)
/* initialize runtime environment */ /* initialize runtime environment */
aml_find_node(sc->sc_root, "_INI", acpi_inidev, sc); aml_find_node(sc->sc_root, "_INI", acpi_inidev, sc);
#ifdef __arm64__
aml_find_node(sc->sc_root, "ECTC", acpi_foundsectwo, sc);
#endif
/* Get PCI mapping */ /* Get PCI mapping */
aml_walknodes(sc->sc_root, AML_WALK_PRE, acpi_getpci, sc); aml_walknodes(sc->sc_root, AML_WALK_PRE, acpi_getpci, sc);
@ -2770,6 +2777,26 @@ acpi_create_thread(void *arg)
DEVNAME(sc)); DEVNAME(sc));
} }
#if __arm64__
int
acpi_foundsectwo(struct aml_node *node, void *arg)
{
struct acpi_softc *sc = (struct acpi_softc *)arg;
struct device *self = (struct device *)arg;
struct acpi_attach_args aaa;
memset(&aaa, 0, sizeof(aaa));
aaa.aaa_iot = sc->sc_iot;
aaa.aaa_memt = sc->sc_memt;
aaa.aaa_node = node->parent;
aaa.aaa_name = "acpisectwo";
config_found(self, &aaa, acpi_print);
return 0;
}
#endif
int int
acpi_foundec(struct aml_node *node, void *arg) acpi_foundec(struct aml_node *node, void *arg)
{ {

90
sys/dev/acpi/acpisectwo.c Normal file
View file

@ -0,0 +1,90 @@
/* $OpenBSD: acpisectwo.c,v 1.1 2024/07/30 19:47:06 mglocker Exp $ */
/*
* Copyright (c) 2024 Marcus Glocker <mglocker@openbsd.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include <sys/param.h>
#include <sys/systm.h>
#include <dev/acpi/acpivar.h>
#include <dev/acpi/dsdt.h>
//#define ACPISECTWO_DEBUG
#ifdef ACPISECTWO_DEBUG
#define DPRINTF(x) printf x
#else
#define DPRINTF(x)
#endif
#define ACPISECTWO_REGIONSPACE_BAT 0xa1
struct acpisectwo_softc {
struct device sc_dev;
struct acpi_softc *sc_acpi;
struct aml_node *sc_node;
};
int acpisectwo_match(struct device *, void *, void *);
void acpisectwo_attach(struct device *, struct device *, void *);
const struct cfattach acpisectwo_ca = {
sizeof(struct acpisectwo_softc), acpisectwo_match, acpisectwo_attach
};
struct cfdriver acpisectwo_cd = {
NULL, "acpisectwo", DV_DULL
};
int acpisectwo_bat_opreg_handler(void *, int, uint64_t, int, uint64_t *);
int
acpisectwo_match(struct device *parent, void *match, void *aux)
{
struct acpi_attach_args *aa = aux;
struct cfdata *cf = match;
if (aa->aaa_name == NULL ||
strcmp(aa->aaa_name, cf->cf_driver->cd_name) != 0 ||
aa->aaa_table != NULL)
return 0;
return 1;
}
void
acpisectwo_attach(struct device *parent, struct device *self, void *aux)
{
struct acpisectwo_softc *sc = (struct acpisectwo_softc *)self;
struct acpi_attach_args *aa = aux;
printf("\n");
sc->sc_node = aa->aaa_node;
aml_register_regionspace(sc->sc_node, ACPISECTWO_REGIONSPACE_BAT, sc,
acpisectwo_bat_opreg_handler);
}
int
acpisectwo_bat_opreg_handler(void *cookie, int iodir, uint64_t address,
int size, uint64_t *value)
{
DPRINTF(("%s: iodir=%d, address=0x%llx, size=%d\n",
__func__, iodir, address, size));
*value = 0;
return 0;
}

View file

@ -1,4 +1,4 @@
# $OpenBSD: files.acpi,v 1.69 2023/04/23 00:20:26 dlg Exp $ # $OpenBSD: files.acpi,v 1.70 2024/07/30 19:47:06 mglocker Exp $
# #
# Config file and device description for machine-independent ACPI code. # Config file and device description for machine-independent ACPI code.
# Included by ports that need it. # Included by ports that need it.
@ -110,6 +110,11 @@ device acpitoshiba
attach acpitoshiba at acpi attach acpitoshiba at acpi
file dev/acpi/acpitoshiba.c acpitoshiba file dev/acpi/acpitoshiba.c acpitoshiba
# Samsung EC2
device acpisectwo
attach acpisectwo at acpi
file dev/acpi/acpisectwo.c acpisectwo
# Sony support # Sony support
device acpisony device acpisony
attach acpisony at acpi attach acpisony at acpi

View file

@ -1,4 +1,4 @@
/* $OpenBSD: kern_event.c,v 1.198 2023/08/20 15:13:43 visa Exp $ */ /* $OpenBSD: kern_event.c,v 1.199 2024/07/29 12:42:53 claudio Exp $ */
/*- /*-
* Copyright (c) 1999,2000,2001 Jonathan Lemon <jlemon@FreeBSD.org> * Copyright (c) 1999,2000,2001 Jonathan Lemon <jlemon@FreeBSD.org>
@ -124,6 +124,9 @@ int filt_kqueue_common(struct knote *kn, struct kqueue *kq);
int filt_procattach(struct knote *kn); int filt_procattach(struct knote *kn);
void filt_procdetach(struct knote *kn); void filt_procdetach(struct knote *kn);
int filt_proc(struct knote *kn, long hint); int filt_proc(struct knote *kn, long hint);
int filt_sigattach(struct knote *kn);
void filt_sigdetach(struct knote *kn);
int filt_signal(struct knote *kn, long hint);
int filt_fileattach(struct knote *kn); int filt_fileattach(struct knote *kn);
void filt_timerexpire(void *knx); void filt_timerexpire(void *knx);
int filt_timerattach(struct knote *kn); int filt_timerattach(struct knote *kn);
@ -148,6 +151,13 @@ const struct filterops proc_filtops = {
.f_event = filt_proc, .f_event = filt_proc,
}; };
const struct filterops sig_filtops = {
.f_flags = 0,
.f_attach = filt_sigattach,
.f_detach = filt_sigdetach,
.f_event = filt_signal,
};
const struct filterops file_filtops = { const struct filterops file_filtops = {
.f_flags = FILTEROP_ISFD | FILTEROP_MPSAFE, .f_flags = FILTEROP_ISFD | FILTEROP_MPSAFE,
.f_attach = filt_fileattach, .f_attach = filt_fileattach,
@ -450,6 +460,55 @@ filt_proc(struct knote *kn, long hint)
return (kn->kn_fflags != 0); return (kn->kn_fflags != 0);
} }
/*
* signal knotes are shared with proc knotes, so we apply a mask to
* the hint in order to differentiate them from process hints. This
* could be avoided by using a signal-specific knote list, but probably
* isn't worth the trouble.
*/
int
filt_sigattach(struct knote *kn)
{
struct process *pr = curproc->p_p;
int s;
if (kn->kn_id >= NSIG)
return EINVAL;
kn->kn_ptr.p_process = pr;
kn->kn_flags |= EV_CLEAR; /* automatically set */
s = splhigh();
klist_insert_locked(&pr->ps_klist, kn);
splx(s);
return (0);
}
void
filt_sigdetach(struct knote *kn)
{
struct process *pr = kn->kn_ptr.p_process;
int s;
s = splhigh();
klist_remove_locked(&pr->ps_klist, kn);
splx(s);
}
int
filt_signal(struct knote *kn, long hint)
{
if (hint & NOTE_SIGNAL) {
hint &= ~NOTE_SIGNAL;
if (kn->kn_id == hint)
kn->kn_data++;
}
return (kn->kn_data != 0);
}
#define NOTE_TIMER_UNITMASK \ #define NOTE_TIMER_UNITMASK \
(NOTE_SECONDS|NOTE_MSECONDS|NOTE_USECONDS|NOTE_NSECONDS) (NOTE_SECONDS|NOTE_MSECONDS|NOTE_USECONDS|NOTE_NSECONDS)

View file

@ -1,4 +1,4 @@
/* $OpenBSD: kern_exit.c,v 1.227 2024/07/24 15:30:17 claudio Exp $ */ /* $OpenBSD: kern_exit.c,v 1.228 2024/07/29 09:49:49 claudio Exp $ */
/* $NetBSD: kern_exit.c,v 1.39 1996/04/22 01:38:25 christos Exp $ */ /* $NetBSD: kern_exit.c,v 1.39 1996/04/22 01:38:25 christos Exp $ */
/* /*
@ -597,9 +597,10 @@ loop:
memset(rusage, 0, sizeof(*rusage)); memset(rusage, 0, sizeof(*rusage));
return (0); return (0);
} }
if ((options & WCONTINUED) && (p->p_flag & P_CONTINUED)) { if ((options & WCONTINUED) && (pr->ps_flags & PS_CONTINUED)) {
if ((options & WNOWAIT) == 0) if ((options & WNOWAIT) == 0)
atomic_clearbits_int(&p->p_flag, P_CONTINUED); atomic_clearbits_int(&pr->ps_flags,
PS_CONTINUED);
*retval = pr->ps_pid; *retval = pr->ps_pid;
if (info != NULL) { if (info != NULL) {

View file

@ -1,4 +1,4 @@
/* $OpenBSD: kern_sig.c,v 1.334 2024/07/24 15:31:08 claudio Exp $ */ /* $OpenBSD: kern_sig.c,v 1.336 2024/07/29 12:42:53 claudio Exp $ */
/* $NetBSD: kern_sig.c,v 1.54 1996/04/22 01:38:32 christos Exp $ */ /* $NetBSD: kern_sig.c,v 1.54 1996/04/22 01:38:32 christos Exp $ */
/* /*
@ -70,17 +70,6 @@
int nosuidcoredump = 1; int nosuidcoredump = 1;
int filt_sigattach(struct knote *kn);
void filt_sigdetach(struct knote *kn);
int filt_signal(struct knote *kn, long hint);
const struct filterops sig_filtops = {
.f_flags = 0,
.f_attach = filt_sigattach,
.f_detach = filt_sigdetach,
.f_event = filt_signal,
};
/* /*
* The array below categorizes the signals and their default actions. * The array below categorizes the signals and their default actions.
*/ */
@ -1097,7 +1086,7 @@ ptsignal(struct proc *p, int signum, enum signal_type type)
* an event, then it goes back to run state. * an event, then it goes back to run state.
* Otherwise, process goes back to sleep state. * Otherwise, process goes back to sleep state.
*/ */
atomic_setbits_int(&p->p_flag, P_CONTINUED); atomic_setbits_int(&pr->ps_flags, PS_CONTINUED);
atomic_clearbits_int(&p->p_flag, P_SUSPSIG); atomic_clearbits_int(&p->p_flag, P_SUSPSIG);
wakeparent = 1; wakeparent = 1;
if (action == SIG_DFL) if (action == SIG_DFL)
@ -1260,7 +1249,7 @@ out:
} }
if (prop & SA_STOP) { if (prop & SA_STOP) {
atomic_clearbits_int(siglist, CONTSIGMASK); atomic_clearbits_int(siglist, CONTSIGMASK);
atomic_clearbits_int(&p->p_flag, P_CONTINUED); atomic_clearbits_int(&pr->ps_flags, PS_CONTINUED);
} }
SCHED_UNLOCK(); SCHED_UNLOCK();
@ -1974,55 +1963,6 @@ initsiginfo(siginfo_t *si, int sig, u_long trapno, int code, union sigval val)
} }
} }
int
filt_sigattach(struct knote *kn)
{
struct process *pr = curproc->p_p;
int s;
if (kn->kn_id >= NSIG)
return EINVAL;
kn->kn_ptr.p_process = pr;
kn->kn_flags |= EV_CLEAR; /* automatically set */
s = splhigh();
klist_insert_locked(&pr->ps_klist, kn);
splx(s);
return (0);
}
void
filt_sigdetach(struct knote *kn)
{
struct process *pr = kn->kn_ptr.p_process;
int s;
s = splhigh();
klist_remove_locked(&pr->ps_klist, kn);
splx(s);
}
/*
* signal knotes are shared with proc knotes, so we apply a mask to
* the hint in order to differentiate them from process hints. This
* could be avoided by using a signal-specific knote list, but probably
* isn't worth the trouble.
*/
int
filt_signal(struct knote *kn, long hint)
{
if (hint & NOTE_SIGNAL) {
hint &= ~NOTE_SIGNAL;
if (kn->kn_id == hint)
kn->kn_data++;
}
return (kn->kn_data != 0);
}
void void
userret(struct proc *p) userret(struct proc *p)
{ {

View file

@ -1,4 +1,4 @@
/* $OpenBSD: uipc_socket.c,v 1.339 2024/07/20 17:26:19 mvs Exp $ */ /* $OpenBSD: uipc_socket.c,v 1.340 2024/07/29 10:35:22 mvs Exp $ */
/* $NetBSD: uipc_socket.c,v 1.21 1996/02/04 02:17:52 christos Exp $ */ /* $NetBSD: uipc_socket.c,v 1.21 1996/02/04 02:17:52 christos Exp $ */
/* /*
@ -2628,7 +2628,6 @@ sobuf_print(struct sockbuf *sb,
(*pr)("\tsb_mb: %p\n", sb->sb_mb); (*pr)("\tsb_mb: %p\n", sb->sb_mb);
(*pr)("\tsb_mbtail: %p\n", sb->sb_mbtail); (*pr)("\tsb_mbtail: %p\n", sb->sb_mbtail);
(*pr)("\tsb_lastrecord: %p\n", sb->sb_lastrecord); (*pr)("\tsb_lastrecord: %p\n", sb->sb_lastrecord);
(*pr)("\tsb_sel: ...\n");
(*pr)("\tsb_flags: %04x\n", sb->sb_flags); (*pr)("\tsb_flags: %04x\n", sb->sb_flags);
(*pr)("\tsb_state: %04x\n", sb->sb_state); (*pr)("\tsb_state: %04x\n", sb->sb_state);
(*pr)("\tsb_timeo_nsecs: %llu\n", sb->sb_timeo_nsecs); (*pr)("\tsb_timeo_nsecs: %llu\n", sb->sb_timeo_nsecs);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: if_pppx.c,v 1.128 2023/12/23 10:52:54 bluhm Exp $ */ /* $OpenBSD: if_pppx.c,v 1.129 2024/07/30 13:41:15 yasuoka Exp $ */
/* /*
* Copyright (c) 2010 Claudio Jeker <claudio@openbsd.org> * Copyright (c) 2010 Claudio Jeker <claudio@openbsd.org>
@ -1417,10 +1417,12 @@ pppac_del_session(struct pppac_softc *sc, struct pipex_session_close_req *req)
return (EINVAL); return (EINVAL);
} }
pipex_unlink_session_locked(session); pipex_unlink_session_locked(session);
pipex_rele_session(session);
mtx_leave(&pipex_list_mtx); mtx_leave(&pipex_list_mtx);
pipex_export_session_stats(session, &req->psr_stat);
pipex_rele_session(session);
return (0); return (0);
} }

View file

@ -1,4 +1,4 @@
/* $OpenBSD: frag6.c,v 1.88 2024/03/26 23:48:49 bluhm Exp $ */ /* $OpenBSD: frag6.c,v 1.89 2024/07/29 12:41:30 bluhm Exp $ */
/* $KAME: frag6.c,v 1.40 2002/05/27 21:40:31 itojun Exp $ */ /* $KAME: frag6.c,v 1.40 2002/05/27 21:40:31 itojun Exp $ */
/* /*
@ -130,7 +130,8 @@ frag6_input(struct mbuf **mp, int *offp, int proto, int af)
/* jumbo payload can't contain a fragment header */ /* jumbo payload can't contain a fragment header */
if (ip6->ip6_plen == 0) { if (ip6->ip6_plen == 0) {
icmp6_error(m, ICMP6_PARAM_PROB, ICMP6_PARAMPROB_HEADER, offset); icmp6_error(m, ICMP6_PARAM_PROB, ICMP6_PARAMPROB_HEADER,
offset);
return IPPROTO_DONE; return IPPROTO_DONE;
} }
@ -544,10 +545,10 @@ frag6_freef(struct ip6q *q6)
ip6->ip6_src = q6->ip6q_src; ip6->ip6_src = q6->ip6q_src;
ip6->ip6_dst = q6->ip6q_dst; ip6->ip6_dst = q6->ip6q_dst;
NET_LOCK(); NET_LOCK_SHARED();
icmp6_error(m, ICMP6_TIME_EXCEEDED, icmp6_error(m, ICMP6_TIME_EXCEEDED,
ICMP6_TIME_EXCEED_REASSEMBLY, 0); ICMP6_TIME_EXCEED_REASSEMBLY, 0);
NET_UNLOCK(); NET_UNLOCK_SHARED();
} else } else
m_freem(m); m_freem(m);
pool_put(&ip6af_pool, af6); pool_put(&ip6af_pool, af6);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: cdefs.h,v 1.43 2018/10/29 17:10:40 guenther Exp $ */ /* $OpenBSD: cdefs.h,v 1.44 2024/07/30 05:57:31 guenther Exp $ */
/* $NetBSD: cdefs.h,v 1.16 1996/04/03 20:46:39 christos Exp $ */ /* $NetBSD: cdefs.h,v 1.16 1996/04/03 20:46:39 christos Exp $ */
/* /*
@ -287,11 +287,16 @@
* _XOPEN_SOURCE == 520 XPG5v2 * _XOPEN_SOURCE == 520 XPG5v2
* _XOPEN_SOURCE == 600 POSIX 1003.1-2001 with XSI * _XOPEN_SOURCE == 600 POSIX 1003.1-2001 with XSI
* _XOPEN_SOURCE == 700 POSIX 1003.1-2008 with XSI * _XOPEN_SOURCE == 700 POSIX 1003.1-2008 with XSI
* _XOPEN_SOURCE == 800 POSIX 1003.1-2024 with XSI
* *
* The XPG spec implies a specific value for _POSIX_C_SOURCE. * The XPG spec implies a specific value for _POSIX_C_SOURCE.
*/ */
#ifdef _XOPEN_SOURCE #ifdef _XOPEN_SOURCE
# if (_XOPEN_SOURCE - 0 >= 700) # if (_XOPEN_SOURCE - 0 >= 800)
# define __XPG_VISIBLE 800
# undef _POSIX_C_SOURCE
# define _POSIX_C_SOURCE 202405L
# elif (_XOPEN_SOURCE - 0 >= 700)
# define __XPG_VISIBLE 700 # define __XPG_VISIBLE 700
# undef _POSIX_C_SOURCE # undef _POSIX_C_SOURCE
# define _POSIX_C_SOURCE 200809L # define _POSIX_C_SOURCE 200809L
@ -327,12 +332,16 @@
* and the omnibus ISO/IEC 9945-1:1996 * and the omnibus ISO/IEC 9945-1:1996
* _POSIX_C_SOURCE == 200112L 1003.1-2001 * _POSIX_C_SOURCE == 200112L 1003.1-2001
* _POSIX_C_SOURCE == 200809L 1003.1-2008 * _POSIX_C_SOURCE == 200809L 1003.1-2008
* _POSIX_C_SOURCE == 202405L 1003.1-2024
* *
* The POSIX spec implies a specific value for __ISO_C_VISIBLE, though * The POSIX spec implies a specific value for __ISO_C_VISIBLE, though
* this may be overridden by the _ISOC99_SOURCE macro later. * this may be overridden by the _ISOC99_SOURCE macro later.
*/ */
#ifdef _POSIX_C_SOURCE #ifdef _POSIX_C_SOURCE
# if (_POSIX_C_SOURCE - 0 >= 200809) # if (_POSIX_C_SOURCE - 0 >= 202405)
# define __POSIX_VISIBLE 202405
# define __ISO_C_VISIBLE 2017
# elif (_POSIX_C_SOURCE - 0 >= 200809)
# define __POSIX_VISIBLE 200809 # define __POSIX_VISIBLE 200809
# define __ISO_C_VISIBLE 1999 # define __ISO_C_VISIBLE 1999
# elif (_POSIX_C_SOURCE - 0 >= 200112) # elif (_POSIX_C_SOURCE - 0 >= 200112)
@ -398,13 +407,13 @@
* Default values. * Default values.
*/ */
#ifndef __XPG_VISIBLE #ifndef __XPG_VISIBLE
# define __XPG_VISIBLE 700 # define __XPG_VISIBLE 800
#endif #endif
#ifndef __POSIX_VISIBLE #ifndef __POSIX_VISIBLE
# define __POSIX_VISIBLE 200809 # define __POSIX_VISIBLE 202405
#endif #endif
#ifndef __ISO_C_VISIBLE #ifndef __ISO_C_VISIBLE
# define __ISO_C_VISIBLE 2011 # define __ISO_C_VISIBLE 2017
#endif #endif
#ifndef __BSD_VISIBLE #ifndef __BSD_VISIBLE
# define __BSD_VISIBLE 1 # define __BSD_VISIBLE 1

View file

@ -1,4 +1,4 @@
/* $OpenBSD: event.h,v 1.71 2023/08/20 15:13:43 visa Exp $ */ /* $OpenBSD: event.h,v 1.72 2024/07/29 12:42:53 claudio Exp $ */
/*- /*-
* Copyright (c) 1999,2000,2001 Jonathan Lemon <jlemon@FreeBSD.org> * Copyright (c) 1999,2000,2001 Jonathan Lemon <jlemon@FreeBSD.org>
@ -285,7 +285,6 @@ struct proc;
struct rwlock; struct rwlock;
struct timespec; struct timespec;
extern const struct filterops sig_filtops;
extern const struct filterops dead_filtops; extern const struct filterops dead_filtops;
extern void kqpoll_init(unsigned int); extern void kqpoll_init(unsigned int);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: proc.h,v 1.365 2024/07/22 09:43:47 claudio Exp $ */ /* $OpenBSD: proc.h,v 1.366 2024/07/29 09:49:49 claudio Exp $ */
/* $NetBSD: proc.h,v 1.44 1996/04/22 01:23:21 christos Exp $ */ /* $NetBSD: proc.h,v 1.44 1996/04/22 01:23:21 christos Exp $ */
/*- /*-
@ -301,6 +301,7 @@ struct process {
#define PS_ITIMER 0x04000000 /* Virtual interval timers running */ #define PS_ITIMER 0x04000000 /* Virtual interval timers running */
#define PS_PIN 0x08000000 /* ld.so or static syscall pin */ #define PS_PIN 0x08000000 /* ld.so or static syscall pin */
#define PS_LIBCPIN 0x10000000 /* libc.so syscall pin */ #define PS_LIBCPIN 0x10000000 /* libc.so syscall pin */
#define PS_CONTINUED 0x20000000 /* Continued proc not yet waited for */
#define PS_BITS \ #define PS_BITS \
("\20" "\01CONTROLT" "\02EXEC" "\03INEXEC" "\04EXITING" "\05SUGID" \ ("\20" "\01CONTROLT" "\02EXEC" "\03INEXEC" "\04EXITING" "\05SUGID" \
@ -309,7 +310,7 @@ struct process {
"\017NOZOMBIE" "\020STOPPED" "\021SYSTEM" "\022EMBRYO" "\023ZOMBIE" \ "\017NOZOMBIE" "\020STOPPED" "\021SYSTEM" "\022EMBRYO" "\023ZOMBIE" \
"\024NOBROADCASTKILL" "\025PLEDGE" "\026WXNEEDED" "\027EXECPLEDGE" \ "\024NOBROADCASTKILL" "\025PLEDGE" "\026WXNEEDED" "\027EXECPLEDGE" \
"\030ORPHAN" "\031CHROOT" "\032NOBTCFI" "\033ITIMER" "\034PIN" \ "\030ORPHAN" "\031CHROOT" "\032NOBTCFI" "\033ITIMER" "\034PIN" \
"\035LIBCPIN") "\035LIBCPIN" "\036CONTINUED")
struct kcov_dev; struct kcov_dev;
struct lock_list_entry; struct lock_list_entry;
@ -436,7 +437,6 @@ struct proc {
#define P_WEXIT 0x00002000 /* Working on exiting. */ #define P_WEXIT 0x00002000 /* Working on exiting. */
#define P_OWEUPC 0x00008000 /* Owe proc an addupc() at next ast. */ #define P_OWEUPC 0x00008000 /* Owe proc an addupc() at next ast. */
#define P_SUSPSINGLE 0x00080000 /* Need to stop for single threading. */ #define P_SUSPSINGLE 0x00080000 /* Need to stop for single threading. */
#define P_CONTINUED 0x00800000 /* Proc has continued from a stopped state. */
#define P_THREAD 0x04000000 /* Only a thread, not a real process */ #define P_THREAD 0x04000000 /* Only a thread, not a real process */
#define P_SUSPSIG 0x08000000 /* Stopped from signal. */ #define P_SUSPSIG 0x08000000 /* Stopped from signal. */
#define P_CPUPEG 0x40000000 /* Do not move to another cpu. */ #define P_CPUPEG 0x40000000 /* Do not move to another cpu. */
@ -444,7 +444,7 @@ struct proc {
#define P_BITS \ #define P_BITS \
("\20" "\01INKTR" "\02PROFPEND" "\03ALRMPEND" "\04SIGSUSPEND" \ ("\20" "\01INKTR" "\02PROFPEND" "\03ALRMPEND" "\04SIGSUSPEND" \
"\05CANTSLEEP" "\06WSLEEP" "\010SINTR" "\012SYSTEM" "\013TIMEOUT" \ "\05CANTSLEEP" "\06WSLEEP" "\010SINTR" "\012SYSTEM" "\013TIMEOUT" \
"\016WEXIT" "\020OWEUPC" "\024SUSPSINGLE" "\030CONTINUED" "\033THREAD" \ "\016WEXIT" "\020OWEUPC" "\024SUSPSINGLE" "\033THREAD" \
"\034SUSPSIG" "\037CPUPEG") "\034SUSPSIG" "\037CPUPEG")
#define THREAD_PID_OFFSET 100000 #define THREAD_PID_OFFSET 100000

View file

@ -1,4 +1,4 @@
.\" $OpenBSD: at.1,v 1.56 2022/10/22 06:41:04 jmc Exp $ .\" $OpenBSD: at.1,v 1.58 2024/07/30 13:58:02 jmc Exp $
.\" .\"
.\" Copyright (C) 1993, 1994 Thomas Koenig .\" Copyright (C) 1993, 1994 Thomas Koenig
.\" Copyright (C) 1993 David Parsons .\" Copyright (C) 1993 David Parsons
@ -24,7 +24,7 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\" .\"
.Dd $Mdocdate: October 22 2022 $ .Dd $Mdocdate: July 30 2024 $
.Dt AT 1 .Dt AT 1
.Os .Os
.Sh NAME .Sh NAME
@ -129,7 +129,11 @@ queue.
.It Fl t Ar time_arg .It Fl t Ar time_arg
Specify the job time. Specify the job time.
The argument should be of the form The argument should be of the form
.Oo Oo Ar cc Oc Ns Ar yy Oc Ns Ar mmddHHMM Ns Op \&. Ns Ar SS , .Oo Oo Ar cc Oc Ns Ar yy Oc Ns Ar mmddHHMM Ns Op \&. Ns Ar SS
(matching
.Xr touch 1 Ap s
.Fl t
format),
where the parts of the argument represent the following: where the parts of the argument represent the following:
.Pp .Pp
.Bl -tag -width Ds -compact -offset indent .Bl -tag -width Ds -compact -offset indent
@ -157,10 +161,12 @@ a number from 0 to 60
preceded by a period. preceded by a period.
The default is 0. The default is 0.
.El .El
.El .It Ar timespec
.Pp As well as the
.Fl t
option,
.Nm at .Nm at
allows some moderately complex alternatively allows some moderately complex
.Ar timespec .Ar timespec
specifications. specifications.
It accepts times of the form It accepts times of the form
@ -172,6 +178,7 @@ to run a job at a specific time of day
It is also possible to specify It is also possible to specify
.Cm midnight , .Cm midnight ,
.Cm noon , .Cm noon ,
.Cm now ,
or or
.Cm teatime .Cm teatime
(4pm), (4pm),
@ -234,14 +241,7 @@ To run a job at 1am tomorrow, use
.Ic at 1am tomorrow . .Ic at 1am tomorrow .
To run a job at midnight in one week's time, use To run a job at midnight in one week's time, use
.Ic at midnight next week . .Ic at midnight next week .
.Pp .El
The
.Nm at
utility also supports the time format used by
.Xr touch 1
(see the
.Fl t
option).
.Pp .Pp
For both For both
.Nm at .Nm at
@ -344,7 +344,7 @@ The
and and
.Nm batch .Nm batch
utilities are compliant with the utilities are compliant with the
.St -p1003.1-2008 .St -p1003.1-2024
specification. specification.
.Pp .Pp
The The
@ -352,26 +352,38 @@ The
flags flags
.Op Fl bc .Op Fl bc
and the and the
.Nm batch
flags
.Op Fl fmq ,
as well as
the
.Cm teatime .Cm teatime
keyword, .Ar timespec
are extensions to that specification. are extensions to that specification.
.Pp .Pp
.St -p1003.1-2008 .St -p1003.1-2024
states that states that
.Nm batch .Nm batch
jobs are submitted to the queue is equivalent to running
.Qq with no time constraints ; .Qq Cm at -q b -m now .
this implementation permits a This implementation permits a
.Ar timespec .Ar timespec
argument. argument, as well as the ability to read from a file
.Pq Fl f
and specify a job queue
.Pq Fl q ,
and does not send mail to the user
.Pq Fl m
by default.
.Pp
By default,
.St -p1003.1-2024
schedules
.Nm at
jobs in queue
.Sy a
and
.Nm batch
jobs in queue
.Sy b .
.Pp .Pp
The at.allow/deny mechanism is marked by The at.allow/deny mechanism is marked by
.St -p1003.1-2008 .St -p1003.1-2024
as being an as being an
X/Open System Interfaces X/Open System Interfaces
option. option.

View file

@ -1,4 +1,4 @@
.\" $OpenBSD: awk.1,v 1.68 2023/09/21 18:16:12 jmc Exp $ .\" $OpenBSD: awk.1,v 1.69 2024/07/30 13:55:11 jmc Exp $
.\" .\"
.\" Copyright (C) Lucent Technologies 1997 .\" Copyright (C) Lucent Technologies 1997
.\" All Rights Reserved .\" All Rights Reserved
@ -22,7 +22,7 @@
.\" ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF .\" ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
.\" THIS SOFTWARE. .\" THIS SOFTWARE.
.\" .\"
.Dd $Mdocdate: September 21 2023 $ .Dd $Mdocdate: July 30 2024 $
.Dt AWK 1 .Dt AWK 1
.Os .Os
.Sh NAME .Sh NAME
@ -1026,7 +1026,7 @@ No others do.
The The
.Nm .Nm
utility is compliant with the utility is compliant with the
.St -p1003.1-2008 .St -p1003.1-2024
specification except that consecutive backslashes in the replacement specification except that consecutive backslashes in the replacement
string argument for string argument for
.Fn sub .Fn sub

View file

@ -1,4 +1,4 @@
.\" $OpenBSD: basename.1,v 1.17 2010/09/03 11:09:28 jmc Exp $ .\" $OpenBSD: basename.1,v 1.18 2024/07/30 19:16:49 jmc Exp $
.\" $NetBSD: basename.1,v 1.9 1995/03/25 18:17:45 glass Exp $ .\" $NetBSD: basename.1,v 1.9 1995/03/25 18:17:45 glass Exp $
.\" .\"
.\" Copyright (c) 1990, 1993, 1994 .\" Copyright (c) 1990, 1993, 1994
@ -33,7 +33,7 @@
.\" .\"
.\" @(#)basename.1 8.2 (Berkeley) 4/18/94 .\" @(#)basename.1 8.2 (Berkeley) 4/18/94
.\" .\"
.Dd $Mdocdate: September 3 2010 $ .Dd $Mdocdate: July 30 2024 $
.Dt BASENAME 1 .Dt BASENAME 1
.Os .Os
.Sh NAME .Sh NAME
@ -72,5 +72,5 @@ to
The The
.Nm .Nm
utility is compliant with the utility is compliant with the
.St -p1003.1-2008 .St -p1003.1-2024
specification. specification.