Commit Graph

301 Commits

Author SHA1 Message Date
andvar 114b022676 fix various typos in comments. 2022-05-28 22:16:43 +00:00
mrg 7e1463f49a avoid common symbols. 2021-04-12 09:18:45 +00:00
mrg 6adfa96ca4 remove shadowed (common) declarations of various libsa variables
from various boot programs.  for macppc and zaurus, avoid building
with -fcommon any more.
2021-04-12 03:55:40 +00:00
msaitoh a0403cde04 s/transfered/transferred/ 2019-12-27 09:41:48 +00:00
christos 7e81d727bc Consistently use ${RELEASEDIR}/${RELEASEMACHINE} instead of
${RELEASEDIR}/${MACHINE} (Paul Ripke)
2019-09-23 13:42:30 +00:00
riastradh d1579b2d70 Rename min/max -> uimin/uimax for better honesty.
These functions are defined on unsigned int.  The generic name
min/max should not silently truncate to 32 bits on 64-bit systems.
This is purely a name change -- no functional change intended.

HOWEVER!  Some subsystems have

	#define min(a, b)	((a) < (b) ? (a) : (b))
	#define max(a, b)	((a) > (b) ? (a) : (b))

even though our standard name for that is MIN/MAX.  Although these
may invite multiple evaluation bugs, these do _not_ cause integer
truncation.

To avoid `fixing' these cases, I first changed the name in libkern,
and then compile-tested every file where min/max occurred in order to
confirm that it failed -- and thus confirm that nothing shadowed
min/max -- before changing it.

I have left a handful of bootloaders that are too annoying to
compile-test, and some dead code:

cobalt ews4800mips hp300 hppa ia64 luna68k vax
acorn32/if_ie.c (not included in any kernels)
macppc/if_gm.c (superseded by gem(4))

It should be easy to fix the fallout once identified -- this way of
doing things fails safe, and the goal here, after all, is to _avoid_
silent integer truncations, not introduce them.

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate.  But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all.  (Who knows, maybe in some cases integer
truncation is actually intended!)
2018-09-03 16:29:22 +00:00
christos cb5e99c661 centralize vers.c building for standalone programs. 2017-04-08 19:53:19 +00:00
flxd 643b7c4e5c Match the two prom_getenv() and fix buffer overflow causing wrong host controller SCSI ID for DEC 3000.
OK skrll@
2016-10-13 16:18:20 +00:00
dholland 85e3fbd2eb PR 51200 gets in libsa considered harmful: use kgets 2016-06-11 06:24:36 +00:00
jklos cd6b0c019b Change base address to account for later Alpha models with later firmware
which require more space for SRM.
2016-01-20 12:49:21 +00:00
christos ca395ddd87 PR/50530: David Binderman: Add missing printf args 2015-12-13 18:51:14 +00:00
apb 497135b74d Avoid splitting sed programs over multiple lines with
<backslash><newline><indentation>.  Use multiple -e options instead.
2014-08-24 18:27:16 +00:00
christos db89e006d6 kill sprintf 2014-03-26 08:04:19 +00:00
christos 2b043c75b6 eliminate use of bsd.sys.mk from Makefiles 2014-01-16 01:15:32 +00:00
tsutsui 8c436a9898 Add empty LIBCRTI= as LIBCRT0 to build sa programs without installed DESTDIR.
XXX: probabry we should have bsd.saprog.mk or something.
2014-01-12 15:26:28 +00:00
christos 6527ec4ecd move unused variable inside if 0 2013-11-03 01:02:37 +00:00
christos 5f76667e10 more unused inside 0 2013-11-03 00:59:03 +00:00
christos 4049e610ff move unused code inside if 0 2013-11-03 00:53:11 +00:00
he 1e3d90c899 Include <machine/cpu.h> for alpha_rpcc declaration. 2013-01-10 10:36:41 +00:00
matt e45c4b6661 Use ${_MKTARGET_LINK} and ${_MKTARGET_CREATE} 2012-07-20 15:23:02 +00:00
joerg 3eb244d801 Retire varargs.h support. Move machine/stdarg.h logic into MI
sys/stdarg.h and expect compiler to provide proper builtins, defaulting
to the GCC interface. lint still has a special fallback.
Reduce abuse of _BSD_VA_LIST_ by defining __va_list by default and
derive va_list as required by standards.
2011-07-17 20:54:30 +00:00
joerg ca234b7316 Define NOMAN earlier 2011-01-23 13:18:57 +00:00
joerg 3c550524b5 Drop bootprog_maker (formerly enabled by -M) and bootprog_date (formerly
disabled by -D) from the output of newvers_stand.sh.  Change -D to the
inverted logic, so that it adds the date to bootprog_rev in ().

Change all platforms accordingly. -D is added if MKREPRO is not yes and
wasn't present before. Platforms that didn't use -D don't depend on
MKREPRO now either.
2011-01-22 19:19:14 +00:00
christos 6b3899fd66 change LOAD_NOTE to LOAD_BACKWARDS 2010-08-25 16:30:44 +00:00
snj febb7cce65 Drop 3rd and 4th clauses. Approved by gwr@ (copyright holder). 2009-10-21 23:12:09 +00:00
tsutsui bd6f58e511 Set STRIPFLAG= after ${MAKECONF} is included by <bsd.own.mk> via <bsd.prog.mk>.
Fixes PR install/40492.
2009-04-20 13:15:12 +00:00
tsutsui 78712968dc Use <bsd.klinks.mk> to create ${MACHINE} and ${MACHINE_ARCH} symlinks. 2009-04-13 12:18:56 +00:00
tsutsui ac465a42e7 Remove obsolete LIBSA_USE_MEMCPY and LIBSA_USE_MEMSET.
They were removed from <lib/libsa/stand.h> on December 2007.
2009-04-03 10:38:12 +00:00
cegger df7f595ecd Ansify function definitions w/o arguments. Generated with sed. 2009-03-18 10:22:21 +00:00
he 75306d0938 Correct the sense of the test for LIBSA_NO_FS_CLOSE
so that this builds again.
2009-03-17 18:43:43 +00:00
dsl 82357f6d42 ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
2009-03-14 21:04:01 +00:00
dsl 454af1c0e8 Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
2009-03-14 15:35:58 +00:00
dsl 02cdf4d2c8 Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
2009-03-14 14:45:51 +00:00
tsutsui 5d71772dad Disable LOAD_NOTE on ustarboot to avoid backward seek on loading a kernel.
Tested on DEC 3000/300 and AlphaPC 164, fixes PR install/38943 on alpha.

XXX: should we enable LOAD_NOTE on ustarfs tape boot to load modules?
2009-02-03 12:49:00 +00:00
tsutsui 69cf32a782 Replace time_t values in libsa sources with the following two types
to avoid unnecessary 64 bit ops which would make binaries larger:

satime_t (currently unsigned int):
 numbers in seconds returned by the machine dependent getsecs() function
 which are used to measure relative time

saseconds_t (currently int):
 numbers in seconds used to specify timeout to network drivers

Per discussion on current-users.
2009-01-12 11:32:43 +00:00
tsutsui ab4ced3e93 Uset uint64_t rather than (signed) long to read the PCC register. 2009-01-12 11:04:00 +00:00
tsutsui 5df57d7d96 WARNSfy 2009-01-12 07:10:13 +00:00
dogcow c23cdd912f Make it compile. 2009-01-11 13:03:17 +00:00
apb f46c1de7cb Use ${TOOL_SED} instead if plain sed in Makefiles. 2008-10-25 22:27:34 +00:00
perry 2d65de2479 bare asm -> __asm 2005-12-24 22:45:33 +00:00
christos 95e1ffb156 merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
abs 2ea92d2f7a Support booting from ffsv2 filesystems - thanks Simon Burge 2005-08-20 20:15:57 +00:00
abs 60d651f649 Include the ffsv2 filesystem ops. Necessary but not sufficient for booting
from an FFSv2 filesystem. Similar change tested on NetBSD-3
2005-08-20 20:09:25 +00:00
junyoung 17670568fe Use FS_OPS() macro. 2005-06-23 19:44:00 +00:00
junyoung 07350a5981 Drop trailing spaces. 2005-06-23 19:14:23 +00:00
christos 362a4a0bd5 Yes, it was a cool trick >20 years ago to use "0123456789abcdef"[a] to
implement, xtoa(), but I think defining the samestring 50 times is a bit
too much. Defined HEXDIGITS and hexdigits in subr_prf.c and use it...
2005-05-17 04:14:57 +00:00
simonb a773da1261 Revert previous method of stripping out the .eh_frame sections from
objects as they're built now that we strip them all out at final link
time.
2005-01-05 12:18:18 +00:00
simonb 888d4fa34c Discard any .eh_frame sections at link time by asking ${LD} to dump the
current linker script, change references for any .eh_frame sections so
that they go in to the special "DISCARD" section so that they are not
included in the final object, and use the resultant linker script when
actually linking the bootblocks.

Idea (and most of the sed expression) from Jakub Jelinek.
2005-01-05 12:16:49 +00:00
jmc a6be320e8b Make sure all objects strip out the .eh_frame section and force libsa/etc to
also do this for their objects. Otherwise this creates bootblocks that
are too large w. binutils 2.15
2004-12-28 07:50:00 +00:00
lukem f85d2d1c14 Use ${HOST_SH} instead of `sh'.
If necessary, pull in <bsd.sys.mk> to get the definition of HOST_SH;
Makefiles that pull in one of (most of) <bsd.*.mk> will get this anyway.
2003-10-26 07:25:33 +00:00