OpenBSD CVS

CVS log for src/usr.sbin/memconfig/memconfig.c


[BACK] Up to [local] / src / usr.sbin / memconfig

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.19 / (download) - annotate - [select for diffs], Fri Jun 28 13:32:48 2019 UTC (4 years, 11 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6, HEAD
Changes since 1.18: +6 -6 lines
Diff to previous 1.18 (colored)

When system calls indicate an error they return -1, not some arbitrary
value < 0.  errno is only updated in this case.  Change all (most?)
callers of syscalls to follow this better, and let's see if this strictness
helps us in the future.

Revision 1.18 / (download) - annotate - [select for diffs], Sun Aug 14 18:34:48 2016 UTC (7 years, 9 months ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5, OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2, OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.17: +6 -6 lines
Diff to previous 1.17 (colored)

Convert remaining calls to strtoq/strtouq in base with strtoll/strtoull.
Fix a type mismatch in ftp's "page" command and could make transfers restart
at the wrong position.

ok and a ull->ll tweak from natano@, ok tedu@

Revision 1.17 / (download) - annotate - [select for diffs], Mon Dec 21 21:37:09 2015 UTC (8 years, 5 months ago) by mmcc
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.16: +2 -3 lines
Diff to previous 1.16 (colored)

remove NULL-check before free()

Revision 1.16 / (download) - annotate - [select for diffs], Sat Apr 12 15:57:50 2014 UTC (10 years, 1 month ago) by jsg
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8, OPENBSD_5_7_BASE, OPENBSD_5_7, OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.15: +2 -2 lines
Diff to previous 1.15 (colored)

fix a bit test
from FreeBSD rev 241829

Revision 1.15 / (download) - annotate - [select for diffs], Tue Sep 20 08:28:51 2011 UTC (12 years, 8 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5, OPENBSD_5_4_BASE, OPENBSD_5_4, OPENBSD_5_3_BASE, OPENBSD_5_3, OPENBSD_5_2_BASE, OPENBSD_5_2, OPENBSD_5_1_BASE, OPENBSD_5_1
Changes since 1.14: +14 -5 lines
Diff to previous 1.14 (colored)

report the "fix-active" flag, and print any other unknown flags in hex.
ok oga kettenis

Revision 1.14 / (download) - annotate - [select for diffs], Mon Jun 6 14:59:16 2011 UTC (12 years, 11 months ago) by tedu
Branch: MAIN
CVS Tags: OPENBSD_5_0_BASE, OPENBSD_5_0
Changes since 1.13: +6 -5 lines
Diff to previous 1.13 (colored)

don't open /dev/mem to print the help, allowing mortals to read it
ok deraadt matthew

Revision 1.13 / (download) - annotate - [select for diffs], Tue Apr 20 16:10:27 2010 UTC (14 years, 1 month ago) by marco
Branch: MAIN
CVS Tags: OPENBSD_4_9_BASE, OPENBSD_4_9, OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.12: +6 -4 lines
Diff to previous 1.12 (colored)

0x0 is a valid base address.

ok oga

Revision 1.12 / (download) - annotate - [select for diffs], Sun Sep 2 15:19:39 2007 UTC (16 years, 9 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7, OPENBSD_4_6_BASE, OPENBSD_4_6, OPENBSD_4_5_BASE, OPENBSD_4_5, OPENBSD_4_4_BASE, OPENBSD_4_4, OPENBSD_4_3_BASE, OPENBSD_4_3
Changes since 1.11: +2 -2 lines
Diff to previous 1.11 (colored)

use calloc() to avoid malloc(n * m) overflows; checked by djm canacar jsg

Revision 1.11 / (download) - annotate - [select for diffs], Tue Mar 14 19:23:16 2006 UTC (18 years, 2 months ago) by moritz
Branch: MAIN
CVS Tags: OPENBSD_4_2_BASE, OPENBSD_4_2, OPENBSD_4_1_BASE, OPENBSD_4_1, OPENBSD_4_0_BASE, OPENBSD_4_0
Changes since 1.10: +7 -7 lines
Diff to previous 1.10 (colored)

Some more usage of const and correct fmt string for a size_t.
From David Hill. ok ray@ jaredy@ otto@

Revision 1.10 / (download) - annotate - [select for diffs], Thu Dec 4 03:08:26 2003 UTC (20 years, 6 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_3_9_BASE, OPENBSD_3_9, OPENBSD_3_8_BASE, OPENBSD_3_8, OPENBSD_3_7_BASE, OPENBSD_3_7, OPENBSD_3_6_BASE, OPENBSD_3_6, OPENBSD_3_5_BASE, OPENBSD_3_5
Changes since 1.9: +17 -37 lines
Diff to previous 1.9 (colored)

ansi

Revision 1.9 / (download) - annotate - [select for diffs], Fri Sep 26 16:09:27 2003 UTC (20 years, 8 months ago) by deraadt
Branch: MAIN
Changes since 1.8: +5 -3 lines
Diff to previous 1.8 (colored)

check strdup failure; ok anil millert

Revision 1.8 / (download) - annotate - [select for diffs], Thu Jun 26 19:47:09 2003 UTC (20 years, 11 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_3_4_BASE, OPENBSD_3_4
Changes since 1.7: +4 -7 lines
Diff to previous 1.7 (colored)

strict proto cleanups

Revision 1.7 / (download) - annotate - [select for diffs], Thu Mar 13 09:09:48 2003 UTC (21 years, 2 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_3_3_BASE, OPENBSD_3_3
Changes since 1.6: +4 -3 lines
Diff to previous 1.6 (colored)

lots of sprintf -> snprintf and strcpy -> strlcpy; checked by tedu

Revision 1.6 / (download) - annotate - [select for diffs], Mon Oct 14 21:01:01 2002 UTC (21 years, 7 months ago) by matthieu
Branch: MAIN
Changes since 1.5: +4 -2 lines
Diff to previous 1.5 (colored)

Fix from FreeBSD for atlhon problems with mtrr and XFree86. Ok deraadt@

FreeBSD commit messages say:

Some BIOSs are using MTRR values that are only documented under NDA
to control the mapping of things like the ACPI and APM into memory.

The problem is that starting X changes these values, so if something
was using the bits of BIOS mapped into memory (say ACPI or APM),
then next time they access this memory the machine would hang.

This patch refuse to change MTRR values it doesn't understand,
unless a new "force" option is given. This means X doesn't change
them by accident but someone can override that if they really want
to.

PR:             28418
Tested by:      Christopher Masto <chris at netmonger dot net>,
                David Bushong <david at bushong dot net>,
                Santos <casd at myrealbox dot com>


Make the MTRR code a bit more defensive - this should help people
trying to run X on some Athlon systems where the BIOS does odd things
(mines an ASUS A7A266, but it seems to also help on other systems).

Here's a description of the problem and my fix:

        The problem with the old MTRR code is that it only expects
        to find documented values in the bytes of MTRR registers.
        To convert the MTRR byte into a FreeBSD "Memory Range Type"
        (mrt) it uses the byte value and looks it up in an array.
        If the value is not in range then the mrt value ends up
        containing random junk.

        This isn't an immediate problem. The mrt value is only used
        later when rewriting the MTRR registers. When we finally
        go to write a value back again, the function i686_mtrrtype()
        searches for the junk value and returns -1 when it fails
        to find it. This is converted to a byte (0xff) and written
        back to the register, causing a GPF as 0xff is an illegal
        value for a MTRR byte.

        To work around this problem I've added a new mrt flag
        MDF_UNKNOWN.  We set this when we read a MTRR byte which
        we do not understand.  If we try to convert a MDF_UNKNOWN
        back into a MTRR value, then the new function, i686_mrt2mtrr,
        just returns the old value of the MTRR byte. This leaves
        the memory range type unchanged.

I have seen one side effect of the fix, which is that ACPI calls
after X has been run seem to hang my machine. As running X would
previously panic the machine, this is still an improvement ;-)

PR:             28418, 25958
Tested by:      jkh, Christopher Masto <chris at netmonger dot net>

Revision 1.5 / (download) - annotate - [select for diffs], Thu May 30 19:09:05 2002 UTC (22 years ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_3_2_BASE, OPENBSD_3_2
Changes since 1.4: +43 -43 lines
Diff to previous 1.4 (colored)

minor KNF

Revision 1.4 / (download) - annotate - [select for diffs], Sat Feb 16 21:28:04 2002 UTC (22 years, 3 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_1_BASE, OPENBSD_3_1
Changes since 1.3: +7 -7 lines
Diff to previous 1.3 (colored)

Part one of userland __P removal.  Done with a simple regexp with some minor hand editing to make comments line up correctly.  Another pass is forthcoming that handles the cases that could not be done automatically.

Revision 1.3 / (download) - annotate - [select for diffs], Fri Jul 27 20:34:36 2001 UTC (22 years, 10 months ago) by pvalchev
Branch: MAIN
CVS Tags: OPENBSD_3_0_BASE, OPENBSD_3_0
Changes since 1.2: +1 -2 lines
Diff to previous 1.2 (colored)

Wall cleanup

Revision 1.2 / (download) - annotate - [select for diffs], Sun Dec 5 06:32:56 1999 UTC (24 years, 6 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_2_9_BASE, OPENBSD_2_9, OPENBSD_2_8_BASE, OPENBSD_2_8, OPENBSD_2_7_BASE, OPENBSD_2_7
Changes since 1.1: +3 -2 lines
Diff to previous 1.1 (colored)

prettier range check

Revision 1.1 / (download) - annotate - [select for diffs], Sat Nov 20 11:22:54 1999 UTC (24 years, 6 months ago) by matthieu
Branch: MAIN

add memconfig, an utility to manipulate MTRRs, from FreeBSD

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.