CVS commit: src/sys/dev
Module Name:src Committed By: mlelstv Date: Wed Dec 26 06:45:58 UTC 2018 Modified Files: src/sys/dev: ipmi.c src/sys/dev/acpi: ipmi_acpi.c Log Message: Fix 32bit build. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/dev/ipmi.c cvs rdiff -u -r1.1 -r1.2 src/sys/dev/acpi/ipmi_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/ipmi.c diff -u src/sys/dev/ipmi.c:1.1 src/sys/dev/ipmi.c:1.2 --- src/sys/dev/ipmi.c:1.1 Tue Dec 25 11:56:13 2018 +++ src/sys/dev/ipmi.c Wed Dec 26 06:45:58 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: ipmi.c,v 1.1 2018/12/25 11:56:13 mlelstv Exp $ */ +/* $NetBSD: ipmi.c,v 1.2 2018/12/26 06:45:58 mlelstv Exp $ */ /* * Copyright (c) 2006 Manuel Bouyer. @@ -52,7 +52,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ipmi.c,v 1.1 2018/12/25 11:56:13 mlelstv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ipmi.c,v 1.2 2018/12/26 06:45:58 mlelstv Exp $"); #include #include @@ -1851,7 +1851,7 @@ ipmi_map_regs(struct ipmi_softc *sc, str "ipmi0"; aprint_error("%s: %s:bus_space_map(..., %" PRIx64 ", %x" ", 0, %p) type %c failed %d\n", - xname, __func__, ia->iaa_if_iobase, + xname, __func__, (uint64_t)ia->iaa_if_iobase, sc->sc_if->nregs * sc->sc_if_iospacing, >sc_ioh, ia->iaa_if_iotype, error); return -1; @@ -2000,7 +2000,8 @@ ipmi_thread(void *cookie) aprint_verbose_dev(self, "version %d.%d interface %s %sbase " "0x%" PRIx64 "/%#x spacing %d\n", ia->iaa_if_rev >> 4, ia->iaa_if_rev & 0xF, sc->sc_if->name, - ia->iaa_if_iotype == 'i' ? "io" : "mem", ia->iaa_if_iobase, + ia->iaa_if_iotype == 'i' ? "io" : "mem", + (uint64_t)ia->iaa_if_iobase, ia->iaa_if_iospacing * sc->sc_if->nregs, ia->iaa_if_iospacing); if (ia->iaa_if_irq != -1) aprint_verbose_dev(self, " irq %d\n", ia->iaa_if_irq); Index: src/sys/dev/acpi/ipmi_acpi.c diff -u src/sys/dev/acpi/ipmi_acpi.c:1.1 src/sys/dev/acpi/ipmi_acpi.c:1.2 --- src/sys/dev/acpi/ipmi_acpi.c:1.1 Tue Dec 25 11:56:14 2018 +++ src/sys/dev/acpi/ipmi_acpi.c Wed Dec 26 06:45:58 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: ipmi_acpi.c,v 1.1 2018/12/25 11:56:14 mlelstv Exp $ */ +/* $NetBSD: ipmi_acpi.c,v 1.2 2018/12/26 06:45:58 mlelstv Exp $ */ /*- * Copyright (c) 2018 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ipmi_acpi.c,v 1.1 2018/12/25 11:56:14 mlelstv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ipmi_acpi.c,v 1.2 2018/12/26 06:45:58 mlelstv Exp $"); #include #include @@ -92,6 +92,7 @@ ipmi_acpi_attach(device_t parent, device #endif struct ipmi_attach_args IA, *ia = bus_addr_t reg2; + uint16_t i2caddr; sc->sc_dev = self; @@ -173,7 +174,14 @@ ipmi_acpi_attach(device_t parent, device aprint_error_dev(self, "no resources\n"); return; } - aprint_normal(": i2c 0x%lx\n", adr); + if (adr > 65535) { + aprint_normal("\n"); + aprint_error_dev(self, "i2c address out of range\n"); + return; + } + i2caddr = adr; + + aprint_normal(": i2c 0x%x\n", i2caddr); break; default: aprint_normal("\n");
CVS commit: src/sys/arch/i386/i386
Module Name:src Committed By: cherry Date: Wed Dec 26 06:37:31 UTC 2018 Modified Files: src/sys/arch/i386/i386: locore.S Log Message: Missed a file during previous commit completing transition to separate handler queues for i386. This should fix the build (hopefully!) Thanks to Robert Elz for pointing it out. To generate a diff of this commit: cvs rdiff -u -r1.161 -r1.162 src/sys/arch/i386/i386/locore.S 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/i386/i386/locore.S diff -u src/sys/arch/i386/i386/locore.S:1.161 src/sys/arch/i386/i386/locore.S:1.162 --- src/sys/arch/i386/i386/locore.S:1.161 Wed Aug 1 13:35:01 2018 +++ src/sys/arch/i386/i386/locore.S Wed Dec 26 06:37:31 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: locore.S,v 1.161 2018/08/01 13:35:01 maxv Exp $ */ +/* $NetBSD: locore.S,v 1.162 2018/12/26 06:37:31 cherry Exp $ */ /* * Copyright-o-rama! @@ -128,7 +128,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: locore.S,v 1.161 2018/08/01 13:35:01 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: locore.S,v 1.162 2018/12/26 06:37:31 cherry Exp $"); #include "opt_copy_symtab.h" #include "opt_ddb.h" @@ -1288,12 +1288,12 @@ IDTVEC(syscall) movl $.Lsyscall_resume, %esi /* address to resume loop at */ .Lsyscall_resume: movl %ebx,%eax /* get cpl */ - movl CPUVAR(IUNMASK)(,%eax,4),%eax - andl CPUVAR(IPENDING),%eax /* any non-masked bits left? */ + movl CPUVAR(XUNMASK)(,%eax,4),%eax + andl CPUVAR(XPENDING),%eax /* any non-masked bits left? */ jz 17f bsrl %eax,%eax - btrl %eax,CPUVAR(IPENDING) - movl CPUVAR(ISOURCES)(,%eax,4),%eax + btrl %eax,CPUVAR(XPENDING) + movl CPUVAR(XSOURCES)(,%eax,4),%eax jmp *IS_RESUME(%eax) 17: movl %ebx, CPUVAR(ILEVEL) /* restore cpl */ jmp .Lsyscall_checkast
CVS commit: src/distrib/sets/lists/debug
Module Name:src Committed By: kre Date: Wed Dec 26 02:06:03 UTC 2018 Modified Files: src/distrib/sets/lists/debug: mi Log Message: Add "rump" to threadpool.debug test so it is not expected to appear if MKRUMP=no To generate a diff of this commit: cvs rdiff -u -r1.272 -r1.273 src/distrib/sets/lists/debug/mi Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/sets/lists/debug/mi diff -u src/distrib/sets/lists/debug/mi:1.272 src/distrib/sets/lists/debug/mi:1.273 --- src/distrib/sets/lists/debug/mi:1.272 Tue Dec 25 07:52:53 2018 +++ src/distrib/sets/lists/debug/mi Wed Dec 26 02:06:02 2018 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.272 2018/12/25 07:52:53 christos Exp $ +# $NetBSD: mi,v 1.273 2018/12/26 02:06:02 kre Exp $ ./etc/mtree/set.debug comp-sys-root ./usr/lib comp-sys-usr compatdir ./usr/lib/i18n/libBIG5_g.a comp-c-debuglib debuglib,compatfile @@ -2334,7 +2334,7 @@ ./usr/libdata/debug/usr/tests/rump/rumpkern/t_modcmd.debug tests-syscall-debug debug,atf,rump ./usr/libdata/debug/usr/tests/rump/rumpkern/t_modlinkset.debug tests-syscall-debug debug,atf,rump ./usr/libdata/debug/usr/tests/rump/rumpkern/t_signals.debug tests-syscall-debug debug,atf,rump -./usr/libdata/debug/usr/tests/rump/rumpkern/t_threadpool.debug tests-sys-debug debug,atf +./usr/libdata/debug/usr/tests/rump/rumpkern/t_threadpool.debug tests-sys-debug debug,atf,rump ./usr/libdata/debug/usr/tests/rump/rumpkern/t_threads.debug tests-syscall-debug debug,atf,rump ./usr/libdata/debug/usr/tests/rump/rumpkern/t_tsleep.debug tests-syscall-debug debug,atf,rump ./usr/libdata/debug/usr/tests/rump/rumpkern/t_vm.debug tests-syscall-debug debug,atf,rump
CVS commit: src/usr.bin/systat
Module Name:src Committed By: sevan Date: Wed Dec 26 01:54:09 UTC 2018 Modified Files: src/usr.bin/systat: systat.1 Log Message: Remove commentd out options for fields no longer present in source. To generate a diff of this commit: cvs rdiff -u -r1.49 -r1.50 src/usr.bin/systat/systat.1 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/systat/systat.1 diff -u src/usr.bin/systat/systat.1:1.49 src/usr.bin/systat/systat.1:1.50 --- src/usr.bin/systat/systat.1:1.49 Wed Dec 26 01:47:37 2018 +++ src/usr.bin/systat/systat.1 Wed Dec 26 01:54:09 2018 @@ -1,4 +1,4 @@ -.\" $NetBSD: systat.1,v 1.49 2018/12/26 01:47:37 sevan Exp $ +.\" $NetBSD: systat.1,v 1.50 2018/12/26 01:54:09 sevan Exp $ .\" .\" Copyright (c) 1985, 1990, 1993 .\" The Regents of the University of California. All rights reserved. @@ -555,38 +555,8 @@ min number of free pages target number of free pages .It Ic Sq itarg target number of inactive pages -.\".It Ic Sq objlk -.\"object cache lookups -.\".It Ic Sq objht -.\"object cache hits -.\".It Ic Sq zfodw -.\"pages zero filled on demand -.\".It Ic Sq nzfod -.\"number of zfod's created -.\".It Ic Sq %zfod -.\"percentage of zfod's used -.\".It Ic Sq kern -.\"number of kernel pages .It Ic Sq flnan number of times fault was out of anonymous pages -.\".It Ic Sq act -.\"number of active pages -.\".It Ic Sq inact -.\"number of inactive pages -.\".It Ic Sq free -.\"number of free pages -.\".It Ic Sq daefr -.\"pages freed by daemon -.\".It Ic Sq prcfr -.\"pages freed by exiting processes -.\".It Ic Sq react -.\"number of pages reactivated from freelist -.\".It Ic Sq scan -.\"scans in page out daemon -.\".It Ic Sq hdrev -.\"revolutions of the hand -.\".It Ic Sq intrn -.\"in-transit blocking page faults per second over the refresh period. .It Ic Sq pdfre number of pages daemon freed since boot .It Ic Sq pdscn
CVS commit: src/usr.bin/systat
Module Name:src Committed By: sevan Date: Wed Dec 26 01:47:37 UTC 2018 Modified Files: src/usr.bin/systat: bufcache.c cmdtab.c main.c systat.1 systat.h vmstat.c Log Message: Extend "systat vm" output to provide better insight about buffercache and document it. >From Greg A. Woods in PR bin/36542 To generate a diff of this commit: cvs rdiff -u -r1.28 -r1.29 src/usr.bin/systat/bufcache.c cvs rdiff -u -r1.25 -r1.26 src/usr.bin/systat/cmdtab.c cvs rdiff -u -r1.53 -r1.54 src/usr.bin/systat/main.c cvs rdiff -u -r1.48 -r1.49 src/usr.bin/systat/systat.1 cvs rdiff -u -r1.11 -r1.12 src/usr.bin/systat/systat.h cvs rdiff -u -r1.82 -r1.83 src/usr.bin/systat/vmstat.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/systat/bufcache.c diff -u src/usr.bin/systat/bufcache.c:1.28 src/usr.bin/systat/bufcache.c:1.29 --- src/usr.bin/systat/bufcache.c:1.28 Fri Jun 9 00:13:29 2017 +++ src/usr.bin/systat/bufcache.c Wed Dec 26 01:47:37 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: bufcache.c,v 1.28 2017/06/09 00:13:29 chs Exp $ */ +/* $NetBSD: bufcache.c,v 1.29 2018/12/26 01:47:37 sevan Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include #ifndef lint -__RCSID("$NetBSD: bufcache.c,v 1.28 2017/06/09 00:13:29 chs Exp $"); +__RCSID("$NetBSD: bufcache.c,v 1.29 2018/12/26 01:47:37 sevan Exp $"); #endif /* not lint */ #include @@ -117,8 +117,8 @@ labelbufcache(void) wmove(wnd, i, 0); wclrtoeol(wnd); } - mvwaddstr(wnd, PAGEINFO_ROWS + 1, 0, "File System Bufs used" - " % kB in use % Bufsize kB % Util %"); + mvwaddstr(wnd, PAGEINFO_ROWS + 1, 0, +"File System Bufs used % kB in use % Bufsize kB % Util %"); wclrtoeol(wnd); } Index: src/usr.bin/systat/cmdtab.c diff -u src/usr.bin/systat/cmdtab.c:1.25 src/usr.bin/systat/cmdtab.c:1.26 --- src/usr.bin/systat/cmdtab.c:1.25 Tue Aug 2 15:56:09 2016 +++ src/usr.bin/systat/cmdtab.c Wed Dec 26 01:47:37 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: cmdtab.c,v 1.25 2016/08/02 15:56:09 scole Exp $ */ +/* $NetBSD: cmdtab.c,v 1.26 2018/12/26 01:47:37 sevan Exp $ */ /*- * Copyright (c) 1980, 1992, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)cmdtab.c 8.1 (Berkeley) 6/6/93"; #endif -__RCSID("$NetBSD: cmdtab.c,v 1.25 2016/08/02 15:56:09 scole Exp $"); +__RCSID("$NetBSD: cmdtab.c,v 1.26 2018/12/26 01:47:37 sevan Exp $"); #endif /* not lint */ #include "systat.h" @@ -52,6 +52,7 @@ struct command global_commands[] = { { "quit", global_quit, "exit systat"}, { "start", global_interval, "restart updating display"}, { "stop", global_stop, "stop updating display"}, + { "?", global_help, "show help"}, { .c_name = NULL } }; @@ -114,7 +115,7 @@ struct command netstat_commands[] = { { "names", netstat_names, "show names instead of addresses"}, { "numbers", netstat_numbers, "show addresses instead of names"}, { "reset", netstat_reset, "return to default display"}, - { "show", netstat_show, "show current display/ignore settings"}, + { "show", netstat_show, "show current display/ignore settings"}, { "tcp", netstat_tcp, "show only tcp connections"}, { "udp", netstat_udp, "show only udp connections"}, { .c_name = NULL } Index: src/usr.bin/systat/main.c diff -u src/usr.bin/systat/main.c:1.53 src/usr.bin/systat/main.c:1.54 --- src/usr.bin/systat/main.c:1.53 Wed Nov 22 02:52:42 2017 +++ src/usr.bin/systat/main.c Wed Dec 26 01:47:37 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.53 2017/11/22 02:52:42 snj Exp $ */ +/* $NetBSD: main.c,v 1.54 2018/12/26 01:47:37 sevan Exp $ */ /*- * Copyright (c) 1980, 1992, 1993 @@ -36,7 +36,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 19 #if 0 static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 6/6/93"; #endif -__RCSID("$NetBSD: main.c,v 1.53 2017/11/22 02:52:42 snj Exp $"); +__RCSID("$NetBSD: main.c,v 1.54 2018/12/26 01:47:37 sevan Exp $"); #endif /* not lint */ #include @@ -66,7 +66,7 @@ char *nlistf = NULL; sig_t sigtstpdfl; double avenrun[3]; int col; -double naptime = 5; +double naptime = 1; int verbose = 1;/* to report kvm read errs */ int hz, stathz, maxslp; charc; @@ -173,10 +173,8 @@ main(int argc, char **argv) (void)setegid(egid); kd = kvm_openfiles(nlistf, memf, NULL, O_RDONLY, errbuf); - if (kd == NULL) { - error("%s", errbuf); - exit(1); - } + if (kd == NULL) + errx(1, "%s", errbuf); /* Get rid of privs for now. */ if (nlistf == NULL && memf == NULL) @@ -194,19 +192,24 @@ main(int argc, char **argv) * routines to minimize update work by curses. */ if (initscr() == NULL) - { - warnx("couldn't initialize screen"); - exit(0); - } + errx(1, "couldn't initialize screen"); CMDLINE = LINES - 1; wnd = (*curmode->c_open)(); if (wnd == NULL) { + move(CMDLINE, 0); + clrtoeol(); + refresh(); + endwin(); warnx("couldn't initialize
CVS commit: src/tests/rump/kernspace
Module Name:src Committed By: thorpej Date: Tue Dec 25 21:26:31 UTC 2018 Modified Files: src/tests/rump/kernspace: threadpool.c Log Message: Include some non-critical-but-still-for-correctness lines of code in the cancellation unit test. (I could have sworn I actually typed these lines, no really...) To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/tests/rump/kernspace/threadpool.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/rump/kernspace/threadpool.c diff -u src/tests/rump/kernspace/threadpool.c:1.1 src/tests/rump/kernspace/threadpool.c:1.2 --- src/tests/rump/kernspace/threadpool.c:1.1 Mon Dec 24 21:42:05 2018 +++ src/tests/rump/kernspace/threadpool.c Tue Dec 25 21:26:31 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: threadpool.c,v 1.1 2018/12/24 21:42:05 thorpej Exp $ */ +/* $NetBSD: threadpool.c,v 1.2 2018/12/25 21:26:31 thorpej Exp $ */ /*- * Copyright (c) 2018 The NetBSD Foundation, Inc. @@ -32,7 +32,7 @@ #include #if !defined(lint) -__RCSID("$NetBSD: threadpool.c,v 1.1 2018/12/24 21:42:05 thorpej Exp $"); +__RCSID("$NetBSD: threadpool.c,v 1.2 2018/12/25 21:26:31 thorpej Exp $"); #endif /* !lint */ #include @@ -231,4 +231,9 @@ rumptest_threadpool_job_cancel(void) /* Now wait for the job to finish. */ threadpool_cancel_job(pool, ); KASSERT(data.count == FINAL_COUNT); + mutex_exit(); + + fini_test_job_data(); + + threadpool_put(pool, PRI_NONE); }
CVS commit: src/sys/arch/x86
Module Name:src Committed By: mlelstv Date: Tue Dec 25 16:45:03 UTC 2018 Modified Files: src/sys/arch/x86/include: smbiosvar.h src/sys/arch/x86/x86: platform.c Log Message: Expose more DMI variables via sysctl. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/arch/x86/include/smbiosvar.h cvs rdiff -u -r1.15 -r1.16 src/sys/arch/x86/x86/platform.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/x86/include/smbiosvar.h diff -u src/sys/arch/x86/include/smbiosvar.h:1.4 src/sys/arch/x86/include/smbiosvar.h:1.5 --- src/sys/arch/x86/include/smbiosvar.h:1.4 Sat Mar 11 07:21:10 2017 +++ src/sys/arch/x86/include/smbiosvar.h Tue Dec 25 16:45:02 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: smbiosvar.h,v 1.4 2017/03/11 07:21:10 nonaka Exp $ */ +/* $NetBSD: smbiosvar.h,v 1.5 2018/12/25 16:45:02 mlelstv Exp $ */ /* * Copyright (c) 2006 Gordon Willem Klok * Copyright (c) 2005 Jordan Hargrave @@ -185,7 +185,7 @@ struct smbios_board { uint8_t product; /* string */ uint8_t version; /* string */ uint8_t serial; /* string */ - uint8_t asset; /* stirng */ + uint8_t asset; /* string */ uint8_t feature; /* feature flags */ uint8_t location; /* location in chassis */ uint16_t handle; /* chassis handle */ @@ -194,6 +194,59 @@ struct smbios_board { } __packed; /* + * SMBIOS Structure Type 3 "System Enclosure or Chassis" + * DMTF Specification DSP0134 Section 3.1.1 p.g. 37 + */ +struct smbios_chassis { + uint8_t vendor; /* string */ + uint8_t shape; + uint8_t version; /* string */ + uint8_t serial; /* string */ + uint8_t asset; /* string */ + uint8_t bustate; + uint8_t psstate; + uint8_t thstate; + uint8_t security; + uint32_t oemdata; + uint8_t height; + uint8_t powercords; + uint8_t noc; /* number of contained objects */ +} __packed; + +/* + * SMBIOS Structure Type 4 "Processor Information" + * DMTF Specification DSP0134 Section 3.1.1 p.g. 42 + */ +struct smbios_processor { + uint8_t socket; /* string */ + uint8_t type; + uint8_t family; + uint8_t vendor; /* string */ + uint64_t cpuid; + uint8_t version; /* string */ + uint8_t voltage; + uint16_t clkspeed; + uint16_t maxspeed; + uint16_t curspeed; + uint8_t status; + uint8_t upgrade; + uint8_t l1cache; + uint8_t l2cache; + uint8_t l3cache; + uint8_t serial; /* string */ + uint8_t asset; /* string */ + uint8_t part; /* string */ + uint8_t cores; /* cores per socket */ + uint8_t enabled; /* enabled cores per socket */ + uint8_t threads; /* threads per socket */ + uint16_t characteristics; + uint16_t family2; /* for values >= 255 */ + uint16_t cores2; /* for values >= 255 */ + uint16_t enabled2; /* for values >= 255 */ + uint16_t threads2; /* for values >= 255 */ +} __packed; + +/* * SMBIOS Structure Type 9 "Expansion slot" */ struct smbios_slot { Index: src/sys/arch/x86/x86/platform.c diff -u src/sys/arch/x86/x86/platform.c:1.15 src/sys/arch/x86/x86/platform.c:1.16 --- src/sys/arch/x86/x86/platform.c:1.15 Wed Mar 26 08:04:19 2014 +++ src/sys/arch/x86/x86/platform.c Tue Dec 25 16:45:02 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: platform.c,v 1.15 2014/03/26 08:04:19 christos Exp $ */ +/* $NetBSD: platform.c,v 1.16 2018/12/25 16:45:02 mlelstv Exp $ */ /*- * Copyright (c) 2007 Jared D. McNeill @@ -29,7 +29,7 @@ #include "isa.h" #include -__KERNEL_RCSID(0, "$NetBSD: platform.c,v 1.15 2014/03/26 08:04:19 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: platform.c,v 1.16 2018/12/25 16:45:02 mlelstv Exp $"); #include #include @@ -48,6 +48,8 @@ static int platform_dminode = CTL_EOL; void platform_init(void); /* XXX */ static void platform_add(struct smbtable *, const char *, int); +static void platform_add_word(struct smbtable *, const char *, uint16_t, +const char *); static void platform_add_date(struct smbtable *, const char *, int); static void platform_add_uuid(struct smbtable *, const char *, const uint8_t *); @@ -56,6 +58,7 @@ static void platform_print(void); /* list of private DMI sysctl nodes */ static const char *platform_private_nodes[] = { + "chassis-serial", "board-serial", "system-serial", "system-uuid", @@ -69,6 +72,8 @@ platform_init(void) struct smbios_sys *psys; struct smbios_struct_bios *pbios; struct smbios_board *pboard; + struct smbios_chassis *pchassis; + struct smbios_processor *pproc; struct smbios_slot *pslot; int nisa, nother; @@ -104,6 +109,27 @@ platform_init(void) } smbios.cookie = 0; + if (smbios_find_table(SMBIOS_TYPE_ENCLOSURE, )) { + pchassis = smbios.tblhdr; + + platform_add(, "chassis-vendor", pchassis->vendor); + platform_add(, "chassis-type", pchassis->shape); + platform_add(, "chassis-version", pchassis->version); + platform_add(, "chassis-serial", pchassis->serial); + platform_add(, "chassis-asset-tag", pchassis->asset); + } + + smbios.cookie = 0; + if (smbios_find_table(SMBIOS_TYPE_PROCESSOR, )) { + pproc =
CVS commit: src/sys
Module Name:src Committed By: mlelstv Date: Tue Dec 25 11:56:14 UTC 2018 Modified Files: src/sys/arch/amd64/conf: GENERIC XEN3_DOM0 src/sys/arch/i386/conf: GENERIC XEN3PAE_DOM0 src/sys/arch/x86/conf: files.x86 src/sys/arch/x86/include: ipmivar.h src/sys/arch/xen/conf: files.xen src/sys/conf: files src/sys/dev: files.dev src/sys/dev/acpi: files.acpi Added Files: src/sys/arch/x86/x86: x86_ipmi.c src/sys/dev: ipmi.c ipmivar.h src/sys/dev/acpi: ipmi_acpi.c Removed Files: src/sys/arch/x86/x86: ipmi.c Log Message: Make ipmi driver available to other platforms. Add ACPI attachment. To generate a diff of this commit: cvs rdiff -u -r1.513 -r1.514 src/sys/arch/amd64/conf/GENERIC cvs rdiff -u -r1.161 -r1.162 src/sys/arch/amd64/conf/XEN3_DOM0 cvs rdiff -u -r1.1198 -r1.1199 src/sys/arch/i386/conf/GENERIC cvs rdiff -u -r1.10 -r1.11 src/sys/arch/i386/conf/XEN3PAE_DOM0 cvs rdiff -u -r1.105 -r1.106 src/sys/arch/x86/conf/files.x86 cvs rdiff -u -r1.11 -r1.12 src/sys/arch/x86/include/ipmivar.h cvs rdiff -u -r1.70 -r0 src/sys/arch/x86/x86/ipmi.c cvs rdiff -u -r0 -r1.1 src/sys/arch/x86/x86/x86_ipmi.c cvs rdiff -u -r1.174 -r1.175 src/sys/arch/xen/conf/files.xen cvs rdiff -u -r1.1219 -r1.1220 src/sys/conf/files cvs rdiff -u -r1.4 -r1.5 src/sys/dev/files.dev cvs rdiff -u -r0 -r1.1 src/sys/dev/ipmi.c src/sys/dev/ipmivar.h cvs rdiff -u -r1.113 -r1.114 src/sys/dev/acpi/files.acpi cvs rdiff -u -r0 -r1.1 src/sys/dev/acpi/ipmi_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/arch/amd64/conf/GENERIC diff -u src/sys/arch/amd64/conf/GENERIC:1.513 src/sys/arch/amd64/conf/GENERIC:1.514 --- src/sys/arch/amd64/conf/GENERIC:1.513 Fri Dec 14 22:00:26 2018 +++ src/sys/arch/amd64/conf/GENERIC Tue Dec 25 11:56:14 2018 @@ -1,4 +1,4 @@ -# $NetBSD: GENERIC,v 1.513 2018/12/14 22:00:26 jakllsch Exp $ +# $NetBSD: GENERIC,v 1.514 2018/12/25 11:56:14 mlelstv Exp $ # # GENERIC machine description file # @@ -22,7 +22,7 @@ include "arch/amd64/conf/std.amd64" options INCLUDE_CONFIG_FILE # embed config file in kernel binary -#ident "GENERIC-$Revision: 1.513 $" +#ident "GENERIC-$Revision: 1.514 $" maxusers 64 # estimated number of users @@ -288,6 +288,8 @@ config netbsd root on ? type ? #IPMI support ipmi0 at mainbus? +ipmi_acpi* at acpi? +ipmi0 at ipmi_acpi? # ACPI will be used if present. If not it will fall back to MPBIOS acpi0 at mainbus0 @@ -365,8 +367,8 @@ ppb* at pci? dev ? function ? # PCI-PCI # XXX 'puc's aren't really bridges, but there's no better place for them here puc* at pci? dev ? function ? # PCI "universal" comm. cards -#amdpcib* at pci? dev ? function ? # AMD 8111 PCI-ISA w/ HPET -#hpet* at amdpcib? +amdpcib* at pci? dev ? function ? # AMD 8111 PCI-ISA w/ HPET +hpet* at amdpcib? pwdog* at pci? dev ? function ? # QUANCOM PWDOG1 Index: src/sys/arch/amd64/conf/XEN3_DOM0 diff -u src/sys/arch/amd64/conf/XEN3_DOM0:1.161 src/sys/arch/amd64/conf/XEN3_DOM0:1.162 --- src/sys/arch/amd64/conf/XEN3_DOM0:1.161 Sat Dec 22 07:45:58 2018 +++ src/sys/arch/amd64/conf/XEN3_DOM0 Tue Dec 25 11:56:14 2018 @@ -1,4 +1,4 @@ -# $NetBSD: XEN3_DOM0,v 1.161 2018/12/22 07:45:58 cherry Exp $ +# $NetBSD: XEN3_DOM0,v 1.162 2018/12/25 11:56:14 mlelstv Exp $ include "arch/amd64/conf/std.xen" @@ -10,7 +10,7 @@ options INCLUDE_CONFIG_FILE # embed con #options UVMHIST_PRINT #options SYSCALL_DEBUG -#ident "XEN3_DOM0-$Revision: 1.161 $" +#ident "XEN3_DOM0-$Revision: 1.162 $" maxusers 32 # estimated number of users @@ -192,6 +192,8 @@ cpu* at mainbus? # IPMI support ipmi0 at mainbus? +ipmi_acpi* at acpi? +ipmi0 at ipmi_acpi? hypervisor* at mainbus? # Xen hypervisor Index: src/sys/arch/i386/conf/GENERIC diff -u src/sys/arch/i386/conf/GENERIC:1.1198 src/sys/arch/i386/conf/GENERIC:1.1199 --- src/sys/arch/i386/conf/GENERIC:1.1198 Fri Dec 14 22:00:26 2018 +++ src/sys/arch/i386/conf/GENERIC Tue Dec 25 11:56:14 2018 @@ -1,4 +1,4 @@ -# $NetBSD: GENERIC,v 1.1198 2018/12/14 22:00:26 jakllsch Exp $ +# $NetBSD: GENERIC,v 1.1199 2018/12/25 11:56:14 mlelstv Exp $ # # GENERIC machine description file # @@ -22,7 +22,7 @@ include "arch/i386/conf/std.i386" options INCLUDE_CONFIG_FILE # embed config file in kernel binary -#ident "GENERIC-$Revision: 1.1198 $" +#ident "GENERIC-$Revision: 1.1199 $" maxusers 64 # estimated number of users @@ -299,6 +299,8 @@ config netbsd root on ? type ? #IPMI support ipmi0 at mainbus? +ipmi_acpi* at acpi? +ipmi0 at ipmi_acpi? # Advanced Configuration and Power Interface Index: src/sys/arch/i386/conf/XEN3PAE_DOM0 diff -u src/sys/arch/i386/conf/XEN3PAE_DOM0:1.10 src/sys/arch/i386/conf/XEN3PAE_DOM0:1.11 --- src/sys/arch/i386/conf/XEN3PAE_DOM0:1.10 Sat Dec 22 07:45:58 2018 +++ src/sys/arch/i386/conf/XEN3PAE_DOM0 Tue Dec 25 11:56:14 2018 @@ -1,4 +1,4 @@
CVS commit: [netbsd-7-1] src/doc
Module Name:src Committed By: martin Date: Tue Dec 25 11:33:54 UTC 2018 Modified Files: src/doc [netbsd-7-1]: CHANGES-7.1.3 Log Message: Ticket #1666 To generate a diff of this commit: cvs rdiff -u -r1.1.2.30 -r1.1.2.31 src/doc/CHANGES-7.1.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/CHANGES-7.1.3 diff -u src/doc/CHANGES-7.1.3:1.1.2.30 src/doc/CHANGES-7.1.3:1.1.2.31 --- src/doc/CHANGES-7.1.3:1.1.2.30 Tue Dec 18 18:36:53 2018 +++ src/doc/CHANGES-7.1.3 Tue Dec 25 11:33:54 2018 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-7.1.3,v 1.1.2.30 2018/12/18 18:36:53 martin Exp $ +# $NetBSD: CHANGES-7.1.3,v 1.1.2.31 2018/12/25 11:33:54 martin Exp $ A complete list of changes from the NetBSD 7.1.2 release to the NetBSD 7.1.3 release: @@ -323,4 +323,9 @@ usr.bin/telnet/utilities.c 1.24 Switch some sprintf to snprintf. [maya, ticket #1665] +sys/uvm/uvm_swap.c1.178 (patch, adapted) +sys/compat/netbsd32/netbsd32_netbsd.c (patch) + + Fix kernel info leak in swapctl(2). + [maxv, ticket #1666]
CVS commit: [netbsd-7-0] src/doc
Module Name:src Committed By: martin Date: Tue Dec 25 11:34:48 UTC 2018 Modified Files: src/doc [netbsd-7-0]: CHANGES-7.0.3 Log Message: Ticket #1666 To generate a diff of this commit: cvs rdiff -u -r1.1.2.123 -r1.1.2.124 src/doc/CHANGES-7.0.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/CHANGES-7.0.3 diff -u src/doc/CHANGES-7.0.3:1.1.2.123 src/doc/CHANGES-7.0.3:1.1.2.124 --- src/doc/CHANGES-7.0.3:1.1.2.123 Tue Dec 18 18:37:50 2018 +++ src/doc/CHANGES-7.0.3 Tue Dec 25 11:34:48 2018 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-7.0.3,v 1.1.2.123 2018/12/18 18:37:50 martin Exp $ +# $NetBSD: CHANGES-7.0.3,v 1.1.2.124 2018/12/25 11:34:48 martin Exp $ A complete list of changes from the NetBSD 7.0.2 release to the NetBSD 7.0.3 release: @@ -5631,3 +5631,10 @@ usr.bin/telnet/utilities.c 1.24 Switch some sprintf to snprintf. [maya, ticket #1665] +sys/uvm/uvm_swap.c1.178 (patch, adapted) +sys/compat/netbsd32/netbsd32_netbsd.c (patch) + + Fix kernel info leak in swapctl(2). + [maxv, ticket #1666] + +
CVS commit: [netbsd-7-0] src/sys
Module Name:src Committed By: martin Date: Tue Dec 25 11:34:14 UTC 2018 Modified Files: src/sys/compat/netbsd32 [netbsd-7-0]: netbsd32_netbsd.c src/sys/uvm [netbsd-7-0]: uvm_swap.c Log Message: Apply patch, requested by maxv in ticket #1666: Fix similar to: sys/uvm/uvm_swap.c: revision 1.178 Woah man, fix enormous leak. Possible info leak: [len=1056, leaked=931] #0 0x80bad351 in kleak_copyout #1 0x80b2cf64 in uvm_swap_stats.part.1 #2 0x80b2d38d in uvm_swap_stats #3 0x80b2d43c in sys_swapctl #4 0x80259b82 in syscall To generate a diff of this commit: cvs rdiff -u -r1.193 -r1.193.6.1 src/sys/compat/netbsd32/netbsd32_netbsd.c cvs rdiff -u -r1.172 -r1.172.6.1 src/sys/uvm/uvm_swap.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/netbsd32/netbsd32_netbsd.c diff -u src/sys/compat/netbsd32/netbsd32_netbsd.c:1.193 src/sys/compat/netbsd32/netbsd32_netbsd.c:1.193.6.1 --- src/sys/compat/netbsd32/netbsd32_netbsd.c:1.193 Thu Jul 31 12:35:33 2014 +++ src/sys/compat/netbsd32/netbsd32_netbsd.c Tue Dec 25 11:34:14 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_netbsd.c,v 1.193 2014/07/31 12:35:33 maxv Exp $ */ +/* $NetBSD: netbsd32_netbsd.c,v 1.193.6.1 2018/12/25 11:34:14 martin Exp $ */ /* * Copyright (c) 1998, 2001, 2008 Matthew R. Green @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.193 2014/07/31 12:35:33 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.193.6.1 2018/12/25 11:34:14 martin Exp $"); #if defined(_KERNEL_OPT) #include "opt_ddb.h" @@ -1754,7 +1754,7 @@ netbsd32_swapctl_stats(struct lwp *l, st count = uvmexp.nswapdev; ksep_len = sizeof(*ksep) * count; - ksep = kmem_alloc(ksep_len, KM_SLEEP); + ksep = kmem_zalloc(ksep_len, KM_SLEEP); usep32 = (struct netbsd32_swapent *)SCARG(uap, arg); uvm_swap_stats(SWAP_STATS, ksep, count, retval); Index: src/sys/uvm/uvm_swap.c diff -u src/sys/uvm/uvm_swap.c:1.172 src/sys/uvm/uvm_swap.c:1.172.6.1 --- src/sys/uvm/uvm_swap.c:1.172 Fri Jul 25 08:10:40 2014 +++ src/sys/uvm/uvm_swap.c Tue Dec 25 11:34:14 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_swap.c,v 1.172 2014/07/25 08:10:40 dholland Exp $ */ +/* $NetBSD: uvm_swap.c,v 1.172.6.1 2018/12/25 11:34:14 martin Exp $ */ /* * Copyright (c) 1995, 1996, 1997, 2009 Matthew R. Green @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: uvm_swap.c,v 1.172 2014/07/25 08:10:40 dholland Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uvm_swap.c,v 1.172.6.1 2018/12/25 11:34:14 martin Exp $"); #include "opt_uvmhist.h" #include "opt_compat_netbsd.h" @@ -515,7 +515,7 @@ sys_swapctl(struct lwp *l, const struct else #endif len = sizeof(struct swapent) * misc; - sep = (struct swapent *)kmem_alloc(len, KM_SLEEP); + sep = (struct swapent *)kmem_zalloc(len, KM_SLEEP); uvm_swap_stats(SCARG(uap, cmd), sep, misc, retval); error = copyout(sep, SCARG(uap, arg), len);
CVS commit: [netbsd-7-1] src/sys
Module Name:src Committed By: martin Date: Tue Dec 25 11:33:27 UTC 2018 Modified Files: src/sys/compat/netbsd32 [netbsd-7-1]: netbsd32_netbsd.c src/sys/uvm [netbsd-7-1]: uvm_swap.c Log Message: Apply patch, requested by maxv in ticket #1666: Fix similar to: sys/uvm/uvm_swap.c: revision 1.178 Woah man, fix enormous leak. Possible info leak: [len=1056, leaked=931] #0 0x80bad351 in kleak_copyout #1 0x80b2cf64 in uvm_swap_stats.part.1 #2 0x80b2d38d in uvm_swap_stats #3 0x80b2d43c in sys_swapctl #4 0x80259b82 in syscall To generate a diff of this commit: cvs rdiff -u -r1.193 -r1.193.10.1 src/sys/compat/netbsd32/netbsd32_netbsd.c cvs rdiff -u -r1.172 -r1.172.10.1 src/sys/uvm/uvm_swap.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/netbsd32/netbsd32_netbsd.c diff -u src/sys/compat/netbsd32/netbsd32_netbsd.c:1.193 src/sys/compat/netbsd32/netbsd32_netbsd.c:1.193.10.1 --- src/sys/compat/netbsd32/netbsd32_netbsd.c:1.193 Thu Jul 31 12:35:33 2014 +++ src/sys/compat/netbsd32/netbsd32_netbsd.c Tue Dec 25 11:33:27 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_netbsd.c,v 1.193 2014/07/31 12:35:33 maxv Exp $ */ +/* $NetBSD: netbsd32_netbsd.c,v 1.193.10.1 2018/12/25 11:33:27 martin Exp $ */ /* * Copyright (c) 1998, 2001, 2008 Matthew R. Green @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.193 2014/07/31 12:35:33 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.193.10.1 2018/12/25 11:33:27 martin Exp $"); #if defined(_KERNEL_OPT) #include "opt_ddb.h" @@ -1754,7 +1754,7 @@ netbsd32_swapctl_stats(struct lwp *l, st count = uvmexp.nswapdev; ksep_len = sizeof(*ksep) * count; - ksep = kmem_alloc(ksep_len, KM_SLEEP); + ksep = kmem_zalloc(ksep_len, KM_SLEEP); usep32 = (struct netbsd32_swapent *)SCARG(uap, arg); uvm_swap_stats(SWAP_STATS, ksep, count, retval); Index: src/sys/uvm/uvm_swap.c diff -u src/sys/uvm/uvm_swap.c:1.172 src/sys/uvm/uvm_swap.c:1.172.10.1 --- src/sys/uvm/uvm_swap.c:1.172 Fri Jul 25 08:10:40 2014 +++ src/sys/uvm/uvm_swap.c Tue Dec 25 11:33:27 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_swap.c,v 1.172 2014/07/25 08:10:40 dholland Exp $ */ +/* $NetBSD: uvm_swap.c,v 1.172.10.1 2018/12/25 11:33:27 martin Exp $ */ /* * Copyright (c) 1995, 1996, 1997, 2009 Matthew R. Green @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: uvm_swap.c,v 1.172 2014/07/25 08:10:40 dholland Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uvm_swap.c,v 1.172.10.1 2018/12/25 11:33:27 martin Exp $"); #include "opt_uvmhist.h" #include "opt_compat_netbsd.h" @@ -515,7 +515,7 @@ sys_swapctl(struct lwp *l, const struct else #endif len = sizeof(struct swapent) * misc; - sep = (struct swapent *)kmem_alloc(len, KM_SLEEP); + sep = (struct swapent *)kmem_zalloc(len, KM_SLEEP); uvm_swap_stats(SCARG(uap, cmd), sep, misc, retval); error = copyout(sep, SCARG(uap, arg), len);
CVS commit: [netbsd-7] src/sys
Module Name:src Committed By: martin Date: Tue Dec 25 11:32:30 UTC 2018 Modified Files: src/sys/compat/netbsd32 [netbsd-7]: netbsd32_netbsd.c src/sys/uvm [netbsd-7]: uvm_swap.c Log Message: Apply patch, requested by maxv in ticket #1666: Fix similar to: sys/uvm/uvm_swap.c: revision 1.178 Woah man, fix enormous leak. Possible info leak: [len=1056, leaked=931] #0 0x80bad351 in kleak_copyout #1 0x80b2cf64 in uvm_swap_stats.part.1 #2 0x80b2d38d in uvm_swap_stats #3 0x80b2d43c in sys_swapctl #4 0x80259b82 in syscall To generate a diff of this commit: cvs rdiff -u -r1.193 -r1.193.2.1 src/sys/compat/netbsd32/netbsd32_netbsd.c cvs rdiff -u -r1.172 -r1.172.2.1 src/sys/uvm/uvm_swap.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/netbsd32/netbsd32_netbsd.c diff -u src/sys/compat/netbsd32/netbsd32_netbsd.c:1.193 src/sys/compat/netbsd32/netbsd32_netbsd.c:1.193.2.1 --- src/sys/compat/netbsd32/netbsd32_netbsd.c:1.193 Thu Jul 31 12:35:33 2014 +++ src/sys/compat/netbsd32/netbsd32_netbsd.c Tue Dec 25 11:32:30 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_netbsd.c,v 1.193 2014/07/31 12:35:33 maxv Exp $ */ +/* $NetBSD: netbsd32_netbsd.c,v 1.193.2.1 2018/12/25 11:32:30 martin Exp $ */ /* * Copyright (c) 1998, 2001, 2008 Matthew R. Green @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.193 2014/07/31 12:35:33 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.193.2.1 2018/12/25 11:32:30 martin Exp $"); #if defined(_KERNEL_OPT) #include "opt_ddb.h" @@ -1754,7 +1754,7 @@ netbsd32_swapctl_stats(struct lwp *l, st count = uvmexp.nswapdev; ksep_len = sizeof(*ksep) * count; - ksep = kmem_alloc(ksep_len, KM_SLEEP); + ksep = kmem_zalloc(ksep_len, KM_SLEEP); usep32 = (struct netbsd32_swapent *)SCARG(uap, arg); uvm_swap_stats(SWAP_STATS, ksep, count, retval); Index: src/sys/uvm/uvm_swap.c diff -u src/sys/uvm/uvm_swap.c:1.172 src/sys/uvm/uvm_swap.c:1.172.2.1 --- src/sys/uvm/uvm_swap.c:1.172 Fri Jul 25 08:10:40 2014 +++ src/sys/uvm/uvm_swap.c Tue Dec 25 11:32:30 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_swap.c,v 1.172 2014/07/25 08:10:40 dholland Exp $ */ +/* $NetBSD: uvm_swap.c,v 1.172.2.1 2018/12/25 11:32:30 martin Exp $ */ /* * Copyright (c) 1995, 1996, 1997, 2009 Matthew R. Green @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: uvm_swap.c,v 1.172 2014/07/25 08:10:40 dholland Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uvm_swap.c,v 1.172.2.1 2018/12/25 11:32:30 martin Exp $"); #include "opt_uvmhist.h" #include "opt_compat_netbsd.h" @@ -515,7 +515,7 @@ sys_swapctl(struct lwp *l, const struct else #endif len = sizeof(struct swapent) * misc; - sep = (struct swapent *)kmem_alloc(len, KM_SLEEP); + sep = (struct swapent *)kmem_zalloc(len, KM_SLEEP); uvm_swap_stats(SCARG(uap, cmd), sep, misc, retval); error = copyout(sep, SCARG(uap, arg), len);
CVS commit: [netbsd-7] src/doc
Module Name:src Committed By: martin Date: Tue Dec 25 11:33:02 UTC 2018 Modified Files: src/doc [netbsd-7]: CHANGES-7.3 Log Message: Ticket #1666 To generate a diff of this commit: cvs rdiff -u -r1.1.2.26 -r1.1.2.27 src/doc/CHANGES-7.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/CHANGES-7.3 diff -u src/doc/CHANGES-7.3:1.1.2.26 src/doc/CHANGES-7.3:1.1.2.27 --- src/doc/CHANGES-7.3:1.1.2.26 Tue Dec 18 18:35:26 2018 +++ src/doc/CHANGES-7.3 Tue Dec 25 11:33:02 2018 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-7.3,v 1.1.2.26 2018/12/18 18:35:26 martin Exp $ +# $NetBSD: CHANGES-7.3,v 1.1.2.27 2018/12/25 11:33:02 martin Exp $ A complete list of changes from the NetBSD 7.2 release to the NetBSD 7.3 release: @@ -336,3 +336,9 @@ usr.bin/telnet/utilities.c 1.24 Switch some sprintf to snprintf. [maya, ticket #1665] +sys/uvm/uvm_swap.c1.178 (patch, adapted) +sys/compat/netbsd32/netbsd32_netbsd.c (patch) + + Fix kernel info leak in swapctl(2). + [maxv, ticket #1666] +
CVS commit: [netbsd-8] src/doc
Module Name:src Committed By: martin Date: Tue Dec 25 11:26:48 UTC 2018 Modified Files: src/doc [netbsd-8]: CHANGES-8.1 Log Message: Tickets #1142, #1143 and #1145 To generate a diff of this commit: cvs rdiff -u -r1.1.2.79 -r1.1.2.80 src/doc/CHANGES-8.1 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/CHANGES-8.1 diff -u src/doc/CHANGES-8.1:1.1.2.79 src/doc/CHANGES-8.1:1.1.2.80 --- src/doc/CHANGES-8.1:1.1.2.79 Thu Dec 20 11:35:32 2018 +++ src/doc/CHANGES-8.1 Tue Dec 25 11:26:48 2018 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-8.1,v 1.1.2.79 2018/12/20 11:35:32 martin Exp $ +# $NetBSD: CHANGES-8.1,v 1.1.2.80 2018/12/25 11:26:48 martin Exp $ A complete list of changes from the NetBSD 8.0 release to the NetBSD 8.1 release: @@ -2087,3 +2087,20 @@ sys/dev/pci/ixgbe/ix_txrx.c 1.51 Fix TX queue assignment in some cases. [knakahara, ticket #1141] +sys/uvm/uvm_swap.c1.178 (patch, adapted) +sys/compat/netbsd32/netbsd32_netbsd.c (patch) + + Fix kernel info leak in swapctl(2). + [maxv, ticket #1142] + +sys/arch/mips/mips/fp.S1.49 + + Fix fpu register saves in kernel emulated instructions. + [sevan, ticket #1143] + + +sys/external/bsd/drm2/nouveau/nouveau_pci.c 1.23 + + Do not attach too new "turing" based nouveau cards. + [maya, ticket #1145] +
CVS commit: [netbsd-8] src/sys/external/bsd/drm2/nouveau
Module Name:src Committed By: martin Date: Tue Dec 25 11:25:00 UTC 2018 Modified Files: src/sys/external/bsd/drm2/nouveau [netbsd-8]: nouveau_pci.c Log Message: Pull up following revision(s) (requested by maya in ticket #1145): sys/external/bsd/drm2/nouveau/nouveau_pci.c: revision 1.23 don't attach to new turing based nouveau cards. To generate a diff of this commit: cvs rdiff -u -r1.8.10.1 -r1.8.10.2 \ src/sys/external/bsd/drm2/nouveau/nouveau_pci.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/external/bsd/drm2/nouveau/nouveau_pci.c diff -u src/sys/external/bsd/drm2/nouveau/nouveau_pci.c:1.8.10.1 src/sys/external/bsd/drm2/nouveau/nouveau_pci.c:1.8.10.2 --- src/sys/external/bsd/drm2/nouveau/nouveau_pci.c:1.8.10.1 Fri Jun 8 10:08:06 2018 +++ src/sys/external/bsd/drm2/nouveau/nouveau_pci.c Tue Dec 25 11:25:00 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: nouveau_pci.c,v 1.8.10.1 2018/06/08 10:08:06 martin Exp $ */ +/* $NetBSD: nouveau_pci.c,v 1.8.10.2 2018/12/25 11:25:00 martin Exp $ */ /*- * Copyright (c) 2015 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: nouveau_pci.c,v 1.8.10.1 2018/06/08 10:08:06 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: nouveau_pci.c,v 1.8.10.2 2018/12/25 11:25:00 martin Exp $"); #include #include @@ -101,7 +101,7 @@ nouveau_pci_match(device_t parent, cfdat return 0; /* - * NetBSD drm2 doesn't support Pascal-based cards: + * NetBSD drm2 doesn't support Pascal, Volta or Turing based cards: * 0x1580-0x15ff GP100 * 0x1b00-0x1b7f GP102 * 0x1b80-0x1bff GP104 @@ -109,6 +109,9 @@ nouveau_pci_match(device_t parent, cfdat * 0x1c80-0x1cff GP107 * 0x1d00-0x1d7f GP108 * 0x1d80-0x1dff GV100 + * 0x1e00-0x1e7f TU102 + * 0x1e80-0x1eff TU104 + * 0x1f00-0x1f7f TU106 */ if (IS_BETWEEN(0x1580, 0x15ff) || @@ -117,7 +120,10 @@ nouveau_pci_match(device_t parent, cfdat IS_BETWEEN(0x1c00, 0x1c7f) || IS_BETWEEN(0x1c80, 0x1cff) || IS_BETWEEN(0x1d00, 0x1d7f) || - IS_BETWEEN(0x1d80, 0x1dff)) + IS_BETWEEN(0x1d80, 0x1dff) || + IS_BETWEEN(0x1e00, 0x1e7f) || + IS_BETWEEN(0x1e80, 0x1eff) || + IS_BETWEEN(0x1f00, 0x1f7f)) return 0; #undef IS_BETWEEN
CVS commit: [netbsd-8] src/sys/arch/mips/mips
Module Name:src Committed By: martin Date: Tue Dec 25 11:22:43 UTC 2018 Modified Files: src/sys/arch/mips/mips [netbsd-8]: fp.S Log Message: Pull up following revision(s) (requested by sevan in ticket #1143): sys/arch/mips/mips/fp.S: revision 1.49 Load curlwp into a0 to call fpu_save(curlwp), not fpu_save(garbage). The lwp argument to fpu_save was added by chuq in revision 1.14 of mips_fpu.c, but this call was not updated to pass it. This is the correct lwp to pass because we are in the middle of executing a kernel-emulated fp instruction, so curlwp must own the fpu state, and we are trying to write the fp registers to memory so we can adjust them there when ctc1 would fail. Fixes PR port-cobalt/53090, PR port-sgimips/53791. To generate a diff of this commit: cvs rdiff -u -r1.48 -r1.48.6.1 src/sys/arch/mips/mips/fp.S 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/mips/mips/fp.S diff -u src/sys/arch/mips/mips/fp.S:1.48 src/sys/arch/mips/mips/fp.S:1.48.6.1 --- src/sys/arch/mips/mips/fp.S:1.48 Mon Feb 27 06:57:45 2017 +++ src/sys/arch/mips/mips/fp.S Tue Dec 25 11:22:43 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: fp.S,v 1.48 2017/02/27 06:57:45 chs Exp $ */ +/* $NetBSD: fp.S,v 1.48.6.1 2018/12/25 11:22:43 martin Exp $ */ /* * Copyright (c) 1992, 1993 @@ -2827,6 +2827,7 @@ fpe_trap: * ctc1 with fpe bits set causes FPE in kernel mode panic on 5231. */ REG_S a2, CALLFRAME_SIZ + 3*SZREG(sp) + move a0, MIPS_CURLWP # get current lwp jal _C_LABEL(fpu_save) # on RM5231 REG_L a2, CALLFRAME_SIZ + 3*SZREG(sp)
CVS commit: [netbsd-8] src/sys
Module Name:src Committed By: martin Date: Tue Dec 25 11:19:52 UTC 2018 Modified Files: src/sys/compat/netbsd32 [netbsd-8]: netbsd32_netbsd.c src/sys/uvm [netbsd-8]: uvm_swap.c Log Message: Apply patch, requested by maxv in ticket #1142: Similar to: sys/uvm/uvm_swap.c: revision 1.178 Fix kernel info leak in swapctl(2). Possible info leak: [len=1056, leaked=931] #0 0x80bad351 in kleak_copyout #1 0x80b2cf64 in uvm_swap_stats.part.1 #2 0x80b2d38d in uvm_swap_stats #3 0x80b2d43c in sys_swapctl #4 0x80259b82 in syscall To generate a diff of this commit: cvs rdiff -u -r1.206 -r1.206.2.1 src/sys/compat/netbsd32/netbsd32_netbsd.c cvs rdiff -u -r1.174.10.1 -r1.174.10.2 src/sys/uvm/uvm_swap.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/netbsd32/netbsd32_netbsd.c diff -u src/sys/compat/netbsd32/netbsd32_netbsd.c:1.206 src/sys/compat/netbsd32/netbsd32_netbsd.c:1.206.2.1 --- src/sys/compat/netbsd32/netbsd32_netbsd.c:1.206 Sat Apr 29 01:15:40 2017 +++ src/sys/compat/netbsd32/netbsd32_netbsd.c Tue Dec 25 11:19:52 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_netbsd.c,v 1.206 2017/04/29 01:15:40 christos Exp $ */ +/* $NetBSD: netbsd32_netbsd.c,v 1.206.2.1 2018/12/25 11:19:52 martin Exp $ */ /* * Copyright (c) 1998, 2001, 2008 Matthew R. Green @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.206 2017/04/29 01:15:40 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_netbsd.c,v 1.206.2.1 2018/12/25 11:19:52 martin Exp $"); #if defined(_KERNEL_OPT) #include "opt_ddb.h" @@ -1770,7 +1770,7 @@ netbsd32_swapctl_stats(struct lwp *l, st } ksep_len = sizeof(*ksep) * count; - ksep = kmem_alloc(ksep_len, KM_SLEEP); + ksep = kmem_zalloc(ksep_len, KM_SLEEP); usep32 = (struct netbsd32_swapent *)SCARG(uap, arg); uvm_swap_stats(SWAP_STATS, ksep, count, retval); Index: src/sys/uvm/uvm_swap.c diff -u src/sys/uvm/uvm_swap.c:1.174.10.1 src/sys/uvm/uvm_swap.c:1.174.10.2 --- src/sys/uvm/uvm_swap.c:1.174.10.1 Thu Nov 2 21:29:53 2017 +++ src/sys/uvm/uvm_swap.c Tue Dec 25 11:19:52 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_swap.c,v 1.174.10.1 2017/11/02 21:29:53 snj Exp $ */ +/* $NetBSD: uvm_swap.c,v 1.174.10.2 2018/12/25 11:19:52 martin Exp $ */ /* * Copyright (c) 1995, 1996, 1997, 2009 Matthew R. Green @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: uvm_swap.c,v 1.174.10.1 2017/11/02 21:29:53 snj Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uvm_swap.c,v 1.174.10.2 2018/12/25 11:19:52 martin Exp $"); #include "opt_uvmhist.h" #include "opt_compat_netbsd.h" @@ -525,7 +525,7 @@ sys_swapctl(struct lwp *l, const struct else #endif len = sizeof(struct swapent) * misc; - sep = (struct swapent *)kmem_alloc(len, KM_SLEEP); + sep = (struct swapent *)kmem_zalloc(len, KM_SLEEP); uvm_swap_stats(SCARG(uap, cmd), sep, misc, retval); error = copyout(sep, SCARG(uap, arg), len);
CVS commit: src/sys/arch
Module Name:src Committed By: cherry Date: Tue Dec 25 09:00:26 UTC 2018 Modified Files: src/sys/arch/i386/i386: i386_trap.S spl.S src/sys/arch/xen/x86: xen_intr.c Log Message: fix i386 build - missed sources migration in previous commit. allow xen_intr.c to build by bringing in static support functions for -D INTRSTACKSIZE This should fix the i386 build now. To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/sys/arch/i386/i386/i386_trap.S cvs rdiff -u -r1.44 -r1.45 src/sys/arch/i386/i386/spl.S cvs rdiff -u -r1.11 -r1.12 src/sys/arch/xen/x86/xen_intr.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/i386/i386/i386_trap.S diff -u src/sys/arch/i386/i386/i386_trap.S:1.15 src/sys/arch/i386/i386/i386_trap.S:1.16 --- src/sys/arch/i386/i386/i386_trap.S:1.15 Sat Jul 14 14:29:40 2018 +++ src/sys/arch/i386/i386/i386_trap.S Tue Dec 25 09:00:26 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: i386_trap.S,v 1.15 2018/07/14 14:29:40 maxv Exp $ */ +/* $NetBSD: i386_trap.S,v 1.16 2018/12/25 09:00:26 cherry Exp $ */ /* * Copyright 2002 (c) Wasabi Systems, Inc. @@ -66,7 +66,7 @@ #if 0 #include -__KERNEL_RCSID(0, "$NetBSD: i386_trap.S,v 1.15 2018/07/14 14:29:40 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: i386_trap.S,v 1.16 2018/12/25 09:00:26 cherry Exp $"); #endif /* @@ -447,12 +447,12 @@ _C_LABEL(trapreturn): .globl trapreturn movl $.Lalltraps_resume,%esi /* address to resume loop at */ .Lalltraps_resume: movl %ebx,%eax /* get cpl */ - movl CPUVAR(IUNMASK)(,%eax,4),%eax - andl CPUVAR(IPENDING),%eax /* any non-masked bits left? */ + movl CPUVAR(XUNMASK)(,%eax,4),%eax + andl CPUVAR(XPENDING),%eax /* any non-masked bits left? */ jz 7f bsrl %eax,%eax - btrl %eax,CPUVAR(IPENDING) - movl CPUVAR(ISOURCES)(,%eax,4),%eax + btrl %eax,CPUVAR(XPENDING) + movl CPUVAR(XSOURCES)(,%eax,4),%eax jmp *IS_RESUME(%eax) 7: movl %ebx,CPUVAR(ILEVEL) /* restore cpl */ jmp _C_LABEL(trapreturn) Index: src/sys/arch/i386/i386/spl.S diff -u src/sys/arch/i386/i386/spl.S:1.44 src/sys/arch/i386/i386/spl.S:1.45 --- src/sys/arch/i386/i386/spl.S:1.44 Tue Dec 25 06:50:11 2018 +++ src/sys/arch/i386/i386/spl.S Tue Dec 25 09:00:26 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: spl.S,v 1.44 2018/12/25 06:50:11 cherry Exp $ */ +/* $NetBSD: spl.S,v 1.45 2018/12/25 09:00:26 cherry Exp $ */ /* * Copyright (c) 1998, 2007, 2008 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: spl.S,v 1.44 2018/12/25 06:50:11 cherry Exp $"); +__KERNEL_RCSID(0, "$NetBSD: spl.S,v 1.45 2018/12/25 09:00:26 cherry Exp $"); #include "opt_ddb.h" #include "opt_spldebug.h" @@ -290,12 +290,12 @@ IDTVEC(doreti) 2: /* Check for ASTs on exit to user mode. */ #if defined(XEN) movl %ebx,%eax - movl CPUVAR(IUNMASK)(,%eax,4),%eax - andl CPUVAR(IPENDING),%eax + movl CPUVAR(XUNMASK)(,%eax,4),%eax + andl CPUVAR(XPENDING),%eax jz 3f bsrl %eax,%eax /* slow, but not worth optimizing */ - btrl %eax,CPUVAR(IPENDING) - movl CPUVAR(ISOURCES)(,%eax, 4),%eax + btrl %eax,CPUVAR(XPENDING) + movl CPUVAR(XSOURCES)(,%eax, 4),%eax jmp *IS_RESUME(%eax) #endif 3: Index: src/sys/arch/xen/x86/xen_intr.c diff -u src/sys/arch/xen/x86/xen_intr.c:1.11 src/sys/arch/xen/x86/xen_intr.c:1.12 --- src/sys/arch/xen/x86/xen_intr.c:1.11 Tue Dec 25 06:50:12 2018 +++ src/sys/arch/xen/x86/xen_intr.c Tue Dec 25 09:00:26 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: xen_intr.c,v 1.11 2018/12/25 06:50:12 cherry Exp $ */ +/* $NetBSD: xen_intr.c,v 1.12 2018/12/25 09:00:26 cherry Exp $ */ /*- * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: xen_intr.c,v 1.11 2018/12/25 06:50:12 cherry Exp $"); +__KERNEL_RCSID(0, "$NetBSD: xen_intr.c,v 1.12 2018/12/25 09:00:26 cherry Exp $"); #include #include @@ -40,6 +40,8 @@ __KERNEL_RCSID(0, "$NetBSD: xen_intr.c,v #include +#include + #include #include @@ -302,6 +304,24 @@ xen_cpu_intr_redistribute(void) } /* MD - called by x86/cpu.c */ +#if defined(INTRSTACKSIZE) +static inline bool +redzone_const_or_false(bool x) +{ +#ifdef DIAGNOSTIC + return x; +#else + return false; +#endif /* !DIAGNOSTIC */ +} + +static inline int +redzone_const_or_zero(int x) +{ + return redzone_const_or_false(true) ? x : 0; +} +#endif + void cpu_intr_init(struct cpu_info *ci) {
CVS commit: src/external/mit/xorg/lib/libxkbfile
Module Name:src Committed By: maya Date: Tue Dec 25 08:59:06 UTC 2018 Modified Files: src/external/mit/xorg/lib/libxkbfile: Makefile Log Message: Remove duplicate INCSDIR To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/external/mit/xorg/lib/libxkbfile/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/mit/xorg/lib/libxkbfile/Makefile diff -u src/external/mit/xorg/lib/libxkbfile/Makefile:1.3 src/external/mit/xorg/lib/libxkbfile/Makefile:1.4 --- src/external/mit/xorg/lib/libxkbfile/Makefile:1.3 Thu Nov 6 22:28:26 2008 +++ src/external/mit/xorg/lib/libxkbfile/Makefile Tue Dec 25 08:59:06 2018 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.3 2008/11/06 22:28:26 veego Exp $ +# $NetBSD: Makefile,v 1.4 2018/12/25 08:59:06 maya Exp $ .include @@ -12,8 +12,6 @@ SRCS= cout.c maprules.c srvmisc.c xkbato CPPFLAGS+= -I${DESTDIR}${X11INCDIR}/X11/extensions -INCSDIR=${X11INCDIR}/X11/extensions - INCS= XKBbells.h XKBconfig.h XKBfile.h XKBrules.h XKM.h XKMformat.h INCSDIR=${X11INCDIR}/X11/extensions
CVS commit: src/sys/dev/mii
Module Name:src Committed By: msaitoh Date: Tue Dec 25 08:33:52 UTC 2018 Added Files: src/sys/dev/mii: makphyreg.h Log Message: Re-add makphyreg.h To generate a diff of this commit: cvs rdiff -u -r0 -r1.8 src/sys/dev/mii/makphyreg.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Added files: Index: src/sys/dev/mii/makphyreg.h diff -u /dev/null src/sys/dev/mii/makphyreg.h:1.8 --- /dev/null Tue Dec 25 08:33:52 2018 +++ src/sys/dev/mii/makphyreg.h Tue Dec 25 08:33:52 2018 @@ -0,0 +1,116 @@ +/* $NetBSD: makphyreg.h,v 1.8 2018/12/25 08:33:52 msaitoh Exp $ */ + +/*- + * Copyright (c) 2001 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Jason R. Thorpe. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _DEV_MII_MAKPHYREG_H_ +#define _DEV_MII_MAKPHYREG_H_ + +/* + * Marvell 88E1000 ``Alaska'' 10/100/1000 PHY registers. + */ + +#define MII_MAKPHY_PSCR 0x10 /* PHY specific control register */ +#define PSCR_DIS_JABBER (1U << 0) /* disable jabber */ +#define PSCR_POL_REV (1U << 1) /* polarity reversal */ +#define PSCR_SQE_TEST (1U << 2) /* SQE test */ +#define PSCR_MBO (1U << 3) /* must be one */ +#define PSCR_DIS_125CLK (1U << 4) /* 125CLK low */ +#define PSCR_MDI_XOVER_MODE(x) ((x) << 5) /* crossover mode */ +#define PSCR_LOW_10T_THRESH (1U << 7) /* lower 10BASE-T Rx threshold */ +#define PSCR_FORCE_LINK_GOOD (1U << 10) /* force link good */ +#define PSCR_CRS_ON_TX (1U << 11) /* assert CRS on transmit */ +#define PSCR_RX_FIFO(x) ((x) << 12) /* Rx FIFO depth */ +#define PSCR_TX_FIFO(x) ((x) << 14) /* Tx FIFO depth */ + +#define XOVER_MODE_MDI 0 +#define XOVER_MODE_MDIX 1 +#define XOVER_MODE_AUTO 2 + +#define MII_MAKPHY_PSSR 0x11 /* PHY specific status register */ +#define PSSR_JABBER (1U << 0) /* jabber indication */ +#define PSSR_POLARITY (1U << 1) /* polarity indiciation */ +#define PSSR_MDIX (1U << 6) /* 1 = MIDX, 0 = MDI */ +#define PSSR_CABLE_LENGTH_get(x) (((x) >> 7) & 0x3) +#define PSSR_LINK (1U << 10) /* link indication */ +#define PSSR_RESOLVED (1U << 11) /* speed and duplex resolved */ +#define PSSR_PAGE_RECEIVED (1U << 12) /* page received */ +#define PSSR_DUPLEX (1U << 13) /* 1 = FDX */ +#define PSSR_SPEED_get(x) (((x) >> 14) & 0x3) + +#define SPEED_10 0 +#define SPEED_100 1 +#define SPEED_1000 2 +#define SPEED_reserved 3 + +#define MII_MAKPHY_IE 0x12 /* Interrupt enable */ +#define IE_JABBER (1U << 0) /* jabber indication */ +#define IE_POL_CHANGED (1U << 1) /* polarity changed */ +#define IE_MDI_XOVER_CHANGED (1U << 6) /* MDI/MDIX changed */ +#define IE_FIFO_OVER_UNDER (1U << 7) /* FIFO over/underflow */ +#define IE_FALSE_CARRIER (1U << 8) /* false carrier detected */ +#define IE_SYMBOL_ERROR (1U << 9) /* symbol error occurred */ +#define IE_LINK_CHANGED (1U << 10) /* link status changed */ +#define IE_ANEG_COMPLETE (1U << 11) /* autonegotiation completed */ +#define IE_PAGE_RECEIVED (1U << 12) /* page received */ +#define IE_DUPLEX_CHANGED (1U << 13) /* duplex changed */ +#define IE_SPEED_CHANGED (1U << 14) /* speed changed */ +#define IE_ANEG_ERROR (1U << 15) /* autonegotiation error occurred */ + +#define MII_MAKPHY_IS 0x13 /* Interrupt status */ + /* See Interrupt enable bits */ + +#define MII_MAKPHY_EPSC 0x14 /* extended PHY specific control */ +#define EPSC_TX_CLK(x) ((x) << 4) /* transmit clock */ +#define EPSC_TBI_RCLK_DIS (1U << 12) /* TBI RCLK disable */ +#define EPSC_TBI_RX_CLK125_EN (1U << 13) /* TBI RX_CLK125 enable */ +#define EPSC_LINK_DOWN_NO_IDLES (1U <<