CVS commit: src/sys/uvm
Module Name:src Committed By: chs Date: Sun Oct 25 00:05:26 UTC 2020 Modified Files: src/sys/uvm: uvm_anon.c Log Message: Handle PG_PAGEOUT in uvm_anon_release() too. To generate a diff of this commit: cvs rdiff -u -r1.79 -r1.80 src/sys/uvm/uvm_anon.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/uvm/uvm_anon.c diff -u src/sys/uvm/uvm_anon.c:1.79 src/sys/uvm/uvm_anon.c:1.80 --- src/sys/uvm/uvm_anon.c:1.79 Thu Jul 9 05:57:15 2020 +++ src/sys/uvm/uvm_anon.c Sun Oct 25 00:05:26 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_anon.c,v 1.79 2020/07/09 05:57:15 skrll Exp $ */ +/* $NetBSD: uvm_anon.c,v 1.80 2020/10/25 00:05:26 chs Exp $ */ /* * Copyright (c) 1997 Charles D. Cranor and Washington University. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: uvm_anon.c,v 1.79 2020/07/09 05:57:15 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uvm_anon.c,v 1.80 2020/10/25 00:05:26 chs Exp $"); #include "opt_uvmhist.h" @@ -371,6 +371,11 @@ uvm_anon_release(struct vm_anon *anon) KASSERT(pg->loan_count == 0); KASSERT(anon->an_ref == 0); + if ((pg->flags & PG_PAGEOUT) != 0) { + pg->flags &= ~PG_PAGEOUT; + uvm_pageout_done(1); + } + uvm_pagefree(pg); KASSERT(anon->an_page == NULL); lock = anon->an_lock;
CVS commit: src/usr.bin/make
Module Name:src Committed By: rillig Date: Sat Oct 24 23:27:33 UTC 2020 Modified Files: src/usr.bin/make: dir.c Log Message: make(1): remove UNCONST from Dir_Expand That code is called so seldom that one more memory allocation doesn't hurt. It needs a wildcard character in a dependency declaration, which is rare in practice; see dep-wildcards.mk for an example. To generate a diff of this commit: cvs rdiff -u -r1.173 -r1.174 src/usr.bin/make/dir.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/make/dir.c diff -u src/usr.bin/make/dir.c:1.173 src/usr.bin/make/dir.c:1.174 --- src/usr.bin/make/dir.c:1.173 Sat Oct 24 09:18:09 2020 +++ src/usr.bin/make/dir.c Sat Oct 24 23:27:33 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: dir.c,v 1.173 2020/10/24 09:18:09 rillig Exp $ */ +/* $NetBSD: dir.c,v 1.174 2020/10/24 23:27:33 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -135,7 +135,7 @@ #include "job.h" /* "@(#)dir.c 8.2 (Berkeley) 1/2/94" */ -MAKE_RCSID("$NetBSD: dir.c,v 1.173 2020/10/24 09:18:09 rillig Exp $"); +MAKE_RCSID("$NetBSD: dir.c,v 1.174 2020/10/24 23:27:33 rillig Exp $"); #define DIR_DEBUG0(text) DEBUG0(DIR, text) #define DIR_DEBUG1(fmt, arg1) DEBUG1(DIR, fmt, arg1) @@ -808,7 +808,6 @@ DirPrintExpansions(StringList *words) * * Side Effects: * Directories may be opened. Who knows? - * Undefined behavior if the word is really in read-only memory. *--- */ void @@ -850,16 +849,13 @@ Dir_Expand(const char *word, SearchPath cp--; } if (cp != word) { - char sc; - char *dirpath; + char *prefix = bmake_strsedup(word, cp + 1); /* * If the glob isn't in the first component, try and find * all the components up to the one with a wildcard. */ - sc = cp[1]; - ((char *)UNCONST(cp))[1] = '\0'; - dirpath = Dir_FindFile(word, path); - ((char *)UNCONST(cp))[1] = sc; + char *dirpath = Dir_FindFile(prefix, path); + free(prefix); /* * dirpath is null if can't find the leading component * XXX: Dir_FindFile won't find internal components.
CVS commit: src/external/gpl3/gdb/dist/gdb
Module Name:src Committed By: christos Date: Sat Oct 24 23:06:15 UTC 2020 Modified Files: src/external/gpl3/gdb/dist/gdb: bsd-kvm.c Log Message: Now that we are adding the thread in the bsd_kvm_ops target namespace, make sure that the inferior's top namespace is that too. To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/external/gpl3/gdb/dist/gdb/bsd-kvm.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/gpl3/gdb/dist/gdb/bsd-kvm.c diff -u src/external/gpl3/gdb/dist/gdb/bsd-kvm.c:1.18 src/external/gpl3/gdb/dist/gdb/bsd-kvm.c:1.19 --- src/external/gpl3/gdb/dist/gdb/bsd-kvm.c:1.18 Mon Sep 14 22:05:18 2020 +++ src/external/gpl3/gdb/dist/gdb/bsd-kvm.c Sat Oct 24 19:06:15 2020 @@ -140,6 +140,7 @@ bsd_kvm_target_open (const char *arg, in push_target (_kvm_ops); inf = add_inferior_silent (bsd_kvm_ptid.pid ()); + inf->push_target (_kvm_ops); inf->aspace = maybe_new_address_space (); inf->pspace = new program_space (inf->aspace);
CVS commit: src/usr.bin/make
Module Name:src Committed By: rillig Date: Sat Oct 24 20:51:49 UTC 2020 Modified Files: src/usr.bin/make: buf.c make.h str.c var.c Log Message: make(1): remove macros MIN and MAX These macros typically evaluate one of their arguments twice. Until 2020-08-31, they had not parenthesized their arguments properly. They are only used in a few places, therefore it doesn't hurt much to have them expanded. To generate a diff of this commit: cvs rdiff -u -r1.41 -r1.42 src/usr.bin/make/buf.c cvs rdiff -u -r1.170 -r1.171 src/usr.bin/make/make.h cvs rdiff -u -r1.69 -r1.70 src/usr.bin/make/str.c cvs rdiff -u -r1.582 -r1.583 src/usr.bin/make/var.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/make/buf.c diff -u src/usr.bin/make/buf.c:1.41 src/usr.bin/make/buf.c:1.42 --- src/usr.bin/make/buf.c:1.41 Sat Oct 24 04:27:24 2020 +++ src/usr.bin/make/buf.c Sat Oct 24 20:51:49 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: buf.c,v 1.41 2020/10/24 04:27:24 rillig Exp $ */ +/* $NetBSD: buf.c,v 1.42 2020/10/24 20:51:49 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -75,13 +75,13 @@ #include "make.h" /* "@(#)buf.c 8.1 (Berkeley) 6/6/93" */ -MAKE_RCSID("$NetBSD: buf.c,v 1.41 2020/10/24 04:27:24 rillig Exp $"); +MAKE_RCSID("$NetBSD: buf.c,v 1.42 2020/10/24 20:51:49 rillig Exp $"); /* Make space in the buffer for adding a single byte. */ void Buf_Expand_1(Buffer *buf) { -buf->cap += MAX(buf->cap, 16); +buf->cap += buf->cap > 16 ? buf->cap : 16; buf->data = bmake_realloc(buf->data, buf->cap); } @@ -93,7 +93,7 @@ Buf_AddBytes(Buffer *buf, const char *by char *end; if (__predict_false(old_len + bytes_len >= buf->cap)) { - buf->cap += MAX(buf->cap, bytes_len + 16); + buf->cap += buf->cap > bytes_len + 16 ? buf->cap : bytes_len + 16; buf->data = bmake_realloc(buf->data, buf->cap); } Index: src/usr.bin/make/make.h diff -u src/usr.bin/make/make.h:1.170 src/usr.bin/make/make.h:1.171 --- src/usr.bin/make/make.h:1.170 Sat Oct 24 20:29:40 2020 +++ src/usr.bin/make/make.h Sat Oct 24 20:51:49 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: make.h,v 1.170 2020/10/24 20:29:40 rillig Exp $ */ +/* $NetBSD: make.h,v 1.171 2020/10/24 20:51:49 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -604,13 +604,6 @@ GNode_IsTarget(const GNode *gn) #define UNCONST(ptr) (void *)(ptr) #endif -#ifndef MIN -#define MIN(a, b) (((a) < (b)) ? (a) : (b)) -#endif -#ifndef MAX -#define MAX(a, b) (((a) > (b)) ? (a) : (b)) -#endif - /* At least GNU/Hurd systems lack hardcoded MAXPATHLEN/PATH_MAX */ #include #ifndef MAXPATHLEN Index: src/usr.bin/make/str.c diff -u src/usr.bin/make/str.c:1.69 src/usr.bin/make/str.c:1.70 --- src/usr.bin/make/str.c:1.69 Thu Oct 22 05:50:02 2020 +++ src/usr.bin/make/str.c Sat Oct 24 20:51:49 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: str.c,v 1.69 2020/10/22 05:50:02 rillig Exp $ */ +/* $NetBSD: str.c,v 1.70 2020/10/24 20:51:49 rillig Exp $ */ /*- * Copyright (c) 1988, 1989, 1990, 1993 @@ -71,7 +71,7 @@ #include "make.h" /* "@(#)str.c 5.8 (Berkeley) 6/1/90" */ -MAKE_RCSID("$NetBSD: str.c,v 1.69 2020/10/22 05:50:02 rillig Exp $"); +MAKE_RCSID("$NetBSD: str.c,v 1.70 2020/10/24 20:51:49 rillig Exp $"); /* Return the concatenation of s1 and s2, freshly allocated. */ char * @@ -147,7 +147,7 @@ Str_Words(const char *str, Boolean expan str_len = strlen(str); words_buf = bmake_malloc(strlen(str) + 1); - words_cap = MAX((str_len / 5), 50); + words_cap = str_len / 5 > 50 ? str_len / 5 : 50; words = bmake_malloc((words_cap + 1) * sizeof(char *)); /* Index: src/usr.bin/make/var.c diff -u src/usr.bin/make/var.c:1.582 src/usr.bin/make/var.c:1.583 --- src/usr.bin/make/var.c:1.582 Fri Oct 23 13:38:17 2020 +++ src/usr.bin/make/var.c Sat Oct 24 20:51:49 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: var.c,v 1.582 2020/10/23 13:38:17 rillig Exp $ */ +/* $NetBSD: var.c,v 1.583 2020/10/24 20:51:49 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -121,7 +121,7 @@ #include"metachar.h" /* "@(#)var.c 8.3 (Berkeley) 3/19/94" */ -MAKE_RCSID("$NetBSD: var.c,v 1.582 2020/10/23 13:38:17 rillig Exp $"); +MAKE_RCSID("$NetBSD: var.c,v 1.583 2020/10/24 20:51:49 rillig Exp $"); #define VAR_DEBUG1(fmt, arg1) DEBUG1(VAR, fmt, arg1) #define VAR_DEBUG2(fmt, arg1, arg2) DEBUG2(VAR, fmt, arg1, arg2) @@ -1470,7 +1470,7 @@ VarSelectWords(char sep, Boolean oneBigW int last) { Words words; -int start, end, step; +int len, start, end, step; int i; SepBuf buf; @@ -1492,21 +1492,22 @@ VarSelectWords(char sep, Boolean oneBigW * If first or last are negative, convert them to the positive equivalents * (-1 gets converted to ac, -2 gets converted to (ac - 1), etc.). */ +len = (int)words.len; if (first < 0) - first += (int)words.len + 1; + first += len + 1; if (last
CVS commit: src/usr.bin/make
Module Name:src Committed By: rillig Date: Sat Oct 24 20:29:40 UTC 2020 Modified Files: src/usr.bin/make: main.c make.h Log Message: make(1): convert macros for debug flags into enum To generate a diff of this commit: cvs rdiff -u -r1.387 -r1.388 src/usr.bin/make/main.c cvs rdiff -u -r1.169 -r1.170 src/usr.bin/make/make.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/make/main.c diff -u src/usr.bin/make/main.c:1.387 src/usr.bin/make/main.c:1.388 --- src/usr.bin/make/main.c:1.387 Sat Oct 24 10:36:23 2020 +++ src/usr.bin/make/main.c Sat Oct 24 20:29:40 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.387 2020/10/24 10:36:23 rillig Exp $ */ +/* $NetBSD: main.c,v 1.388 2020/10/24 20:29:40 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -118,7 +118,7 @@ #include "trace.h" /* "@(#)main.c 8.3 (Berkeley) 3/19/94" */ -MAKE_RCSID("$NetBSD: main.c,v 1.387 2020/10/24 10:36:23 rillig Exp $"); +MAKE_RCSID("$NetBSD: main.c,v 1.388 2020/10/24 20:29:40 rillig Exp $"); #if defined(MAKE_NATIVE) && !defined(lint) __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 " "The Regents of the University of California. " @@ -145,7 +145,7 @@ static StringList * variables; /* list o int maxJobs; /* -j argument */ static int maxJobTokens; /* -j argument */ Boolean compatMake; /* -B argument */ -int debug; /* -d argument */ +DebugFlags debug; /* -d argument */ Boolean debugVflag; /* -dV */ Boolean noExecute; /* -n flag */ Boolean noRecursiveExecute; /* -N flag */ Index: src/usr.bin/make/make.h diff -u src/usr.bin/make/make.h:1.169 src/usr.bin/make/make.h:1.170 --- src/usr.bin/make/make.h:1.169 Sat Oct 24 03:45:02 2020 +++ src/usr.bin/make/make.h Sat Oct 24 20:29:40 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: make.h,v 1.169 2020/10/24 03:45:02 rillig Exp $ */ +/* $NetBSD: make.h,v 1.170 2020/10/24 20:29:40 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -503,36 +503,39 @@ extern pid_t myPid; # define MAKE_LEVEL_ENV "MAKELEVEL" #endif +typedef enum DebugFlags { +DEBUG_ARCH = 1 << 0, +DEBUG_COND = 1 << 1, +DEBUG_DIR = 1 << 2, +DEBUG_GRAPH1 = 1 << 3, +DEBUG_GRAPH2 = 1 << 4, +DEBUG_JOB = 1 << 5, +DEBUG_MAKE = 1 << 6, +DEBUG_SUFF = 1 << 7, +DEBUG_TARG = 1 << 8, +DEBUG_VAR = 1 << 9, +DEBUG_FOR = 1 << 10, +DEBUG_SHELL = 1 << 11, +DEBUG_ERROR = 1 << 12, +DEBUG_LOUD = 1 << 13, +DEBUG_META = 1 << 14, +DEBUG_HASH = 1 << 15, + +DEBUG_GRAPH3 = 1 << 16, +DEBUG_SCRIPT = 1 << 17, +DEBUG_PARSE = 1 << 18, +DEBUG_CWD = 1 << 19, + +DEBUG_LINT = 1 << 20 +} DebugFlags; + /* * debug control: * There is one bit per module. It is up to the module what debug * information to print. */ extern FILE *debug_file; /* Output is written here - default stderr */ -extern int debug; -#define DEBUG_ARCH 0x1 -#define DEBUG_COND 0x2 -#define DEBUG_DIR 0x4 -#define DEBUG_GRAPH1 0x8 -#define DEBUG_GRAPH2 0x00010 -#define DEBUG_JOB 0x00020 -#define DEBUG_MAKE 0x00040 -#define DEBUG_SUFF 0x00080 -#define DEBUG_TARG 0x00100 -#define DEBUG_VAR 0x00200 -#define DEBUG_FOR 0x00400 -#define DEBUG_SHELL 0x00800 -#define DEBUG_ERROR 0x01000 -#define DEBUG_LOUD 0x02000 -#define DEBUG_META 0x04000 -#define DEBUG_HASH 0x08000 - -#define DEBUG_GRAPH3 0x1 -#define DEBUG_SCRIPT 0x2 -#define DEBUG_PARSE 0x4 -#define DEBUG_CWD 0x8 - -#define DEBUG_LINT 0x10 +extern DebugFlags debug; #define CONCAT(a,b) a##b
CVS commit: src/usr.sbin/sysinst
Module Name:src Committed By: martin Date: Sat Oct 24 16:13:15 UTC 2020 Modified Files: src/usr.sbin/sysinst: menus.mi msg.mi.de msg.mi.en msg.mi.es msg.mi.fr msg.mi.pl util.c Log Message: When looking for available CD media, skip those that are already mounted. When no medium with sets is found, show a new error message and return to the source selection menu. Rearrange all source option menus to have the proper set suffix available (either .tgz or .tar.xz). To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.22 src/usr.sbin/sysinst/menus.mi cvs rdiff -u -r1.24 -r1.25 src/usr.sbin/sysinst/msg.mi.de cvs rdiff -u -r1.32 -r1.33 src/usr.sbin/sysinst/msg.mi.en \ src/usr.sbin/sysinst/msg.mi.pl cvs rdiff -u -r1.26 -r1.27 src/usr.sbin/sysinst/msg.mi.es cvs rdiff -u -r1.31 -r1.32 src/usr.sbin/sysinst/msg.mi.fr cvs rdiff -u -r1.48 -r1.49 src/usr.sbin/sysinst/util.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/sysinst/menus.mi diff -u src/usr.sbin/sysinst/menus.mi:1.21 src/usr.sbin/sysinst/menus.mi:1.22 --- src/usr.sbin/sysinst/menus.mi:1.21 Mon Jan 27 21:21:22 2020 +++ src/usr.sbin/sysinst/menus.mi Sat Oct 24 16:13:15 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: menus.mi,v 1.21 2020/01/27 21:21:22 martin Exp $ */ +/* $NetBSD: menus.mi,v 1.22 2020/10/24 16:13:15 martin Exp $ */ /*- * Copyright (c) 2003 The NetBSD Foundation, Inc. @@ -362,8 +362,10 @@ menu distset, title MSG_Select_your_dist menu ftpsource, y=-4, x=0, w=70, no box, no clear, exitstring MSG_Get_Distribution; - display action { msg_fmt_display(MSG_ftpsource, "%s", - url_proto((uintptr_t)((arg_rv*)arg)->arg)); }; + display action { + msg_display_subst(MSG_ftpsource, 2, "." SETS_TAR_SUFF, + url_proto((uintptr_t)((arg_rv*)arg)->arg)); + }; option {src_legend(menu, MSG_Host, ftp.xfer_host[(uintptr_t)((arg_rv*)arg)->arg]);}, action { src_prompt(MSG_Host, ftp.xfer_host[(uintptr_t)((arg_rv*)arg)->arg], sizeof ftp.xfer_host[(uintptr_t)((arg_rv*)arg)->arg]); }; option {src_legend(menu, MSG_Base_dir, ftp.dir);}, @@ -412,7 +414,8 @@ menu ftpsource, y=-4, x=0, w=70, no box, menu nfssource, y=-4, x=0, w=70, no box, no clear, exitstring MSG_Get_Distribution; - display action { msg_display(MSG_nfssource); }; + display action { const char suff[] = "." SETS_TAR_SUFF; + msg_display_subst(MSG_nfssource, 1, ); }; option {src_legend(menu, MSG_Host, nfs_host);}, action { src_prompt(MSG_Host, nfs_host, sizeof nfs_host); }; option {src_legend(menu, MSG_Base_dir, nfs_dir);}, @@ -459,7 +462,8 @@ menu floppysource, y=-4, x=0, w=70, no b option MSG_exit_menu_generic, exit, action { *((int*)arg) = SET_RETRY; }; menu cdromsource, y=-4, x=0, w=70, no box, no clear, exitstring MSG_Continue; - display action { msg_display(MSG_cdromsource); }; + display action { const char suff[] = "." SETS_TAR_SUFF; + msg_display_subst(MSG_cdromsource, 1, ); }; option {src_legend(menu, MSG_Device, cdrom_dev);}, action { src_prompt(MSG_dev, cdrom_dev, sizeof cdrom_dev); }; option {src_legend(menu, MSG_Set_dir_bin, set_dir_bin);}, @@ -469,7 +473,8 @@ menu cdromsource, y=-4, x=0, w=70, no bo option MSG_exit_menu_generic, exit, action { *((int*)arg) = SET_RETRY; }; menu localfssource, y=-4, x=0, w=70, no box, no clear, exitstring MSG_Continue; - display action { msg_display(MSG_localfssource); }; + display action { const char suff[] = "." SETS_TAR_SUFF; + msg_display_subst(MSG_localfssource, 1, ); }; option {src_legend(menu, MSG_Device, localfs_dev);}, action { src_prompt(MSG_dev, localfs_dev, sizeof localfs_dev);}; option {src_legend(menu, MSG_File_system, localfs_fs);}, @@ -483,7 +488,8 @@ menu localfssource, y=-4, x=0, w=70, no option MSG_exit_menu_generic, exit, action { *((int*)arg) = SET_RETRY; }; menu localdirsource, y=-4, x=0, w=70, no box, no clear, exitstring MSG_Continue; - display action { msg_display(MSG_localdir); }; + display action { const char suff[] = "." SETS_TAR_SUFF; + msg_display_subst(MSG_localdir, 1, ); }; option {src_legend(menu, MSG_Base_dir, localfs_dir);}, action { src_prompt(MSG_Base_dir, localfs_dir, 60); }; option {src_legend(menu, MSG_Set_dir_bin, set_dir_bin);}, Index: src/usr.sbin/sysinst/msg.mi.de diff -u src/usr.sbin/sysinst/msg.mi.de:1.24 src/usr.sbin/sysinst/msg.mi.de:1.25 --- src/usr.sbin/sysinst/msg.mi.de:1.24 Tue Oct 13 17:26:28 2020 +++ src/usr.sbin/sysinst/msg.mi.de Sat Oct 24 16:13:15 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: msg.mi.de,v 1.24 2020/10/13 17:26:28 martin Exp $ */ +/* $NetBSD: msg.mi.de,v 1.25 2020/10/24 16:13:15 martin Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -507,8 +507,12 @@ alle Pakete (volle Installation) zu inst definierten Satz auszuwählen. } +/* Called with: Example + * $0 = sets suffix .tgz + * $1 = URL protocol used ftp + */ message ftpsource -{Dies sind die Daten zum
CVS commit: src/sys/arch/sparc64/dev
Module Name:src Committed By: jdc Date: Sat Oct 24 15:16:39 UTC 2020 Modified Files: src/sys/arch/sparc64/dev: pcf8591_envctrl.c Log Message: Add support for automatically changing the CPU fan speed on the E250 in a similar way to the SB1000/SB2000. The fan control information was determined by experiment, as it's only partially available in OFW. Hardcode the missing information for E250 fan control into the driver (it should be possible to support the E450 in future too). To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/sys/arch/sparc64/dev/pcf8591_envctrl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/sparc64/dev/pcf8591_envctrl.c diff -u src/sys/arch/sparc64/dev/pcf8591_envctrl.c:1.9 src/sys/arch/sparc64/dev/pcf8591_envctrl.c:1.10 --- src/sys/arch/sparc64/dev/pcf8591_envctrl.c:1.9 Tue Jun 26 06:03:57 2018 +++ src/sys/arch/sparc64/dev/pcf8591_envctrl.c Sat Oct 24 15:16:39 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: pcf8591_envctrl.c,v 1.9 2018/06/26 06:03:57 thorpej Exp $ */ +/* $NetBSD: pcf8591_envctrl.c,v 1.10 2020/10/24 15:16:39 jdc Exp $ */ /* $OpenBSD: pcf8591_envctrl.c,v 1.6 2007/10/25 21:17:20 kettenis Exp $ */ /* @@ -19,17 +19,25 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pcf8591_envctrl.c,v 1.9 2018/06/26 06:03:57 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pcf8591_envctrl.c,v 1.10 2020/10/24 15:16:39 jdc Exp $"); #include #include +#include #include #include +#include + +#include #include #include +/* Translation tables contain 254 entries */ +#define XLATE_SIZE 256 +#define XLATE_MAX (XLATE_SIZE - 2) + #define PCF8591_CHANNELS 4 #define PCF8591_CTRL_CH0 0x00 @@ -39,35 +47,48 @@ __KERNEL_RCSID(0, "$NetBSD: pcf8591_envc #define PCF8591_CTRL_AUTOINC 0x04 #define PCF8591_CTRL_OSCILLATOR 0x40 +#define PCF8591_TEMP_SENS 0x00 +#define PCF8591_CPU_FAN_CTRL 0x01 +#define PCF8591_PS_FAN_CTRL 0x02 + struct ecadc_channel { u_int chan_num; + u_int chan_type; envsys_data_t chan_sensor; u_char *chan_xlate; int64_t chan_factor; int64_t chan_min; int64_t chan_warn; int64_t chan_crit; + u_int8_t chan_speed; }; struct ecadc_softc { device_t sc_dev; i2c_tag_t sc_tag; i2c_addr_t sc_addr; - u_char sc_ps_xlate[256]; - u_char sc_cpu_xlate[256]; + u_char sc_ps_xlate[XLATE_SIZE]; + u_char sc_cpu_xlate[XLATE_SIZE]; + u_char sc_cpu_fan_spd[XLATE_SIZE]; u_int sc_nchan; struct ecadc_channel sc_channels[PCF8591_CHANNELS]; struct sysmon_envsys *sc_sme; + int sc_hastimer; + callout_t sc_timer; }; static int ecadc_match(device_t, cfdata_t, void *); static void ecadc_attach(device_t, device_t, void *); +static int ecadc_detach(device_t, int); static void ecadc_refresh(struct sysmon_envsys *, envsys_data_t *); static void ecadc_get_limits(struct sysmon_envsys *, envsys_data_t *, - sysmon_envsys_lim_t *, uint32_t *); - -CFATTACH_DECL_NEW(ecadc, sizeof(struct ecadc_softc), - ecadc_match, ecadc_attach, NULL, NULL); + sysmon_envsys_lim_t *, u_int32_t *); +static void ecadc_timeout(void *); +static void ecadc_fan_adjust(void *); + +CFATTACH_DECL3_NEW(ecadc, sizeof(struct ecadc_softc), + ecadc_match, ecadc_attach, ecadc_detach, NULL, NULL, NULL, + DVF_DETACH_SHUTDOWN); static const struct device_compatible_entry compat_data[] = { { "ecadc", 0 }, @@ -102,6 +123,9 @@ ecadc_attach(device_t parent, device_t s u_int i; sc->sc_dev = self; + sc->sc_nchan = 0; + sc->sc_hastimer = 0; + if ((len = OF_getprop(node, "thermisters", term, sizeof(term))) < 0) { aprint_error(": couldn't find \"thermisters\" property\n"); @@ -109,15 +133,14 @@ ecadc_attach(device_t parent, device_t s } if (OF_getprop(node, "cpu-temp-factors", >sc_cpu_xlate[2], - sizeof(sc->sc_cpu_xlate) - 2) < 0) { + XLATE_MAX) < 0) { aprint_error(": couldn't find \"cpu-temp-factors\" property\n"); return; } sc->sc_cpu_xlate[0] = sc->sc_cpu_xlate[1] = sc->sc_cpu_xlate[2]; /* Only the Sun Enterprise 450 has these. */ - OF_getprop(node, "ps-temp-factors", >sc_ps_xlate[2], - sizeof(sc->sc_ps_xlate) - 2); + OF_getprop(node, "ps-temp-factors", >sc_ps_xlate[2], XLATE_MAX); sc->sc_ps_xlate[0] = sc->sc_ps_xlate[1] = sc->sc_ps_xlate[2]; cp = term; @@ -139,6 +162,7 @@ ecadc_attach(device_t parent, device_t s num = den = 1; sc->sc_channels[sc->sc_nchan].chan_num = chan; + sc->sc_channels[sc->sc_nchan].chan_type = PCF8591_TEMP_SENS; sensor = >sc_channels[sc->sc_nchan].chan_sensor; sensor->units = ENVSYS_STEMP; @@ -164,6 +188,27 @@ ecadc_attach(device_t parent, device_t s sc->sc_nchan++; } + /* + * Fan speed changing information is missing from OFW + * The E250 CPU fan is connected to the sensor at addr 0x4a, channel 1 + */ + if (ia->ia_addr == 0x4a && !strcmp(machine_model, "SUNW,Ultra-250") && + OF_getprop(node, "cpu-fan-speeds", >sc_cpu_fan_spd, +
CVS commit: src/sys/arch/arm/arm32
Module Name:src Committed By: skrll Date: Sat Oct 24 14:51:59 UTC 2020 Modified Files: src/sys/arch/arm/arm32: bus_dma.c Log Message: Fix the logic around "parent is a subset and can be re-used" in bus_dmatag_subregion. Thanks to mrg@ for spotting the problem. To generate a diff of this commit: cvs rdiff -u -r1.123 -r1.124 src/sys/arch/arm/arm32/bus_dma.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/arm/arm32/bus_dma.c diff -u src/sys/arch/arm/arm32/bus_dma.c:1.123 src/sys/arch/arm/arm32/bus_dma.c:1.124 --- src/sys/arch/arm/arm32/bus_dma.c:1.123 Tue Sep 8 10:30:17 2020 +++ src/sys/arch/arm/arm32/bus_dma.c Sat Oct 24 14:51:59 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: bus_dma.c,v 1.123 2020/09/08 10:30:17 skrll Exp $ */ +/* $NetBSD: bus_dma.c,v 1.124 2020/10/24 14:51:59 skrll Exp $ */ /*- * Copyright (c) 1996, 1997, 1998, 2020 The NetBSD Foundation, Inc. @@ -36,7 +36,7 @@ #include "opt_cputypes.h" #include -__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.123 2020/09/08 10:30:17 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.124 2020/10/24 14:51:59 skrll Exp $"); #include @@ -1816,35 +1816,36 @@ _bus_dmatag_subregion(bus_dma_tag_t tag, #ifdef _ARM32_NEED_BUS_DMA_BOUNCE struct arm32_dma_range *dr; - bool subset = false; + bool psubset = true; size_t nranges = 0; size_t i; for (i = 0, dr = tag->_ranges; i < tag->_nranges; i++, dr++) { /* - * Are all the ranges in the parent tag a subset of the new - * range? If yes, we can continue to use the parent tag. + * If the new {min,max}_addr are narrower than any of the + * ranges in the parent tag then we need a new tag; + * otherwise the parent tag is a subset of the new + * range and can continue to be used. */ - if (dr->dr_sysbase >= min_addr - && dr->dr_sysbase + dr->dr_len - 1 <= max_addr) { - subset = true; - } else { - subset = false; + if (min_addr > dr->dr_sysbase + || max_addr < dr->dr_sysbase + dr->dr_len - 1) { + psubset = false; } if (min_addr <= dr->dr_sysbase + dr->dr_len && max_addr >= dr->dr_sysbase) { nranges++; } } - if (subset) { + if (nranges == 0) { + nranges = 1; + psubset = false; + } + if (psubset) { *newtag = tag; /* if the tag must be freed, add a reference */ if (tag->_tag_needs_free) (tag->_tag_needs_free)++; return 0; } - if (nranges == 0) { - nranges = 1; - } const size_t tagsize = sizeof(*tag) + nranges * sizeof(*dr); if ((*newtag = kmem_intr_zalloc(tagsize,
CVS commit: src/tests/lib/libcurses/director
Module Name:src Committed By: roy Date: Sat Oct 24 14:45:06 UTC 2020 Modified Files: src/tests/lib/libcurses/director: testlang_parse.y Log Message: Remove extra parens To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/tests/lib/libcurses/director/testlang_parse.y Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/lib/libcurses/director/testlang_parse.y diff -u src/tests/lib/libcurses/director/testlang_parse.y:1.18 src/tests/lib/libcurses/director/testlang_parse.y:1.19 --- src/tests/lib/libcurses/director/testlang_parse.y:1.18 Sat Oct 24 04:46:17 2020 +++ src/tests/lib/libcurses/director/testlang_parse.y Sat Oct 24 14:45:06 2020 @@ -1,5 +1,5 @@ %{ -/* $NetBSD: testlang_parse.y,v 1.18 2020/10/24 04:46:17 blymn Exp $ */ +/* $NetBSD: testlang_parse.y,v 1.19 2020/10/24 14:45:06 roy Exp $ */ /*- * Copyright 2009 Brett Lymn @@ -990,7 +990,7 @@ compare_streams(char *filename, bool dis int create_check_file = 0; - if ((check_file_flag == (GEN_CHECK_FILE | FORCE_GEN))) + if (check_file_flag == (GEN_CHECK_FILE | FORCE_GEN)) create_check_file = 1; else if ((check_fd = open(check_file, O_RDONLY, 0)) < 0){ if (check_file_flag & GEN_CHECK_FILE)
CVS commit: src/lib/libossaudio
Module Name:src Committed By: roy Date: Sat Oct 24 14:43:53 UTC 2020 Modified Files: src/lib/libossaudio: ossaudio.c Log Message: libossaudio: return newfd here as we return retval elsewhere To generate a diff of this commit: cvs rdiff -u -r1.57 -r1.58 src/lib/libossaudio/ossaudio.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libossaudio/ossaudio.c diff -u src/lib/libossaudio/ossaudio.c:1.57 src/lib/libossaudio/ossaudio.c:1.58 --- src/lib/libossaudio/ossaudio.c:1.57 Fri Oct 23 12:13:04 2020 +++ src/lib/libossaudio/ossaudio.c Sat Oct 24 14:43:53 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: ossaudio.c,v 1.57 2020/10/23 12:13:04 wiz Exp $ */ +/* $NetBSD: ossaudio.c,v 1.58 2020/10/24 14:43:53 roy Exp $ */ /*- * Copyright (c) 1997, 2020 The NetBSD Foundation, Inc. @@ -27,7 +27,7 @@ */ #include -__RCSID("$NetBSD: ossaudio.c,v 1.57 2020/10/23 12:13:04 wiz Exp $"); +__RCSID("$NetBSD: ossaudio.c,v 1.58 2020/10/24 14:43:53 roy Exp $"); /* * This is an Open Sound System compatibility layer, which provides @@ -1158,7 +1158,7 @@ mixer_oss4_ioctl(int fd, unsigned long c "/dev/audio%d", cardinfo->card); newfd = open(devname, O_RDONLY); if (newfd < 0) -return retval; +return newfd; } else { newfd = fd; }
CVS commit: src/tests/lib/libcurses
Module Name:src Committed By: martin Date: Sat Oct 24 14:21:26 UTC 2020 Modified Files: src/tests/lib/libcurses/check_files: Makefile src/tests/lib/libcurses/tests: Makefile Log Message: Add the new tests + check files, sort. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libcurses/check_files/Makefile cvs rdiff -u -r1.3 -r1.4 src/tests/lib/libcurses/tests/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/lib/libcurses/check_files/Makefile diff -u src/tests/lib/libcurses/check_files/Makefile:1.3 src/tests/lib/libcurses/check_files/Makefile:1.4 --- src/tests/lib/libcurses/check_files/Makefile:1.3 Sun May 26 09:54:33 2019 +++ src/tests/lib/libcurses/check_files/Makefile Sat Oct 24 14:21:25 2020 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.3 2019/05/26 09:54:33 blymn Exp $ +# $NetBSD: Makefile,v 1.4 2020/10/24 14:21:25 martin Exp $ NOMAN= # defined @@ -12,22 +12,36 @@ FILESDIR= ${TESTSDIR}/check_files FILES= curses_start.chk FILES+= add_wch1.chk FILES+= add_wch2.chk +FILES+= add_wch3.chk FILES+= addch.chk FILES+= addchstr.chk FILES+= addchstr2.chk +FILES+= addchstr3.chk +FILES+= addnwstr1.chk +FILES+= addnwstr2.chk FILES+= addstr.chk +FILES+= addwstr1.chk +FILES+= addwstr2.chk +FILES+= addwstr3.chk FILES+= attributes.chk -FILES+= bell.chk FILES+= background1.chk FILES+= background2.chk FILES+= background3.chk FILES+= background4.chk FILES+= background5.chk +FILES+= bell.chk FILES+= bkgdset1.chk +FILES+= blank.chk +FILES+= border_set1.chk +FILES+= border_set2.chk +FILES+= box_set1.chk +FILES+= box_set2.chk +FILES+= box_standout.chk FILES+= chgat1.chk FILES+= chgat2.chk FILES+= chgat3.chk FILES+= clear1.chk +FILES+= clear10.chk FILES+= clear2.chk FILES+= clear3.chk FILES+= clear4.chk @@ -36,14 +50,21 @@ FILES+= clear6.chk FILES+= clear7.chk FILES+= clear8.chk FILES+= clear9.chk -FILES+= clear10.chk +FILES+= clearok1.chk +FILES+= clearok2.chk +FILES+= clearok3.chk FILES+= color_blank_draw.chk -FILES+= color_start.chk -FILES+= color_default.chk FILES+= color_blue_back.chk +FILES+= color_default.chk FILES+= color_red_fore.chk FILES+= color_set.chk +FILES+= color_start.chk FILES+= copywin1.chk +FILES+= copywin10.chk +FILES+= copywin11.chk +FILES+= copywin12.chk +FILES+= copywin13.chk +FILES+= copywin14.chk FILES+= copywin2.chk FILES+= copywin3.chk FILES+= copywin4.chk @@ -52,11 +73,6 @@ FILES+= copywin6.chk FILES+= copywin7.chk FILES+= copywin8.chk FILES+= copywin9.chk -FILES+= copywin10.chk -FILES+= copywin11.chk -FILES+= copywin12.chk -FILES+= copywin13.chk -FILES+= copywin14.chk FILES+= curs_set1.chk FILES+= curs_set2.chk FILES+= curs_set3.chk @@ -66,6 +82,8 @@ FILES+= delch2.chk FILES+= delch3.chk FILES+= delch4.chk FILES+= delch5.chk +FILES+= delch6.chk +FILES+= delch7.chk FILES+= deleteln1.chk FILES+= deleteln2.chk FILES+= deleteln3.chk @@ -79,11 +97,47 @@ FILES+= derwin2.chk FILES+= doupdate.chk FILES+= dupwin1.chk FILES+= dupwin2.chk +FILES+= echochar1.chk +FILES+= echochar2.chk FILES+= fill.chk +FILES+= fill_screen_numbers.chk +FILES+= fill_window_numbers.chk FILES+= flash.chk +FILES+= get_wstr.chk +FILES+= getch.chk +FILES+= getn_wstr.chk FILES+= hline.chk -FILES+= insch.chk +FILES+= hline1.chk +FILES+= hline2.chk +FILES+= hline_set.chk FILES+= home.chk +FILES+= immedok.chk +FILES+= ins_nwstr1.chk +FILES+= ins_wch1.chk +FILES+= ins_wch2.chk +FILES+= ins_wch3.chk +FILES+= ins_wstr1.chk +FILES+= ins_wstr2.chk +FILES+= insch.chk +FILES+= insch1.chk +FILES+= insch2.chk +FILES+= insdelln1.chk +FILES+= insdelln3.chk +FILES+= insdelln4.chk +FILES+= insdelln5.chk +FILES+= insdelln6.chk +FILES+= insdelln7.chk +FILES+= insdelln_1.chk +FILES+= insdelln_3.chk +FILES+= insdelln_4.chk +FILES+= insdelln_5.chk +FILES+= insdelln_6.chk +FILES+= insertln1.chk +FILES+= insertln3.chk +FILES+= insertln4.chk +FILES+= insertln5.chk +FILES+= insertln6.chk +FILES+= leaveok.chk FILES+= meta1.chk FILES+= meta2.chk FILES+= mutt_test1.chk @@ -101,13 +155,16 @@ FILES+= mvaddchnstr2.chk FILES+= mvaddchstr.chk FILES+= mvaddnstr.chk FILES+= mvaddnstr2.chk +FILES+= mvaddnwstr1.chk FILES+= mvaddstr.chk FILES+= mvaddstr2.chk +FILES+= mvaddwstr1.chk FILES+= mvchgat.chk FILES+= mvchgat2.chk FILES+= mvcur.chk FILES+= mvderwin1.chk FILES+= mvderwin2.chk +FILES+= mvget_wch.chk FILES+= mvgetnstr1.chk FILES+= mvgetnstr2.chk FILES+= mvgetnstr3.chk @@ -115,26 +172,99 @@ FILES+= mvgetnstr4.chk FILES+= mvgetstr1.chk FILES+= mvgetstr2.chk FILES+= mvgetstr3.chk +FILES+= mvins_wch.chk FILES+= mvprintw.chk FILES+= mvvline1.chk FILES+= mvvline2.chk FILES+= mvvline3.chk +FILES+= mvwaddnwstr1.chk +FILES+= mvwaddstr.chk +FILES+= mvwaddwstr1.chk +FILES+=
CVS commit: src/sys/arch/sparc64/sparc64
Module Name:src Committed By: jdc Date: Sat Oct 24 13:47:53 UTC 2020 Modified Files: src/sys/arch/sparc64/sparc64: ofw_patch.c Log Message: Add E250 i2c devices missing from the OFW tree. Normalise the spelling of "temperature". To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/arch/sparc64/sparc64/ofw_patch.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/sparc64/sparc64/ofw_patch.c diff -u src/sys/arch/sparc64/sparc64/ofw_patch.c:1.3 src/sys/arch/sparc64/sparc64/ofw_patch.c:1.4 --- src/sys/arch/sparc64/sparc64/ofw_patch.c:1.3 Fri Oct 23 17:53:07 2020 +++ src/sys/arch/sparc64/sparc64/ofw_patch.c Sat Oct 24 13:47:53 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: ofw_patch.c,v 1.3 2020/10/23 17:53:07 jdc Exp $ */ +/* $NetBSD: ofw_patch.c,v 1.4 2020/10/24 13:47:53 jdc Exp $ */ /*- * Copyright (c) 2020 The NetBSD Foundation, Inc. @@ -29,7 +29,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__KERNEL_RCSID(0, "$NetBSD: ofw_patch.c,v 1.3 2020/10/23 17:53:07 jdc Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ofw_patch.c,v 1.4 2020/10/24 13:47:53 jdc Exp $"); #include @@ -187,13 +187,13 @@ add_i2c_props_e450(device_t busdev, uint /* Power supply 1 temperature. */ add_i2c_device(cfg, "PSU-1", "ecadc", 0x48, node); - /* Power supply 2 termperature. */ + /* Power supply 2 temperature. */ add_i2c_device(cfg, "PSU-2", "ecadc", 0x49, node); - /* Power supply 3 tempterature. */ + /* Power supply 3 temperature. */ add_i2c_device(cfg, "PSU-3", "ecadc", 0x4a, node); - /* Ambient tempterature. */ + /* Ambient temperature. */ add_i2c_device(cfg, "ambient", "i2c-lm75", 0x4d, node); /* CPU temperatures. */ @@ -206,15 +206,29 @@ void add_i2c_props_e250(device_t busdev, uint64_t node) { prop_array_t cfg; + int i; DPRINTF(ACDB_PROBE, ("\nAdding sensors for %s ", machine_model)); cfg = create_i2c_dict(busdev); /* PSU temperature / CPU fan */ add_i2c_device(cfg, "PSU", "ecadc", 0x4a, node); + /* CPU & system board temperature */ add_i2c_device(cfg, "CPU", "ecadc", 0x4f, node); + /* GPIO's */ + for (i = 0x38; i <= 0x39; i++) + add_i2c_device(cfg, "gpio", "i2c-pcf8574", i, node); + for (i = 0x3d; i <= 0x3f; i++) + add_i2c_device(cfg, "gpio", "i2c-pcf8574", i, node); + + /* NVRAM */ + add_i2c_device(cfg, "nvram", "i2c-at24c02", 0x52, node); + + /* RSC clock */ + add_i2c_device(cfg, "rscrtc", "i2c-ds1307", 0x68, node); + prop_object_release(cfg); }
CVS commit: src/sbin/mount
Module Name:src Committed By: nia Date: Sat Oct 24 10:51:34 UTC 2020 Modified Files: src/sbin/mount: mount.8 Log Message: file systems that are used as what spools? To generate a diff of this commit: cvs rdiff -u -r1.87 -r1.88 src/sbin/mount/mount.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/mount/mount.8 diff -u src/sbin/mount/mount.8:1.87 src/sbin/mount/mount.8:1.88 --- src/sbin/mount/mount.8:1.87 Tue Jan 9 09:15:57 2018 +++ src/sbin/mount/mount.8 Sat Oct 24 10:51:34 2020 @@ -1,4 +1,4 @@ -.\" $NetBSD: mount.8,v 1.87 2018/01/09 09:15:57 wiz Exp $ +.\" $NetBSD: mount.8,v 1.88 2020/10/24 10:51:34 nia Exp $ .\" .\" Copyright (c) 1980, 1989, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" @(#)mount.8 8.8 (Berkeley) 6/16/94 .\" -.Dd January 8, 2018 +.Dd October 24, 2020 .Dt MOUNT 8 .Os .Sh NAME @@ -239,8 +239,8 @@ list of file systems shown by default wi .Xr df 1 . .It Cm noatime Never update the access time field for files. -This option is useful for optimizing read performance on file systems -that are used as news spools. +This option is useful for optimizing read performance on file systems, +and avoiding excess writes on flash-based file systems. .It Cm noauto This file system should be skipped when mount is run with the .Fl a
CVS commit: src/usr.bin/make
Module Name:src Committed By: rillig Date: Sat Oct 24 10:36:23 UTC 2020 Modified Files: src/usr.bin/make: lst.c lst.h main.c suff.c Log Message: make(1): remove unused Lst_Find and Lst_FindFrom To generate a diff of this commit: cvs rdiff -u -r1.86 -r1.87 src/usr.bin/make/lst.c cvs rdiff -u -r1.78 -r1.79 src/usr.bin/make/lst.h cvs rdiff -u -r1.386 -r1.387 src/usr.bin/make/main.c cvs rdiff -u -r1.221 -r1.222 src/usr.bin/make/suff.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/make/lst.c diff -u src/usr.bin/make/lst.c:1.86 src/usr.bin/make/lst.c:1.87 --- src/usr.bin/make/lst.c:1.86 Sat Oct 24 10:18:29 2020 +++ src/usr.bin/make/lst.c Sat Oct 24 10:36:23 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: lst.c,v 1.86 2020/10/24 10:18:29 rillig Exp $ */ +/* $NetBSD: lst.c,v 1.87 2020/10/24 10:36:23 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -34,7 +34,7 @@ #include "make.h" -MAKE_RCSID("$NetBSD: lst.c,v 1.86 2020/10/24 10:18:29 rillig Exp $"); +MAKE_RCSID("$NetBSD: lst.c,v 1.87 2020/10/24 10:36:23 rillig Exp $"); static ListNode * LstNodeNew(ListNode *prev, ListNode *next, void *datum) @@ -204,39 +204,10 @@ LstNode_SetNull(ListNode *node) node->datum = NULL; } - /* * Functions for entire lists */ -/* Return the first node from the list for which the match function returns - * TRUE, or NULL if none of the nodes matched. */ -ListNode * -Lst_Find(List *list, LstFindProc match, const void *matchArgs) -{ -return Lst_FindFrom(list, list->first, match, matchArgs); -} - -/* Return the first node from the list, starting at the given node, for which - * the match function returns TRUE, or NULL if none of the nodes matches. - * - * The start node may be NULL, in which case nothing is found. */ -ListNode * -Lst_FindFrom(List *list, ListNode *node, - LstFindProc match, const void *matchArgs) -{ -ListNode *tln; - -assert(list != NULL); -assert(match != NULL); - -for (tln = node; tln != NULL; tln = tln->next) - if (match(tln->datum, matchArgs)) - return tln; - -return NULL; -} - /* Return the first node that contains the given datum, or NULL. */ ListNode * Lst_FindDatum(List *list, const void *datum) Index: src/usr.bin/make/lst.h diff -u src/usr.bin/make/lst.h:1.78 src/usr.bin/make/lst.h:1.79 --- src/usr.bin/make/lst.h:1.78 Fri Oct 23 04:58:33 2020 +++ src/usr.bin/make/lst.h Sat Oct 24 10:36:23 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: lst.h,v 1.78 2020/10/23 04:58:33 rillig Exp $ */ +/* $NetBSD: lst.h,v 1.79 2020/10/24 10:36:23 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -108,8 +108,6 @@ struct List { typedef void *LstCopyProc(void *); /* Free the datum of a node, called before freeing the node itself. */ typedef void LstFreeProc(void *); -/* Return TRUE if the datum matches the args, for Lst_Find. */ -typedef Boolean LstFindProc(const void *datum, const void *args); /* An action for Lst_ForEachUntil and Lst_ForEachUntilConcurrent. */ typedef int LstActionUntilProc(void *datum, void *args); @@ -129,11 +127,6 @@ void Lst_Destroy(List *, LstFreeProc); static inline MAKE_ATTR_UNUSED Boolean Lst_IsEmpty(List *list) { return list->first == NULL; } -/* Find the first node for which the function returns TRUE, or NULL. */ -ListNode *Lst_Find(List *, LstFindProc, const void *); -/* Find the first node for which the function returns TRUE, or NULL. - * The search starts at the given node, towards the end of the list. */ -ListNode *Lst_FindFrom(List *, ListNode *, LstFindProc, const void *); /* Find the first node that contains the given datum, or NULL. */ ListNode *Lst_FindDatum(List *, const void *); Index: src/usr.bin/make/main.c diff -u src/usr.bin/make/main.c:1.386 src/usr.bin/make/main.c:1.387 --- src/usr.bin/make/main.c:1.386 Sat Oct 24 09:28:50 2020 +++ src/usr.bin/make/main.c Sat Oct 24 10:36:23 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.386 2020/10/24 09:28:50 rillig Exp $ */ +/* $NetBSD: main.c,v 1.387 2020/10/24 10:36:23 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -118,7 +118,7 @@ #include "trace.h" /* "@(#)main.c 8.3 (Berkeley) 3/19/94" */ -MAKE_RCSID("$NetBSD: main.c,v 1.386 2020/10/24 09:28:50 rillig Exp $"); +MAKE_RCSID("$NetBSD: main.c,v 1.387 2020/10/24 10:36:23 rillig Exp $"); #if defined(MAKE_NATIVE) && !defined(lint) __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 " "The Regents of the University of California. " @@ -791,7 +791,7 @@ Main_SetVarObjdir(const char *var, const } /* Read and parse the makefile. - * Return TRUE if reading the makefile succeeded, for Lst_Find. */ + * Return TRUE if reading the makefile succeeded. */ static int ReadMakefileSucceeded(void *fname, void *unused) { Index: src/usr.bin/make/suff.c diff -u src/usr.bin/make/suff.c:1.221 src/usr.bin/make/suff.c:1.222 ---
CVS commit: src/usr.bin/make
Module Name:src Committed By: rillig Date: Sat Oct 24 10:32:25 UTC 2020 Modified Files: src/usr.bin/make: meta.c Log Message: make(1): inline Lst_Find in meta_oodate To generate a diff of this commit: cvs rdiff -u -r1.129 -r1.130 src/usr.bin/make/meta.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/make/meta.c diff -u src/usr.bin/make/meta.c:1.129 src/usr.bin/make/meta.c:1.130 --- src/usr.bin/make/meta.c:1.129 Sat Oct 24 10:17:21 2020 +++ src/usr.bin/make/meta.c Sat Oct 24 10:32:25 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: meta.c,v 1.129 2020/10/24 10:17:21 rillig Exp $ */ +/* $NetBSD: meta.c,v 1.130 2020/10/24 10:32:25 rillig Exp $ */ /* * Implement 'meta' mode. @@ -970,13 +970,6 @@ path_starts_with(const char *path, const return path[n] == '\0' || path[n] == '/'; } -static Boolean -string_match(const void *p, const void *q) -{ -return strcmp(p, q) == 0; -} - - static int meta_ignore(GNode *gn, const char *p) { @@ -1060,6 +1053,17 @@ meta_ignore(GNode *gn, const char *p) *ep = '\0'; \ } +static void +append_if_new(StringList *list, const char *str) +{ +StringListNode *ln; + +for (ln = list->first; ln != NULL; ln = ln->next) +if (strcmp(ln->datum, str) == 0) + return; +Lst_Append(list, bmake_strdup(str)); +} + Boolean meta_oodate(GNode *gn, Boolean oodate) { @@ -1384,10 +1388,8 @@ meta_oodate(GNode *gn, Boolean oodate) if ((link_src != NULL && cached_lstat(p, ) < 0) || (link_src == NULL && cached_stat(p, ) < 0)) { - if (!meta_ignore(gn, p)) { - if (Lst_Find(missingFiles, string_match, p) == NULL) -Lst_Append(missingFiles, bmake_strdup(p)); - } + if (!meta_ignore(gn, p)) + append_if_new(missingFiles, p); } break; check_link_src: @@ -1470,8 +1472,7 @@ meta_oodate(GNode *gn, Boolean oodate) * A referenced file outside of CWD is missing. * We cannot catch every eventuality here... */ - if (Lst_Find(missingFiles, string_match, p) == NULL) -Lst_Append(missingFiles, bmake_strdup(p)); + append_if_new(missingFiles, p); } } if (buf[0] == 'E') {
CVS commit: src/usr.bin/make
Module Name:src Committed By: rillig Date: Sat Oct 24 10:18:29 UTC 2020 Modified Files: src/usr.bin/make: lst.c Log Message: make(1): clean up comments in list functions To generate a diff of this commit: cvs rdiff -u -r1.85 -r1.86 src/usr.bin/make/lst.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/make/lst.c diff -u src/usr.bin/make/lst.c:1.85 src/usr.bin/make/lst.c:1.86 --- src/usr.bin/make/lst.c:1.85 Sat Oct 24 09:03:54 2020 +++ src/usr.bin/make/lst.c Sat Oct 24 10:18:29 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: lst.c,v 1.85 2020/10/24 09:03:54 rillig Exp $ */ +/* $NetBSD: lst.c,v 1.86 2020/10/24 10:18:29 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -34,7 +34,7 @@ #include "make.h" -MAKE_RCSID("$NetBSD: lst.c,v 1.85 2020/10/24 09:03:54 rillig Exp $"); +MAKE_RCSID("$NetBSD: lst.c,v 1.86 2020/10/24 10:18:29 rillig Exp $"); static ListNode * LstNodeNew(ListNode *prev, ListNode *next, void *datum) @@ -77,7 +77,7 @@ Lst_Copy(List *list, LstCopyProc copyPro return newList; } -/* Free a list and all its nodes. The list data itself are not freed though. */ +/* Free a list and all its nodes. The node data are not freed though. */ void Lst_Free(List *list) { @@ -113,8 +113,7 @@ Lst_Destroy(List *list, LstFreeProc free * Functions to modify a list */ -/* Insert a new node with the given piece of data before the given node in the - * given list. */ +/* Insert a new node with the datum before the given node. */ void Lst_InsertBefore(List *list, ListNode *node, void *datum) {
CVS commit: src/usr.bin/make
Module Name:src Committed By: rillig Date: Sat Oct 24 10:17:21 UTC 2020 Modified Files: src/usr.bin/make: meta.c Log Message: make(1): make Lst_RemoveIf simpler in meta_oodate Using Lst_Find and Lst_FindFrom to implement Lst_RemoveIf was a bad idea. It made the code much more complicated than necessary. There is no predefined Lst_RemoveIf, but that can be implemented easily. By inlining the list handling, path_match does not need void pointers anymore. Freeing the path from the missingFiles list had been implemented in a surprisingly complicated way, intermangling it unnecessarily with the list operations, even though these are completely independent. To generate a diff of this commit: cvs rdiff -u -r1.128 -r1.129 src/usr.bin/make/meta.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/make/meta.c diff -u src/usr.bin/make/meta.c:1.128 src/usr.bin/make/meta.c:1.129 --- src/usr.bin/make/meta.c:1.128 Sat Oct 24 04:31:53 2020 +++ src/usr.bin/make/meta.c Sat Oct 24 10:17:21 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: meta.c,v 1.128 2020/10/24 04:31:53 rillig Exp $ */ +/* $NetBSD: meta.c,v 1.129 2020/10/24 10:17:21 rillig Exp $ */ /* * Implement 'meta' mode. @@ -961,10 +961,8 @@ prefix_match(void *p, void *q) /* See if the path equals prefix or starts with "prefix/". */ static Boolean -path_match(const void *p, const void *q) +path_starts_with(const char *path, const char *prefix) { -const char *path = p; -const char *prefix = q; size_t n = strlen(prefix); if (strncmp(path, prefix, n) != 0) @@ -1315,22 +1313,16 @@ meta_oodate(GNode *gn, Boolean oodate) DEQUOTE(move_target); /* FALLTHROUGH */ case 'D': /* unlink */ - if (*p == '/' && !Lst_IsEmpty(missingFiles)) { + if (*p == '/') { /* remove any missingFiles entries that match p */ - StringListNode *missingNode = -Lst_Find(missingFiles, path_match, p); - if (missingNode != NULL) { - StringListNode *nln; - - do { -char *tp; -nln = Lst_FindFrom(missingFiles, - missingNode->next, - path_match, p); -tp = missingNode->datum; -Lst_Remove(missingFiles, missingNode); -free(tp); - } while ((missingNode = nln) != NULL); + StringListNode *ln = missingFiles->first; + while (ln != NULL) { + StringListNode *next = ln->next; + if (path_starts_with(ln->datum, p)) { + free(ln->datum); + Lst_Remove(missingFiles, ln); + } + ln = next; } } if (buf[0] == 'M') {
CVS commit: src/usr.bin/make
Module Name:src Committed By: rillig Date: Sat Oct 24 09:28:50 UTC 2020 Modified Files: src/usr.bin/make: main.c Log Message: make(1): inline ReadMakefileFailed, eliminating some void pointers To generate a diff of this commit: cvs rdiff -u -r1.385 -r1.386 src/usr.bin/make/main.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/make/main.c diff -u src/usr.bin/make/main.c:1.385 src/usr.bin/make/main.c:1.386 --- src/usr.bin/make/main.c:1.385 Fri Oct 23 06:27:39 2020 +++ src/usr.bin/make/main.c Sat Oct 24 09:28:50 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.385 2020/10/23 06:27:39 rillig Exp $ */ +/* $NetBSD: main.c,v 1.386 2020/10/24 09:28:50 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -118,7 +118,7 @@ #include "trace.h" /* "@(#)main.c 8.3 (Berkeley) 3/19/94" */ -MAKE_RCSID("$NetBSD: main.c,v 1.385 2020/10/23 06:27:39 rillig Exp $"); +MAKE_RCSID("$NetBSD: main.c,v 1.386 2020/10/24 09:28:50 rillig Exp $"); #if defined(MAKE_NATIVE) && !defined(lint) __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993 " "The Regents of the University of California. " @@ -792,20 +792,12 @@ Main_SetVarObjdir(const char *var, const /* Read and parse the makefile. * Return TRUE if reading the makefile succeeded, for Lst_Find. */ -static Boolean -ReadMakefileSucceeded(const void *fname, const void *unused) +static int +ReadMakefileSucceeded(void *fname, void *unused) { return ReadMakefile(fname) == 0; } -/* Read and parse the makefile. - * Return TRUE if reading the makefile failed, for Lst_Find. */ -static Boolean -ReadMakefileFailed(const void *fname, const void *unused) -{ - return ReadMakefile(fname) != 0; -} - int str2Lst_Append(StringList *lp, char *str, const char *sep) { @@ -1385,8 +1377,6 @@ main(int argc, char **argv) * if no makefiles were given on the command line. */ if (!noBuiltins) { - StringListNode *ln; - sysMkPath = Lst_New(); Dir_Expand(_PATH_DEFSYSMK, Lst_IsEmpty(sysIncPath) ? defIncPath : sysIncPath, @@ -1394,25 +1384,25 @@ main(int argc, char **argv) if (Lst_IsEmpty(sysMkPath)) Fatal("%s: no system rules (%s).", progname, _PATH_DEFSYSMK); - ln = Lst_Find(sysMkPath, ReadMakefileSucceeded, NULL); - if (ln == NULL) + if (!Lst_ForEachUntil(sysMkPath, ReadMakefileSucceeded, NULL)) Fatal("%s: cannot open %s.", progname, (char *)sysMkPath->first->datum); } - if (!Lst_IsEmpty(makefiles)) { + if (makefiles->first != NULL) { StringListNode *ln; - ln = Lst_Find(makefiles, ReadMakefileFailed, NULL); - if (ln != NULL) - Fatal("%s: cannot open %s.", progname, - (char *)ln->datum); + for (ln = makefiles->first; ln != NULL; ln = ln->next) { + if (ReadMakefile(ln->datum) != 0) +Fatal("%s: cannot open %s.", + progname, (char *)ln->datum); + } } else { (void)Var_Subst("${" MAKEFILE_PREFERENCE "}", VAR_CMD, VARE_WANTRES, ); /* TODO: handle errors */ (void)str2Lst_Append(makefiles, p1, NULL); - (void)Lst_Find(makefiles, ReadMakefileSucceeded, NULL); + (void)Lst_ForEachUntil(makefiles, ReadMakefileSucceeded, NULL); free(p1); }
CVS commit: src/usr.bin/make
Module Name:src Committed By: rillig Date: Sat Oct 24 09:18:09 UTC 2020 Modified Files: src/usr.bin/make: dir.c Log Message: make(1): inline DirFindName To generate a diff of this commit: cvs rdiff -u -r1.172 -r1.173 src/usr.bin/make/dir.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/make/dir.c diff -u src/usr.bin/make/dir.c:1.172 src/usr.bin/make/dir.c:1.173 --- src/usr.bin/make/dir.c:1.172 Thu Oct 22 05:50:02 2020 +++ src/usr.bin/make/dir.c Sat Oct 24 09:18:09 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: dir.c,v 1.172 2020/10/22 05:50:02 rillig Exp $ */ +/* $NetBSD: dir.c,v 1.173 2020/10/24 09:18:09 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -135,7 +135,7 @@ #include "job.h" /* "@(#)dir.c 8.2 (Berkeley) 1/2/94" */ -MAKE_RCSID("$NetBSD: dir.c,v 1.172 2020/10/22 05:50:02 rillig Exp $"); +MAKE_RCSID("$NetBSD: dir.c,v 1.173 2020/10/24 09:18:09 rillig Exp $"); #define DIR_DEBUG0(text) DEBUG0(DIR, text) #define DIR_DEBUG1(fmt, arg1) DEBUG1(DIR, fmt, arg1) @@ -527,16 +527,6 @@ Dir_SetPATH(void) } } -/* See if the CachedDir structure describes the same directory as the - * given one by comparing their names. Called from Dir_AddDir via - * Lst_Find when searching the list of open directories. */ -static Boolean -DirFindName(const void *p, const void *desiredName) -{ -const CachedDir *dir = p; -return strcmp(dir->name, desiredName) == 0; -} - /* See if the given name has any wildcard characters in it. Be careful not to * expand unmatching brackets or braces. * @@ -1508,9 +1498,13 @@ Dir_AddDir(SearchPath *path, const char struct dirent *dp; if (path != NULL && strcmp(name, ".DOTLAST") == 0) { - SearchPathNode *ln = Lst_Find(path, DirFindName, name); - if (ln != NULL) - return ln->datum; + SearchPathNode *ln; + + for (ln = path->first; ln != NULL; ln = ln->next) { + CachedDir *pathDir = ln->datum; + if (strcmp(pathDir->name, name) == 0) + return pathDir; + } dotLast->refCount++; Lst_Prepend(path, dotLast);
CVS commit: src/usr.bin/make
Module Name:src Committed By: rillig Date: Sat Oct 24 09:03:54 UTC 2020 Modified Files: src/usr.bin/make: lst.c Log Message: make(1): clean up code in lst.c To generate a diff of this commit: cvs rdiff -u -r1.84 -r1.85 src/usr.bin/make/lst.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/make/lst.c diff -u src/usr.bin/make/lst.c:1.84 src/usr.bin/make/lst.c:1.85 --- src/usr.bin/make/lst.c:1.84 Sat Oct 24 08:56:27 2020 +++ src/usr.bin/make/lst.c Sat Oct 24 09:03:54 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: lst.c,v 1.84 2020/10/24 08:56:27 rillig Exp $ */ +/* $NetBSD: lst.c,v 1.85 2020/10/24 09:03:54 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -34,7 +34,7 @@ #include "make.h" -MAKE_RCSID("$NetBSD: lst.c,v 1.84 2020/10/24 08:56:27 rillig Exp $"); +MAKE_RCSID("$NetBSD: lst.c,v 1.85 2020/10/24 09:03:54 rillig Exp $"); static ListNode * LstNodeNew(ListNode *prev, ListNode *next, void *datum) @@ -46,12 +46,6 @@ LstNodeNew(ListNode *prev, ListNode *nex return node; } -static Boolean -LstIsEmpty(List *list) -{ -return list->first == NULL; -} - /* Create and initialize a new, empty list. */ List * Lst_New(void) @@ -126,19 +120,16 @@ Lst_InsertBefore(List *list, ListNode *n { ListNode *newNode; -assert(!LstIsEmpty(list)); assert(datum != NULL); newNode = LstNodeNew(node->prev, node, datum); -if (node->prev != NULL) { +if (node->prev != NULL) node->prev->next = newNode; -} node->prev = newNode; -if (node == list->first) { +if (node == list->first) list->first = newNode; -} } /* Add a piece of data at the start of the given list. */ @@ -184,26 +175,17 @@ Lst_Append(List *list, void *datum) void Lst_Remove(List *list, ListNode *node) { -/* - * unlink it from the list - */ -if (node->next != NULL) { +/* unlink it from its neighbors */ +if (node->next != NULL) node->next->prev = node->prev; -} -if (node->prev != NULL) { +if (node->prev != NULL) node->prev->next = node->next; -} -/* - * if either the first or last of the list point to this node, - * adjust them accordingly - */ -if (list->first == node) { +/* unlink it from the list */ +if (list->first == node) list->first = node->next; -} -if (list->last == node) { +if (list->last == node) list->last = node->prev; -} } /* Replace the datum in the given node with the new datum. */ @@ -241,17 +223,17 @@ Lst_Find(List *list, LstFindProc match, * * The start node may be NULL, in which case nothing is found. */ ListNode * -Lst_FindFrom(List *list, ListNode *node, LstFindProc match, const void *matchArgs) +Lst_FindFrom(List *list, ListNode *node, + LstFindProc match, const void *matchArgs) { ListNode *tln; assert(list != NULL); assert(match != NULL); -for (tln = node; tln != NULL; tln = tln->next) { +for (tln = node; tln != NULL; tln = tln->next) if (match(tln->datum, matchArgs)) return tln; -} return NULL; } @@ -264,11 +246,9 @@ Lst_FindDatum(List *list, const void *da assert(datum != NULL); -for (node = list->first; node != NULL; node = node->next) { - if (node->datum == datum) { +for (node = list->first; node != NULL; node = node->next) + if (node->datum == datum) return node; - } -} return NULL; } @@ -294,11 +274,11 @@ Lst_MoveAll(List *list1, List *list2) { if (list2->first != NULL) { list2->first->prev = list1->last; - if (list1->last != NULL) { + if (list1->last != NULL) list1->last->next = list2->first; - } else { + else list1->first = list2->first; - } + list1->last = list2->last; } free(list2);
CVS commit: src/sys/compat/linux/common
Module Name:src Committed By: mgorny Date: Sat Oct 24 09:01:56 UTC 2020 Modified Files: src/sys/compat/linux/common: linux_socket.c Log Message: Fix compat with Linux programs that use longer namelen for sockets Linux is less strict than NetBSD and permits namelen to be larger than valid struct sockaddr_in*. If this is the case, truncate the value to the correct size, so that NetBSD networking does not return an error. Reviewed by kamil To generate a diff of this commit: cvs rdiff -u -r1.150 -r1.151 src/sys/compat/linux/common/linux_socket.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/compat/linux/common/linux_socket.c diff -u src/sys/compat/linux/common/linux_socket.c:1.150 src/sys/compat/linux/common/linux_socket.c:1.151 --- src/sys/compat/linux/common/linux_socket.c:1.150 Thu Jul 16 15:02:08 2020 +++ src/sys/compat/linux/common/linux_socket.c Sat Oct 24 09:01:56 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: linux_socket.c,v 1.150 2020/07/16 15:02:08 msaitoh Exp $ */ +/* $NetBSD: linux_socket.c,v 1.151 2020/10/24 09:01:56 mgorny Exp $ */ /*- * Copyright (c) 1995, 1998, 2008 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: linux_socket.c,v 1.150 2020/07/16 15:02:08 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_socket.c,v 1.151 2020/10/24 09:01:56 mgorny Exp $"); #if defined(_KERNEL_OPT) #include "opt_inet.h" @@ -1612,6 +1612,21 @@ linux_get_sa(struct lwp *l, int s, struc sin6->sin6_scope_id = 0; } + /* + * Linux is less strict than NetBSD and permits namelen to be larger + * than valid struct sockaddr_in*. If this is the case, truncate + * the value to the correct size, so that NetBSD networking does not + * return an error. + */ + switch (bdom) { + case AF_INET: + namelen = MIN(namelen, sizeof(struct sockaddr_in)); + break; + case AF_INET6: + namelen = MIN(namelen, sizeof(struct sockaddr_in6)); + break; + } + sb->sb_family = bdom; sb->sb_len = namelen; ktrkuser("mbsoname", sb, namelen);
CVS commit: src/sys/dev/pci
Module Name:src Committed By: skrll Date: Sat Oct 24 09:00:35 UTC 2020 Modified Files: src/sys/dev/pci: ld_virtio.c Log Message: Use BUS_DMA_WAITOK in ld_virtio_alloc_reqs which is called at attached time... To generate a diff of this commit: cvs rdiff -u -r1.27 -r1.28 src/sys/dev/pci/ld_virtio.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pci/ld_virtio.c diff -u src/sys/dev/pci/ld_virtio.c:1.27 src/sys/dev/pci/ld_virtio.c:1.28 --- src/sys/dev/pci/ld_virtio.c:1.27 Thu Jan 17 10:20:01 2019 +++ src/sys/dev/pci/ld_virtio.c Sat Oct 24 09:00:35 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: ld_virtio.c,v 1.27 2019/01/17 10:20:01 hannken Exp $ */ +/* $NetBSD: ld_virtio.c,v 1.28 2020/10/24 09:00:35 skrll Exp $ */ /* * Copyright (c) 2010 Minoura Makoto. @@ -26,7 +26,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ld_virtio.c,v 1.27 2019/01/17 10:20:01 hannken Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ld_virtio.c,v 1.28 2020/10/24 09:00:35 skrll Exp $"); #include #include @@ -176,7 +176,7 @@ ld_virtio_alloc_reqs(struct ld_virtio_so allocsize = sizeof(struct virtio_blk_req) * qsize; r = bus_dmamem_alloc(virtio_dmat(sc->sc_virtio), allocsize, 0, 0, - >sc_reqs_seg, 1, , BUS_DMA_NOWAIT); + >sc_reqs_seg, 1, , BUS_DMA_WAITOK); if (r != 0) { aprint_error_dev(sc->sc_dev, "DMA memory allocation failed, size %d, " @@ -185,7 +185,7 @@ ld_virtio_alloc_reqs(struct ld_virtio_so } r = bus_dmamem_map(virtio_dmat(sc->sc_virtio), >sc_reqs_seg, 1, allocsize, - , BUS_DMA_NOWAIT); + , BUS_DMA_WAITOK); if (r != 0) { aprint_error_dev(sc->sc_dev, "DMA memory map failed, " @@ -201,7 +201,7 @@ ld_virtio_alloc_reqs(struct ld_virtio_so 1, offsetof(struct virtio_blk_req, vr_bp), 0, - BUS_DMA_NOWAIT|BUS_DMA_ALLOCNOW, + BUS_DMA_WAITOK|BUS_DMA_ALLOCNOW, >vr_cmdsts); if (r != 0) { aprint_error_dev(sc->sc_dev, @@ -212,7 +212,7 @@ ld_virtio_alloc_reqs(struct ld_virtio_so r = bus_dmamap_load(virtio_dmat(sc->sc_virtio), vr->vr_cmdsts, >vr_hdr, offsetof(struct virtio_blk_req, vr_bp), -NULL, BUS_DMA_NOWAIT); +NULL, BUS_DMA_WAITOK); if (r != 0) { aprint_error_dev(sc->sc_dev, "command dmamap load failed, " @@ -225,7 +225,7 @@ ld_virtio_alloc_reqs(struct ld_virtio_so VIRTIO_BLK_MIN_SEGMENTS, ld->sc_maxxfer, 0, - BUS_DMA_NOWAIT|BUS_DMA_ALLOCNOW, + BUS_DMA_WAITOK|BUS_DMA_ALLOCNOW, >vr_payload); if (r != 0) { aprint_error_dev(sc->sc_dev,
CVS commit: src/sys/dev/acpi
Module Name:src Committed By: skrll Date: Sat Oct 24 08:57:06 UTC 2020 Modified Files: src/sys/dev/acpi: vmbus_acpi.c Log Message: Test the 64bit dma tag with BUS_DMA_TAG_VALID before using it. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/dev/acpi/vmbus_acpi.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/acpi/vmbus_acpi.c diff -u src/sys/dev/acpi/vmbus_acpi.c:1.2 src/sys/dev/acpi/vmbus_acpi.c:1.3 --- src/sys/dev/acpi/vmbus_acpi.c:1.2 Fri May 24 14:28:48 2019 +++ src/sys/dev/acpi/vmbus_acpi.c Sat Oct 24 08:57:06 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: vmbus_acpi.c,v 1.2 2019/05/24 14:28:48 nonaka Exp $ */ +/* $NetBSD: vmbus_acpi.c,v 1.3 2020/10/24 08:57:06 skrll Exp $ */ /* * Copyright (c) 2018 Kimihiro Nonaka @@ -26,7 +26,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: vmbus_acpi.c,v 1.2 2019/05/24 14:28:48 nonaka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vmbus_acpi.c,v 1.3 2020/10/24 08:57:06 skrll Exp $"); #include #include @@ -84,7 +84,8 @@ vmbus_acpi_attach(device_t parent, devic sc->sc.sc_dev = self; sc->sc.sc_iot = aa->aa_iot; sc->sc.sc_memt = aa->aa_memt; - sc->sc.sc_dmat = aa->aa_dmat64 ? aa->aa_dmat64 : aa->aa_dmat; + sc->sc.sc_dmat = BUS_DMA_TAG_VALID(aa->aa_dmat64) ? + aa->aa_dmat64 : aa->aa_dmat; if (vmbus_attach(>sc)) return;
CVS commit: src/usr.bin/make
Module Name:src Committed By: rillig Date: Sat Oct 24 08:56:27 UTC 2020 Modified Files: src/usr.bin/make: lst.c Log Message: make(1): refactor LstNodeNew To generate a diff of this commit: cvs rdiff -u -r1.83 -r1.84 src/usr.bin/make/lst.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/make/lst.c diff -u src/usr.bin/make/lst.c:1.83 src/usr.bin/make/lst.c:1.84 --- src/usr.bin/make/lst.c:1.83 Fri Oct 23 04:58:33 2020 +++ src/usr.bin/make/lst.c Sat Oct 24 08:56:27 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: lst.c,v 1.83 2020/10/23 04:58:33 rillig Exp $ */ +/* $NetBSD: lst.c,v 1.84 2020/10/24 08:56:27 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -34,16 +34,14 @@ #include "make.h" -MAKE_RCSID("$NetBSD: lst.c,v 1.83 2020/10/23 04:58:33 rillig Exp $"); +MAKE_RCSID("$NetBSD: lst.c,v 1.84 2020/10/24 08:56:27 rillig Exp $"); -/* Allocate and initialize a list node. - * - * The fields 'prev' and 'next' must be initialized by the caller. - */ static ListNode * -LstNodeNew(void *datum) +LstNodeNew(ListNode *prev, ListNode *next, void *datum) { ListNode *node = bmake_malloc(sizeof *node); +node->prev = prev; +node->next = next; node->datum = datum; return node; } @@ -131,9 +129,7 @@ Lst_InsertBefore(List *list, ListNode *n assert(!LstIsEmpty(list)); assert(datum != NULL); -newNode = LstNodeNew(datum); -newNode->prev = node->prev; -newNode->next = node; +newNode = LstNodeNew(node->prev, node, datum); if (node->prev != NULL) { node->prev->next = newNode; @@ -153,9 +149,7 @@ Lst_Prepend(List *list, void *datum) assert(datum != NULL); -node = LstNodeNew(datum); -node->prev = NULL; -node->next = list->first; +node = LstNodeNew(NULL, list->first, datum); if (list->first == NULL) { list->first = node; @@ -174,9 +168,7 @@ Lst_Append(List *list, void *datum) assert(datum != NULL); -node = LstNodeNew(datum); -node->prev = list->last; -node->next = NULL; +node = LstNodeNew(list->last, NULL, datum); if (list->last == NULL) { list->first = node;
CVS commit: src/sys/dev/acpi
Module Name:src Committed By: skrll Date: Sat Oct 24 08:55:23 UTC 2020 Modified Files: src/sys/dev/acpi: xhci_acpi.c Log Message: Fix DMA size reporting. Previously it could report 64bit DMA when the tag wasn't available (and it fell back to 32bit tag) To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/sys/dev/acpi/xhci_acpi.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/acpi/xhci_acpi.c diff -u src/sys/dev/acpi/xhci_acpi.c:1.7 src/sys/dev/acpi/xhci_acpi.c:1.8 --- src/sys/dev/acpi/xhci_acpi.c:1.7 Fri Jan 31 23:12:13 2020 +++ src/sys/dev/acpi/xhci_acpi.c Sat Oct 24 08:55:23 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: xhci_acpi.c,v 1.7 2020/01/31 23:12:13 jmcneill Exp $ */ +/* $NetBSD: xhci_acpi.c,v 1.8 2020/10/24 08:55:23 skrll Exp $ */ /*- * Copyright (c) 2018 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: xhci_acpi.c,v 1.7 2020/01/31 23:12:13 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: xhci_acpi.c,v 1.8 2020/10/24 08:55:23 skrll Exp $"); #include #include @@ -129,10 +129,9 @@ xhci_acpi_attach(device_t parent, device } hccparams = bus_space_read_4(sc->sc_iot, sc->sc_ioh, XHCI_HCCPARAMS); - if (XHCI_HCC_AC64(hccparams)) { + if (XHCI_HCC_AC64(hccparams) && BUS_DMA_TAG_VALID(aa->aa_dmat64)) { aprint_verbose_dev(self, "using 64-bit DMA\n"); - sc->sc_bus.ub_dmatag = BUS_DMA_TAG_VALID(aa->aa_dmat64) ? - aa->aa_dmat64 : aa->aa_dmat; + sc->sc_bus.ub_dmatag = aa->aa_dmat64; } else { aprint_verbose_dev(self, "using 32-bit DMA\n"); sc->sc_bus.ub_dmatag = aa->aa_dmat;
CVS commit: src/usr.bin/make/unit-tests
Module Name:src Committed By: rillig Date: Sat Oct 24 08:50:17 UTC 2020 Modified Files: src/usr.bin/make/unit-tests: cond-short.mk directive-for.mk dotwait.mk escape.mk export-all.mk export-env.mk export.mk forloop.mk job-output-long-lines.mk moderrs.mk modmatch.mk modmisc.mk modts.mk modword.mk opt-debug-lint.mk posix1.mk qequals.mk recursive.mk sunshcmd.mk sysv.mk unexport-env.mk unexport.mk var-op-append.mk var-op-assign.mk varcmd.mk varmisc.mk varname-dot-parsedir.mk varname-dot-parsefile.mk varshell.mk Log Message: make(1): use consistent indentation in variable assignments Initial work by "pkglint -F *.mk", manually adjusted in a few places. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/usr.bin/make/unit-tests/cond-short.mk \ src/usr.bin/make/unit-tests/opt-debug-lint.mk cvs rdiff -u -r1.5 -r1.6 src/usr.bin/make/unit-tests/directive-for.mk \ src/usr.bin/make/unit-tests/forloop.mk \ src/usr.bin/make/unit-tests/posix1.mk \ src/usr.bin/make/unit-tests/var-op-append.mk \ src/usr.bin/make/unit-tests/var-op-assign.mk \ src/usr.bin/make/unit-tests/varname-dot-parsedir.mk cvs rdiff -u -r1.2 -r1.3 src/usr.bin/make/unit-tests/dotwait.mk \ src/usr.bin/make/unit-tests/job-output-long-lines.mk \ src/usr.bin/make/unit-tests/modword.mk \ src/usr.bin/make/unit-tests/qequals.mk \ src/usr.bin/make/unit-tests/recursive.mk \ src/usr.bin/make/unit-tests/sunshcmd.mk cvs rdiff -u -r1.12 -r1.13 src/usr.bin/make/unit-tests/escape.mk cvs rdiff -u -r1.4 -r1.5 src/usr.bin/make/unit-tests/export-all.mk \ src/usr.bin/make/unit-tests/unexport.mk \ src/usr.bin/make/unit-tests/varcmd.mk \ src/usr.bin/make/unit-tests/varname-dot-parsefile.mk cvs rdiff -u -r1.3 -r1.4 src/usr.bin/make/unit-tests/export-env.mk \ src/usr.bin/make/unit-tests/unexport-env.mk \ src/usr.bin/make/unit-tests/varshell.mk cvs rdiff -u -r1.9 -r1.10 src/usr.bin/make/unit-tests/export.mk cvs rdiff -u -r1.16 -r1.17 src/usr.bin/make/unit-tests/moderrs.mk cvs rdiff -u -r1.8 -r1.9 src/usr.bin/make/unit-tests/modmatch.mk cvs rdiff -u -r1.48 -r1.49 src/usr.bin/make/unit-tests/modmisc.mk cvs rdiff -u -r1.6 -r1.7 src/usr.bin/make/unit-tests/modts.mk cvs rdiff -u -r1.14 -r1.15 src/usr.bin/make/unit-tests/sysv.mk cvs rdiff -u -r1.25 -r1.26 src/usr.bin/make/unit-tests/varmisc.mk Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/make/unit-tests/cond-short.mk diff -u src/usr.bin/make/unit-tests/cond-short.mk:1.10 src/usr.bin/make/unit-tests/cond-short.mk:1.11 --- src/usr.bin/make/unit-tests/cond-short.mk:1.10 Sat Oct 24 08:46:08 2020 +++ src/usr.bin/make/unit-tests/cond-short.mk Sat Oct 24 08:50:17 2020 @@ -1,4 +1,4 @@ -# $NetBSD: cond-short.mk,v 1.10 2020/10/24 08:46:08 rillig Exp $ +# $NetBSD: cond-short.mk,v 1.11 2020/10/24 08:50:17 rillig Exp $ # # Demonstrates that in conditions, the right-hand side of an && or || # is only evaluated if it can actually influence the result. @@ -113,59 +113,59 @@ VAR= # empty again, for the following te # make sure these do not cause complaint #.MAKEFLAGS: -dc -V42 = 42 -iV1 = ${V42} -iV2 = ${V66} +V42= 42 +iV1= ${V42} +iV2= ${V66} .if defined(V42) && ${V42} > 0 -x=Ok +x= Ok .else -x=Fail +x= Fail .endif -x!= echo 'defined(V42) && ${V42} > 0: $x' >&2; echo +x!= echo 'defined(V42) && ${V42} > 0: $x' >&2; echo # this one throws both String comparison operator and # Malformed conditional with cond.c 1.78 # indirect iV2 would expand to "" and treated as 0 .if defined(V66) && ( ${iV2} < ${V42} ) -x=Fail +x= Fail .else -x=Ok +x= Ok .endif -x!= echo 'defined(V66) && ( "${iV2}" < ${V42} ): $x' >&2; echo +x!= echo 'defined(V66) && ( "${iV2}" < ${V42} ): $x' >&2; echo # next two thow String comparison operator with cond.c 1.78 # indirect iV1 would expand to 42 .if 1 || ${iV1} < ${V42} -x=Ok +x= Ok .else -x=Fail +x= Fail .endif -x!= echo '1 || ${iV1} < ${V42}: $x' >&2; echo +x!= echo '1 || ${iV1} < ${V42}: $x' >&2; echo .if 1 || ${iV2:U2} < ${V42} -x=Ok +x= Ok .else -x=Fail +x= Fail .endif -x!= echo '1 || ${iV2:U2} < ${V42}: $x' >&2; echo +x!= echo '1 || ${iV2:U2} < ${V42}: $x' >&2; echo # the same expressions are fine when the lhs is expanded # ${iV1} expands to 42 .if 0 || ${iV1} <= ${V42} -x=Ok +x= Ok .else -x=Fail +x= Fail .endif -x!= echo '0 || ${iV1} <= ${V42}: $x' >&2; echo +x!= echo '0 || ${iV1} <= ${V42}: $x' >&2; echo # ${iV2:U2} expands to 2 .if 0 || ${iV2:U2} < ${V42} -x=Ok +x= Ok .else -x=Fail +x= Fail .endif -x!= echo '0 || ${iV2:U2} < ${V42}: $x' >&2; echo +x!= echo '0 || ${iV2:U2} < ${V42}: $x' >&2; echo all: @:;: Index: src/usr.bin/make/unit-tests/opt-debug-lint.mk diff -u src/usr.bin/make/unit-tests/opt-debug-lint.mk:1.10 src/usr.bin/make/unit-tests/opt-debug-lint.mk:1.11 ---
CVS commit: src/usr.bin/make/unit-tests
Module Name:src Committed By: rillig Date: Sat Oct 24 08:46:08 UTC 2020 Modified Files: src/usr.bin/make/unit-tests: cond-cmp-numeric-eq.mk cond-cmp-numeric-ge.mk cond-cmp-numeric-gt.mk cond-cmp-numeric-le.mk cond-cmp-numeric-lt.mk cond-cmp-numeric-ne.mk cond-cmp-string.mk cond-func-commands.mk cond-func-defined.mk cond-func-exists.mk cond-func-target.mk cond-func.mk cond-op-and.mk cond-op-not.mk cond-op-or.mk cond-op.mk cond-short.mk cond-token-var.mk directive-else.mk directive-ifndef.mk directive-undef.mk directives.mk envfirst.mk export-variants.mk export.mk forloop.mk modmisc.mk var-op-assign.mk varmisc.mk varmod-defined.mk varmod-edge.mk varmod-exclam-shell.mk varmod-l-name-to-value.mk varmod-match-escape.mk varmod-order-reverse.mk varmod-order-shuffle.mk varmod-order.mk varmod-subst-regex.mk varmod-subst.mk varmod-to-lower.mk varmod-to-upper.mk varmod-undefined.mk varname-dot-newline.mk varname-dot-shell.mk Log Message: make(1): indent directives like .info, .if, .for consistently Done by "pkglint -F *.mk", no manual corrections. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/usr.bin/make/unit-tests/cond-cmp-numeric-eq.mk \ src/usr.bin/make/unit-tests/cond-func-commands.mk \ src/usr.bin/make/unit-tests/cond-func-target.mk \ src/usr.bin/make/unit-tests/cond-func.mk \ src/usr.bin/make/unit-tests/cond-op-not.mk \ src/usr.bin/make/unit-tests/cond-token-var.mk \ src/usr.bin/make/unit-tests/directive-else.mk \ src/usr.bin/make/unit-tests/directive-undef.mk \ src/usr.bin/make/unit-tests/export-variants.mk \ src/usr.bin/make/unit-tests/varmod-order-reverse.mk \ src/usr.bin/make/unit-tests/varmod-subst-regex.mk \ src/usr.bin/make/unit-tests/varmod-subst.mk \ src/usr.bin/make/unit-tests/varmod-to-lower.mk \ src/usr.bin/make/unit-tests/varname-dot-newline.mk cvs rdiff -u -r1.1 -r1.2 src/usr.bin/make/unit-tests/cond-cmp-numeric-ge.mk \ src/usr.bin/make/unit-tests/cond-cmp-numeric-gt.mk \ src/usr.bin/make/unit-tests/cond-cmp-numeric-le.mk \ src/usr.bin/make/unit-tests/cond-cmp-numeric-lt.mk \ src/usr.bin/make/unit-tests/cond-cmp-numeric-ne.mk \ src/usr.bin/make/unit-tests/varmod-match-escape.mk cvs rdiff -u -r1.5 -r1.6 src/usr.bin/make/unit-tests/cond-cmp-string.mk \ src/usr.bin/make/unit-tests/cond-op-or.mk \ src/usr.bin/make/unit-tests/directive-ifndef.mk \ src/usr.bin/make/unit-tests/directives.mk \ src/usr.bin/make/unit-tests/varmod-undefined.mk cvs rdiff -u -r1.4 -r1.5 src/usr.bin/make/unit-tests/cond-func-defined.mk \ src/usr.bin/make/unit-tests/cond-func-exists.mk \ src/usr.bin/make/unit-tests/cond-op-and.mk \ src/usr.bin/make/unit-tests/forloop.mk \ src/usr.bin/make/unit-tests/var-op-assign.mk \ src/usr.bin/make/unit-tests/varmod-order-shuffle.mk \ src/usr.bin/make/unit-tests/varmod-order.mk \ src/usr.bin/make/unit-tests/varmod-to-upper.mk cvs rdiff -u -r1.7 -r1.8 src/usr.bin/make/unit-tests/cond-op.mk cvs rdiff -u -r1.9 -r1.10 src/usr.bin/make/unit-tests/cond-short.mk cvs rdiff -u -r1.2 -r1.3 src/usr.bin/make/unit-tests/envfirst.mk \ src/usr.bin/make/unit-tests/varmod-exclam-shell.mk \ src/usr.bin/make/unit-tests/varname-dot-shell.mk cvs rdiff -u -r1.8 -r1.9 src/usr.bin/make/unit-tests/export.mk cvs rdiff -u -r1.47 -r1.48 src/usr.bin/make/unit-tests/modmisc.mk cvs rdiff -u -r1.24 -r1.25 src/usr.bin/make/unit-tests/varmisc.mk cvs rdiff -u -r1.6 -r1.7 src/usr.bin/make/unit-tests/varmod-defined.mk \ src/usr.bin/make/unit-tests/varmod-l-name-to-value.mk cvs rdiff -u -r1.12 -r1.13 src/usr.bin/make/unit-tests/varmod-edge.mk Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/make/unit-tests/cond-cmp-numeric-eq.mk diff -u src/usr.bin/make/unit-tests/cond-cmp-numeric-eq.mk:1.3 src/usr.bin/make/unit-tests/cond-cmp-numeric-eq.mk:1.4 --- src/usr.bin/make/unit-tests/cond-cmp-numeric-eq.mk:1.3 Fri Sep 11 15:33:28 2020 +++ src/usr.bin/make/unit-tests/cond-cmp-numeric-eq.mk Sat Oct 24 08:46:08 2020 @@ -1,43 +1,43 @@ -# $NetBSD: cond-cmp-numeric-eq.mk,v 1.3 2020/09/11 15:33:28 rillig Exp $ +# $NetBSD: cond-cmp-numeric-eq.mk,v 1.4 2020/10/24 08:46:08 rillig Exp $ # # Tests for numeric comparisons with the == operator in .if conditions. # This comparison yields the same result, whether numeric or character-based. .if 1 == 1 .else -.error +. error .endif # This comparison yields the same result, whether numeric or character-based. .if 1 == 2 -.error +. error .endif .if 2 == 1 -.error +. error .endif # Scientific notation is supported, as per strtod. .if 2e7 == 2000e4 .else -.error +. error .endif .if 2000e4 == 2e7 .else -.error +. error .endif # Trailing
CVS commit: src/usr.bin/make/unit-tests
Module Name:src Committed By: rillig Date: Sat Oct 24 08:34:59 UTC 2020 Modified Files: src/usr.bin/make/unit-tests: cond1.mk doterror.mk error.mk escape.mk export-all.mk export-env.mk export.mk forloop.mk forsubst.mk moderrs.mk modmisc.mk modts.mk modword.mk phony-end.mk posix.mk qequals.mk sunshcmd.mk sysv.mk ternary.mk unexport-env.mk unexport.mk varcmd.mk varmisc.mk varshell.mk Log Message: make(1): use consistent RCS Id in test files To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/usr.bin/make/unit-tests/cond1.mk \ src/usr.bin/make/unit-tests/doterror.mk \ src/usr.bin/make/unit-tests/error.mk \ src/usr.bin/make/unit-tests/forsubst.mk \ src/usr.bin/make/unit-tests/modword.mk \ src/usr.bin/make/unit-tests/phony-end.mk \ src/usr.bin/make/unit-tests/posix.mk \ src/usr.bin/make/unit-tests/qequals.mk \ src/usr.bin/make/unit-tests/sunshcmd.mk \ src/usr.bin/make/unit-tests/ternary.mk cvs rdiff -u -r1.11 -r1.12 src/usr.bin/make/unit-tests/escape.mk cvs rdiff -u -r1.3 -r1.4 src/usr.bin/make/unit-tests/export-all.mk \ src/usr.bin/make/unit-tests/forloop.mk \ src/usr.bin/make/unit-tests/unexport.mk \ src/usr.bin/make/unit-tests/varcmd.mk cvs rdiff -u -r1.2 -r1.3 src/usr.bin/make/unit-tests/export-env.mk \ src/usr.bin/make/unit-tests/unexport-env.mk \ src/usr.bin/make/unit-tests/varshell.mk cvs rdiff -u -r1.7 -r1.8 src/usr.bin/make/unit-tests/export.mk cvs rdiff -u -r1.15 -r1.16 src/usr.bin/make/unit-tests/moderrs.mk cvs rdiff -u -r1.46 -r1.47 src/usr.bin/make/unit-tests/modmisc.mk cvs rdiff -u -r1.5 -r1.6 src/usr.bin/make/unit-tests/modts.mk cvs rdiff -u -r1.13 -r1.14 src/usr.bin/make/unit-tests/sysv.mk cvs rdiff -u -r1.23 -r1.24 src/usr.bin/make/unit-tests/varmisc.mk Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/make/unit-tests/cond1.mk diff -u src/usr.bin/make/unit-tests/cond1.mk:1.1 src/usr.bin/make/unit-tests/cond1.mk:1.2 --- src/usr.bin/make/unit-tests/cond1.mk:1.1 Thu Aug 21 13:44:51 2014 +++ src/usr.bin/make/unit-tests/cond1.mk Sat Oct 24 08:34:59 2020 @@ -1,4 +1,4 @@ -# $Id: cond1.mk,v 1.1 2014/08/21 13:44:51 apb Exp $ +# $NetBSD: cond1.mk,v 1.2 2020/10/24 08:34:59 rillig Exp $ # hard code these! TEST_UNAME_S= NetBSD Index: src/usr.bin/make/unit-tests/doterror.mk diff -u src/usr.bin/make/unit-tests/doterror.mk:1.1 src/usr.bin/make/unit-tests/doterror.mk:1.2 --- src/usr.bin/make/unit-tests/doterror.mk:1.1 Thu Aug 21 13:44:51 2014 +++ src/usr.bin/make/unit-tests/doterror.mk Sat Oct 24 08:34:59 2020 @@ -1,4 +1,4 @@ -# $Id: doterror.mk,v 1.1 2014/08/21 13:44:51 apb Exp $ +# $NetBSD: doterror.mk,v 1.2 2020/10/24 08:34:59 rillig Exp $ .BEGIN: Index: src/usr.bin/make/unit-tests/error.mk diff -u src/usr.bin/make/unit-tests/error.mk:1.1 src/usr.bin/make/unit-tests/error.mk:1.2 --- src/usr.bin/make/unit-tests/error.mk:1.1 Thu Aug 21 13:44:51 2014 +++ src/usr.bin/make/unit-tests/error.mk Sat Oct 24 08:34:59 2020 @@ -1,4 +1,4 @@ -# $Id: error.mk,v 1.1 2014/08/21 13:44:51 apb Exp $ +# $NetBSD: error.mk,v 1.2 2020/10/24 08:34:59 rillig Exp $ .info just FYI .warning this could be serious Index: src/usr.bin/make/unit-tests/forsubst.mk diff -u src/usr.bin/make/unit-tests/forsubst.mk:1.1 src/usr.bin/make/unit-tests/forsubst.mk:1.2 --- src/usr.bin/make/unit-tests/forsubst.mk:1.1 Thu Aug 21 13:44:51 2014 +++ src/usr.bin/make/unit-tests/forsubst.mk Sat Oct 24 08:34:59 2020 @@ -1,4 +1,4 @@ -# $Id: forsubst.mk,v 1.1 2014/08/21 13:44:51 apb Exp $ +# $NetBSD: forsubst.mk,v 1.2 2020/10/24 08:34:59 rillig Exp $ all: for-subst Index: src/usr.bin/make/unit-tests/modword.mk diff -u src/usr.bin/make/unit-tests/modword.mk:1.1 src/usr.bin/make/unit-tests/modword.mk:1.2 --- src/usr.bin/make/unit-tests/modword.mk:1.1 Thu Aug 21 13:44:51 2014 +++ src/usr.bin/make/unit-tests/modword.mk Sat Oct 24 08:34:59 2020 @@ -1,4 +1,4 @@ -# $Id: modword.mk,v 1.1 2014/08/21 13:44:51 apb Exp $ +# $NetBSD: modword.mk,v 1.2 2020/10/24 08:34:59 rillig Exp $ # # Test behaviour of new :[] modifier Index: src/usr.bin/make/unit-tests/phony-end.mk diff -u src/usr.bin/make/unit-tests/phony-end.mk:1.1 src/usr.bin/make/unit-tests/phony-end.mk:1.2 --- src/usr.bin/make/unit-tests/phony-end.mk:1.1 Thu Aug 21 13:44:51 2014 +++ src/usr.bin/make/unit-tests/phony-end.mk Sat Oct 24 08:34:59 2020 @@ -1,4 +1,4 @@ -# $Id: phony-end.mk,v 1.1 2014/08/21 13:44:51 apb Exp $ +# $NetBSD: phony-end.mk,v 1.2 2020/10/24 08:34:59 rillig Exp $ all ok also.ok bug phony: @echo '${.TARGET .PREFIX .IMPSRC:L:@v@$v="${$v}"@}' Index: src/usr.bin/make/unit-tests/posix.mk diff -u src/usr.bin/make/unit-tests/posix.mk:1.1 src/usr.bin/make/unit-tests/posix.mk:1.2 --- src/usr.bin/make/unit-tests/posix.mk:1.1 Thu Aug 21 13:44:51 2014 +++ src/usr.bin/make/unit-tests/posix.mk Sat Oct 24 08:34:59 2020 @@ -1,4 +1,4 @@ -# $Id:
CVS commit: src/sys/dev/acpi
Module Name:src Committed By: skrll Date: Sat Oct 24 07:21:01 UTC 2020 Modified Files: src/sys/dev/acpi: virtio_acpi.c Log Message: Use the 64bit DMA tag if its valid. There appears to be a bug in virtio / ld_virtio and bounce buffers that was triggered when the bus_dmatag_subregion code on arm64 was fixed to correctly create a new tag for the 32bit tag vs the system (64bit) tag. This change avoids the bug. PR/55737: Apparent bug in evbarm64 DMA code causes filesystem corruption To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/dev/acpi/virtio_acpi.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/acpi/virtio_acpi.c diff -u src/sys/dev/acpi/virtio_acpi.c:1.2 src/sys/dev/acpi/virtio_acpi.c:1.3 --- src/sys/dev/acpi/virtio_acpi.c:1.2 Fri Nov 16 23:18:17 2018 +++ src/sys/dev/acpi/virtio_acpi.c Sat Oct 24 07:21:01 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: virtio_acpi.c,v 1.2 2018/11/16 23:18:17 jmcneill Exp $ */ +/* $NetBSD: virtio_acpi.c,v 1.3 2020/10/24 07:21:01 skrll Exp $ */ /*- * Copyright (c) 2018 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: virtio_acpi.c,v 1.2 2018/11/16 23:18:17 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: virtio_acpi.c,v 1.3 2020/10/24 07:21:01 skrll Exp $"); #include #include @@ -95,7 +95,14 @@ virtio_acpi_attach(device_t parent, devi sc->sc_handle = aa->aa_node->ad_handle; msc->sc_iot = aa->aa_memt; vsc->sc_dev = self; - vsc->sc_dmat = aa->aa_dmat; + + if (BUS_DMA_TAG_VALID(aa->aa_dmat64)) { + aprint_verbose(": using 64-bit DMA"); + vsc->sc_dmat = aa->aa_dmat64; + } else { + aprint_verbose(": using 32-bit DMA"); + vsc->sc_dmat = aa->aa_dmat; + } rv = acpi_resource_parse(self, aa->aa_node->ad_handle, "_CRS", , _resource_parse_ops_default);
CVS commit: src
Module Name:src Committed By: mgorny Date: Sat Oct 24 07:14:30 UTC 2020 Modified Files: src/sys/arch/x86/include: cpufunc.h fpu.h src/sys/arch/x86/x86: fpu.c src/sys/dev/nvmm/x86: nvmm_x86_svm.c nvmm_x86_vmx.c src/tests/lib/libc/sys: t_ptrace_x86_wait.h Log Message: Issue 64-bit versions of *XSAVE* for 64-bit amd64 programs When calling FXSAVE, XSAVE, FXRSTOR, ... for 64-bit programs on amd64 use the 64-suffixed variant in order to include the complete FIP/FDP registers in the x87 area. The difference between the two variants is that the FXSAVE64 (new) variant represents FIP/FDP as 64-bit fields (union fp_addr.fa_64), while the legacy FXSAVE variant uses split fields: 32-bit offset, 16-bit segment and 16-bit reserved field (union fp_addr.fa_32). The latter implies that the actual addresses are truncated to 32 bits which is insufficient in modern programs. The change is applied only to 64-bit programs on amd64. Plain i386 and compat32 continue using plain FXSAVE. Similarly, NVMM is not changed as I am not familiar with that code. This is a potentially breaking change. However, I don't think it likely to actually break anything because the data provided by the old variant were not meaningful (because of the truncated pointer). To generate a diff of this commit: cvs rdiff -u -r1.41 -r1.42 src/sys/arch/x86/include/cpufunc.h cvs rdiff -u -r1.22 -r1.23 src/sys/arch/x86/include/fpu.h cvs rdiff -u -r1.75 -r1.76 src/sys/arch/x86/x86/fpu.c cvs rdiff -u -r1.81 -r1.82 src/sys/dev/nvmm/x86/nvmm_x86_svm.c cvs rdiff -u -r1.80 -r1.81 src/sys/dev/nvmm/x86/nvmm_x86_vmx.c cvs rdiff -u -r1.29 -r1.30 src/tests/lib/libc/sys/t_ptrace_x86_wait.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/x86/include/cpufunc.h diff -u src/sys/arch/x86/include/cpufunc.h:1.41 src/sys/arch/x86/include/cpufunc.h:1.42 --- src/sys/arch/x86/include/cpufunc.h:1.41 Mon Jun 15 09:09:23 2020 +++ src/sys/arch/x86/include/cpufunc.h Sat Oct 24 07:14:29 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: cpufunc.h,v 1.41 2020/06/15 09:09:23 msaitoh Exp $ */ +/* $NetBSD: cpufunc.h,v 1.42 2020/10/24 07:14:29 mgorny Exp $ */ /* * Copyright (c) 1998, 2007, 2019 The NetBSD Foundation, Inc. @@ -485,6 +485,82 @@ xrstor(const void *addr, uint64_t mask) ); } +#ifdef __x86_64__ +static inline void +fxsave64(void *addr) +{ + uint8_t *area = addr; + + __asm volatile ( + "fxsave64 %[area]" + : [area] "=m" (*area) + : + : "memory" + ); +} + +static inline void +fxrstor64(const void *addr) +{ + const uint8_t *area = addr; + + __asm volatile ( + "fxrstor64 %[area]" + : + : [area] "m" (*area) + : "memory" + ); +} + +static inline void +xsave64(void *addr, uint64_t mask) +{ + uint8_t *area = addr; + uint32_t low, high; + + low = mask; + high = mask >> 32; + __asm volatile ( + "xsave64 %[area]" + : [area] "=m" (*area) + : "a" (low), "d" (high) + : "memory" + ); +} + +static inline void +xsaveopt64(void *addr, uint64_t mask) +{ + uint8_t *area = addr; + uint32_t low, high; + + low = mask; + high = mask >> 32; + __asm volatile ( + "xsaveopt64 %[area]" + : [area] "=m" (*area) + : "a" (low), "d" (high) + : "memory" + ); +} + +static inline void +xrstor64(const void *addr, uint64_t mask) +{ + const uint8_t *area = addr; + uint32_t low, high; + + low = mask; + high = mask >> 32; + __asm volatile ( + "xrstor64 %[area]" + : + : [area] "m" (*area), "a" (low), "d" (high) + : "memory" + ); +} +#endif + /* -- */ #ifdef XENPV Index: src/sys/arch/x86/include/fpu.h diff -u src/sys/arch/x86/include/fpu.h:1.22 src/sys/arch/x86/include/fpu.h:1.23 --- src/sys/arch/x86/include/fpu.h:1.22 Thu Oct 15 17:40:14 2020 +++ src/sys/arch/x86/include/fpu.h Sat Oct 24 07:14:29 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: fpu.h,v 1.22 2020/10/15 17:40:14 mgorny Exp $ */ +/* $NetBSD: fpu.h,v 1.23 2020/10/24 07:14:29 mgorny Exp $ */ #ifndef _X86_FPU_H_ #define _X86_FPU_H_ @@ -14,8 +14,8 @@ struct trapframe; void fpuinit(struct cpu_info *); void fpuinit_mxcsr_mask(void); -void fpu_area_save(void *, uint64_t); -void fpu_area_restore(const void *, uint64_t); +void fpu_area_save(void *, uint64_t, bool); +void fpu_area_restore(const void *, uint64_t, bool); void fpu_save(void); Index: src/sys/arch/x86/x86/fpu.c diff -u src/sys/arch/x86/x86/fpu.c:1.75 src/sys/arch/x86/x86/fpu.c:1.76 --- src/sys/arch/x86/x86/fpu.c:1.75 Thu Oct 15 17:40:14 2020 +++ src/sys/arch/x86/x86/fpu.c Sat Oct 24 07:14:30 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: fpu.c,v 1.75 2020/10/15 17:40:14 mgorny Exp $ */ +/* $NetBSD: fpu.c,v 1.76 2020/10/24 07:14:30 mgorny Exp $ */ /* * Copyright (c) 2008, 2019 The NetBSD Foundation, Inc. All @@ -96,7 +96,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.75 2020/10/15 17:40:14 mgorny Exp $"); +__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.76 2020/10/24
CVS commit: src/sys/arch/arm/acpi
Module Name:src Committed By: skrll Date: Sat Oct 24 07:08:22 UTC 2020 Modified Files: src/sys/arch/arm/acpi: acpi_machdep.c acpi_pci_graviton.c acpi_pci_n1sdp.c acpipchb.c Log Message: Trailing whitespace To generate a diff of this commit: cvs rdiff -u -r1.19 -r1.20 src/sys/arch/arm/acpi/acpi_machdep.c cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/acpi/acpi_pci_graviton.c cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/acpi/acpi_pci_n1sdp.c cvs rdiff -u -r1.20 -r1.21 src/sys/arch/arm/acpi/acpipchb.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/arm/acpi/acpi_machdep.c diff -u src/sys/arch/arm/acpi/acpi_machdep.c:1.19 src/sys/arch/arm/acpi/acpi_machdep.c:1.20 --- src/sys/arch/arm/acpi/acpi_machdep.c:1.19 Tue Jan 21 11:24:47 2020 +++ src/sys/arch/arm/acpi/acpi_machdep.c Sat Oct 24 07:08:22 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: acpi_machdep.c,v 1.19 2020/01/21 11:24:47 jmcneill Exp $ */ +/* $NetBSD: acpi_machdep.c,v 1.20 2020/10/24 07:08:22 skrll Exp $ */ /*- * Copyright (c) 2018 The NetBSD Foundation, Inc. @@ -32,7 +32,7 @@ #include "pci.h" #include -__KERNEL_RCSID(0, "$NetBSD: acpi_machdep.c,v 1.19 2020/01/21 11:24:47 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: acpi_machdep.c,v 1.20 2020/10/24 07:08:22 skrll Exp $"); #include #include @@ -502,7 +502,7 @@ arm_acpi_dma64_tag(struct acpi_softc *sc if (ad->ad_dmat64 != NULL) return ad->ad_dmat64; - + dmat = kmem_alloc(sizeof(*dmat), KM_SLEEP); *dmat = arm_generic_dma_tag; Index: src/sys/arch/arm/acpi/acpi_pci_graviton.c diff -u src/sys/arch/arm/acpi/acpi_pci_graviton.c:1.3 src/sys/arch/arm/acpi/acpi_pci_graviton.c:1.4 --- src/sys/arch/arm/acpi/acpi_pci_graviton.c:1.3 Wed Jun 17 06:45:09 2020 +++ src/sys/arch/arm/acpi/acpi_pci_graviton.c Sat Oct 24 07:08:22 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: acpi_pci_graviton.c,v 1.3 2020/06/17 06:45:09 thorpej Exp $ */ +/* $NetBSD: acpi_pci_graviton.c,v 1.4 2020/10/24 07:08:22 skrll Exp $ */ /*- * Copyright (c) 2018, 2020 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: acpi_pci_graviton.c,v 1.3 2020/06/17 06:45:09 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: acpi_pci_graviton.c,v 1.4 2020/10/24 07:08:22 skrll Exp $"); #include #include @@ -67,7 +67,7 @@ acpi_pci_graviton_conf_read(pci_chipset_ *data = bus_space_read_4(ap->ap_bst, ap->ap_conf_bsh, reg); return 0; } - + return acpimcfg_conf_read(pc, tag, reg, data); } @@ -86,7 +86,7 @@ acpi_pci_graviton_conf_write(pci_chipset bus_space_write_4(ap->ap_bst, ap->ap_conf_bsh, reg, data); return 0; } - + return acpimcfg_conf_write(pc, tag, reg, data); } Index: src/sys/arch/arm/acpi/acpi_pci_n1sdp.c diff -u src/sys/arch/arm/acpi/acpi_pci_n1sdp.c:1.5 src/sys/arch/arm/acpi/acpi_pci_n1sdp.c:1.6 --- src/sys/arch/arm/acpi/acpi_pci_n1sdp.c:1.5 Sun Sep 13 21:41:17 2020 +++ src/sys/arch/arm/acpi/acpi_pci_n1sdp.c Sat Oct 24 07:08:22 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: acpi_pci_n1sdp.c,v 1.5 2020/09/13 21:41:17 jmcneill Exp $ */ +/* $NetBSD: acpi_pci_n1sdp.c,v 1.6 2020/10/24 07:08:22 skrll Exp $ */ /*- * Copyright (c) 2020 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: acpi_pci_n1sdp.c,v 1.5 2020/09/13 21:41:17 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: acpi_pci_n1sdp.c,v 1.6 2020/10/24 07:08:22 skrll Exp $"); #include #include @@ -83,7 +83,7 @@ acpi_pci_n1sdp_valid(pci_chipset_tag_t p pci_decompose_tag(pc, tag, , , ); - bdfaddr = (b << N1SDP_BUS_SHIFT) + + bdfaddr = (b << N1SDP_BUS_SHIFT) + (d << N1SDP_DEV_SHIFT) + (f << N1SDP_FUNC_SHIFT); @@ -116,7 +116,7 @@ acpi_pci_n1sdp_conf_read(pci_chipset_tag *data = -1; return 0; } - + return acpimcfg_conf_read(pc, tag, reg, data); } @@ -138,7 +138,7 @@ acpi_pci_n1sdp_conf_write(pci_chipset_ta if (!acpi_pci_n1sdp_valid(pc, tag)) return 0; - + return acpimcfg_conf_write(pc, tag, reg, data); } Index: src/sys/arch/arm/acpi/acpipchb.c diff -u src/sys/arch/arm/acpi/acpipchb.c:1.20 src/sys/arch/arm/acpi/acpipchb.c:1.21 --- src/sys/arch/arm/acpi/acpipchb.c:1.20 Wed Jun 17 06:46:09 2020 +++ src/sys/arch/arm/acpi/acpipchb.c Sat Oct 24 07:08:22 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: acpipchb.c,v 1.20 2020/06/17 06:46:09 thorpej Exp $ */ +/* $NetBSD: acpipchb.c,v 1.21 2020/10/24 07:08:22 skrll Exp $ */ /*- * Copyright (c) 2018 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: acpipchb.c,v 1.20 2020/06/17 06:46:09 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: acpipchb.c,v 1.21 2020/10/24 07:08:22 skrll Exp $"); #include #include @@ -188,7 +188,7 @@ acpipchb_bus_space_map(void *t, bus_addr for (i = 0; i < abs->nrange; i++) { struct acpipchb_bus_range * const range = >range[i]; - if (bpa >= range->min && bpa + size - 1 <= range->max) + if (bpa >= range->min
CVS commit: src/lib/libc/arch/hppa
Module Name:src Committed By: skrll Date: Sat Oct 24 07:05:52 UTC 2020 Modified Files: src/lib/libc/arch/hppa: genassym.cf Log Message: Add _UC_GREGS_* defines for all general registers To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/lib/libc/arch/hppa/genassym.cf Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/arch/hppa/genassym.cf diff -u src/lib/libc/arch/hppa/genassym.cf:1.2 src/lib/libc/arch/hppa/genassym.cf:1.3 --- src/lib/libc/arch/hppa/genassym.cf:1.2 Thu Oct 15 05:43:38 2020 +++ src/lib/libc/arch/hppa/genassym.cf Sat Oct 24 07:05:52 2020 @@ -1,4 +1,4 @@ -# $NetBSD: genassym.cf,v 1.2 2020/10/15 05:43:38 skrll Exp $ +# $NetBSD: genassym.cf,v 1.3 2020/10/24 07:05:52 skrll Exp $ # # Copyright (c) 2014 The NetBSD Foundation, Inc. @@ -37,3 +37,34 @@ define _REG_PCOQT _REG_PCOQT define _REG_RET0 _REG_RET0 define _UC_GREGS offsetof(ucontext_t, uc_mcontext.__gregs[0]) +define _UC_GREGS_R1 offsetof(ucontext_t, uc_mcontext.__gregs[1]) +define _UC_GREGS_R2 offsetof(ucontext_t, uc_mcontext.__gregs[2]) +define _UC_GREGS_R3 offsetof(ucontext_t, uc_mcontext.__gregs[3]) +define _UC_GREGS_R4 offsetof(ucontext_t, uc_mcontext.__gregs[4]) +define _UC_GREGS_R5 offsetof(ucontext_t, uc_mcontext.__gregs[5]) +define _UC_GREGS_R6 offsetof(ucontext_t, uc_mcontext.__gregs[6]) +define _UC_GREGS_R7 offsetof(ucontext_t, uc_mcontext.__gregs[7]) +define _UC_GREGS_R8 offsetof(ucontext_t, uc_mcontext.__gregs[8]) +define _UC_GREGS_R9 offsetof(ucontext_t, uc_mcontext.__gregs[9]) +define _UC_GREGS_R10 offsetof(ucontext_t, uc_mcontext.__gregs[10]) +define _UC_GREGS_R11 offsetof(ucontext_t, uc_mcontext.__gregs[11]) +define _UC_GREGS_R12 offsetof(ucontext_t, uc_mcontext.__gregs[12]) +define _UC_GREGS_R13 offsetof(ucontext_t, uc_mcontext.__gregs[13]) +define _UC_GREGS_R14 offsetof(ucontext_t, uc_mcontext.__gregs[14]) +define _UC_GREGS_R15 offsetof(ucontext_t, uc_mcontext.__gregs[15]) +define _UC_GREGS_R16 offsetof(ucontext_t, uc_mcontext.__gregs[16]) +define _UC_GREGS_R17 offsetof(ucontext_t, uc_mcontext.__gregs[17]) +define _UC_GREGS_R18 offsetof(ucontext_t, uc_mcontext.__gregs[18]) +define _UC_GREGS_R19 offsetof(ucontext_t, uc_mcontext.__gregs[19]) +define _UC_GREGS_R20 offsetof(ucontext_t, uc_mcontext.__gregs[20]) +define _UC_GREGS_R21 offsetof(ucontext_t, uc_mcontext.__gregs[21]) +define _UC_GREGS_R22 offsetof(ucontext_t, uc_mcontext.__gregs[22]) +define _UC_GREGS_R23 offsetof(ucontext_t, uc_mcontext.__gregs[23]) +define _UC_GREGS_R24 offsetof(ucontext_t, uc_mcontext.__gregs[24]) +define _UC_GREGS_R25 offsetof(ucontext_t, uc_mcontext.__gregs[25]) +define _UC_GREGS_R26 offsetof(ucontext_t, uc_mcontext.__gregs[26]) +define _UC_GREGS_R27 offsetof(ucontext_t, uc_mcontext.__gregs[27]) +define _UC_GREGS_R28 offsetof(ucontext_t, uc_mcontext.__gregs[28]) +define _UC_GREGS_R29 offsetof(ucontext_t, uc_mcontext.__gregs[29]) +define _UC_GREGS_R30 offsetof(ucontext_t, uc_mcontext.__gregs[30]) +define _UC_GREGS_R31 offsetof(ucontext_t, uc_mcontext.__gregs[31])
CVS commit: src/lib/libc/arch/arm
Module Name:src Committed By: skrll Date: Sat Oct 24 07:03:12 UTC 2020 Modified Files: src/lib/libc/arch/arm: genassym.cf Log Message: Provide _UC_REGS_* defines for all registers To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/lib/libc/arch/arm/genassym.cf Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/arch/arm/genassym.cf diff -u src/lib/libc/arch/arm/genassym.cf:1.2 src/lib/libc/arch/arm/genassym.cf:1.3 --- src/lib/libc/arch/arm/genassym.cf:1.2 Tue Apr 30 12:24:31 2013 +++ src/lib/libc/arch/arm/genassym.cf Sat Oct 24 07:03:11 2020 @@ -1,4 +1,4 @@ -# $NetBSD: genassym.cf,v 1.2 2013/04/30 12:24:31 skrll Exp $ +# $NetBSD: genassym.cf,v 1.3 2020/10/24 07:03:11 skrll Exp $ # # Copyright (c) 2012 The NetBSD Foundation, Inc. @@ -33,5 +33,18 @@ include include define _UC_REGS_R0 offsetof(ucontext_t, uc_mcontext.__gregs[_REG_R0]) +define _UC_REGS_R1 offsetof(ucontext_t, uc_mcontext.__gregs[_REG_R1]) +define _UC_REGS_R2 offsetof(ucontext_t, uc_mcontext.__gregs[_REG_R2]) +define _UC_REGS_R3 offsetof(ucontext_t, uc_mcontext.__gregs[_REG_R3]) +define _UC_REGS_R4 offsetof(ucontext_t, uc_mcontext.__gregs[_REG_R4]) +define _UC_REGS_R5 offsetof(ucontext_t, uc_mcontext.__gregs[_REG_R5]) +define _UC_REGS_R6 offsetof(ucontext_t, uc_mcontext.__gregs[_REG_R6]) +define _UC_REGS_R7 offsetof(ucontext_t, uc_mcontext.__gregs[_REG_R7]) +define _UC_REGS_R8 offsetof(ucontext_t, uc_mcontext.__gregs[_REG_R8]) +define _UC_REGS_R9 offsetof(ucontext_t, uc_mcontext.__gregs[_REG_R9]) +define _UC_REGS_R10 offsetof(ucontext_t, uc_mcontext.__gregs[_REG_R10]) +define _UC_REGS_R11 offsetof(ucontext_t, uc_mcontext.__gregs[_REG_R11]) +define _UC_REGS_R12 offsetof(ucontext_t, uc_mcontext.__gregs[_REG_R12]) define _UC_REGS_SP offsetof(ucontext_t, uc_mcontext.__gregs[_REG_SP]) +define _UC_REGS_LR offsetof(ucontext_t, uc_mcontext.__gregs[_REG_LR]) define _UC_REGS_PC offsetof(ucontext_t, uc_mcontext.__gregs[_REG_PC])
CVS commit: src/lib/libc/arch/aarch64/sys
Module Name:src Committed By: skrll Date: Sat Oct 24 07:02:20 UTC 2020 Modified Files: src/lib/libc/arch/aarch64/sys: __sigtramp2.S Log Message: Update the unwinder comment to better reflect ARM64 To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/lib/libc/arch/aarch64/sys/__sigtramp2.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/arch/aarch64/sys/__sigtramp2.S diff -u src/lib/libc/arch/aarch64/sys/__sigtramp2.S:1.5 src/lib/libc/arch/aarch64/sys/__sigtramp2.S:1.6 --- src/lib/libc/arch/aarch64/sys/__sigtramp2.S:1.5 Sat Oct 24 07:00:26 2020 +++ src/lib/libc/arch/aarch64/sys/__sigtramp2.S Sat Oct 24 07:02:20 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: __sigtramp2.S,v 1.5 2020/10/24 07:00:26 skrll Exp $ */ +/* $NetBSD: __sigtramp2.S,v 1.6 2020/10/24 07:02:20 skrll Exp $ */ /*- * Copyright (c) 2014 The NetBSD Foundation, Inc. @@ -41,12 +41,13 @@ * ucontext structure * sp-> siginfo structure * and x28 points to the ucontext - * - * The unwind entry includes the one byte prior to the trampoline + */ + +/* + * The unwind entry includes the one instruction prior to the trampoline * because the unwinder will look up (return PC - 1) while unwinding. - * Normally (return PC - 1) computes an address inside the call - * instruction that created the child frame, but here there is no call - * instruction so we have to manually add padding. + * Normally this would be the jump / branch, but since there isn't one in + * this case, we place an explicit nop there instead. */ .cfi_startproc simple .cfi_signal_frame
CVS commit: src/etc/mtree
Module Name:src Committed By: kamil Date: Sat Oct 24 07:03:01 UTC 2020 Modified Files: src/etc/mtree: NetBSD.dist.base Log Message: Register the usr/share/gdb dir To generate a diff of this commit: cvs rdiff -u -r1.224 -r1.225 src/etc/mtree/NetBSD.dist.base Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/etc/mtree/NetBSD.dist.base diff -u src/etc/mtree/NetBSD.dist.base:1.224 src/etc/mtree/NetBSD.dist.base:1.225 --- src/etc/mtree/NetBSD.dist.base:1.224 Wed Sep 9 06:50:33 2020 +++ src/etc/mtree/NetBSD.dist.base Sat Oct 24 07:03:00 2020 @@ -1,4 +1,4 @@ -# $NetBSD: NetBSD.dist.base,v 1.224 2020/09/09 06:50:33 mrg Exp $ +# $NetBSD: NetBSD.dist.base,v 1.225 2020/10/24 07:03:00 kamil Exp $ # @(#)4.4BSD.dist 8.1 (Berkeley) 6/13/93 # Do not customize this file as it may be overwritten on upgrades. @@ -426,6 +426,8 @@ ./usr/share/games/fortune ./usr/share/games/larn ./usr/share/games/quiz.db +./usr/share/gdb +./usr/share/gdb/syscalls ./usr/share/gnats ./usr/share/groff_font ./usr/share/groff_font/devX100
CVS commit: src/lib/libc/arch/aarch64/sys
Module Name:src Committed By: skrll Date: Sat Oct 24 07:00:26 UTC 2020 Modified Files: src/lib/libc/arch/aarch64/sys: __sigtramp2.S Log Message: s/ARM/ARM64/ in comment To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/lib/libc/arch/aarch64/sys/__sigtramp2.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/arch/aarch64/sys/__sigtramp2.S diff -u src/lib/libc/arch/aarch64/sys/__sigtramp2.S:1.4 src/lib/libc/arch/aarch64/sys/__sigtramp2.S:1.5 --- src/lib/libc/arch/aarch64/sys/__sigtramp2.S:1.4 Mon Oct 19 22:33:53 2020 +++ src/lib/libc/arch/aarch64/sys/__sigtramp2.S Sat Oct 24 07:00:26 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: __sigtramp2.S,v 1.4 2020/10/19 22:33:53 kamil Exp $ */ +/* $NetBSD: __sigtramp2.S,v 1.5 2020/10/24 07:00:26 skrll Exp $ */ /*- * Copyright (c) 2014 The NetBSD Foundation, Inc. @@ -33,7 +33,7 @@ #include "assym.h" /* - * The ARM signal trampoline is invoked only to return from + * The ARM64 signal trampoline is invoked only to return from * the signal; the kernel calls the signal handler directly. * * On entry, the stack looks like: