Home | History | Annotate | Download | only in isa
History log of /src/sys/arch/shark/isa/clock.c
RevisionDateAuthorComments
 1.20  09-Dec-2023  andvar add static in from hatTest() and hatWedge() to fix TESTHAT option build.
 1.19  07-Apr-2022  andvar fix various typos in comments.
 1.18  03-Sep-2018  riastradh 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!)
 1.17  07-Jul-2016  msaitoh branches: 1.17.16; 1.17.18;
KNF. Remove extra spaces. No functional change.
 1.16  17-Oct-2007  garbled branches: 1.16.64; 1.16.84;
Merge the ppcoea-renovation branch to HEAD.

This branch was a major cleanup and rototill of many of the various OEA
cpu based PPC ports that focused on sharing as much code as possible
between the various ports to eliminate near-identical copies of files in
every tree. Additionally there is a new PIC system that unifies the
interface to interrupt code for all different OEA ppc arches. The work
for this branch was done by a variety of people, too long to list here.

TODO:
bebox still needs work to complete the transition to -renovation.
ofppc still needs a bunch of work, which I will be looking at.
ev64260 still needs to be renovated
amigappc was not attempted.

NOTES:
pmppc was removed as an arch, and moved to a evbppc target.
 1.15  04-Aug-2007  tsutsui branches: 1.15.2; 1.15.4;
Make clockintr() return 1 since it's always handled so that
clock interrupt is properly acounted by evcnt(9) in isa_irq.S.
 1.14  08-Mar-2007  matt branches: 1.14.2; 1.14.10; 1.14.12; 1.14.14; 1.14.16; 1.14.18;
Clean the bitrotting ofw code. Don't export export the underlying irq
dispatch mechanism to the rest of the kernel; they don't need to know.
Nuke IRQSTATS entirely.

XXX ofwgencfg_clock needs to taught about timecounters
 1.13  13-Sep-2006  gdamore branches: 1.13.4; 1.13.6; 1.13.10;
Convert shark to timecounters. Tested by numerous folks, ok christos@,
martin@.
 1.12  12-Sep-2006  gdamore ANSIfy & KNF.
 1.11  05-Sep-2006  tsutsui branches: 1.11.2;
Add __insn_barrier() to avoid too aggressive optimization by gcc4.
GENERIC compiled by gcc4 now works on my FUNAI's DNARD.
 1.10  24-Dec-2005  perry branches: 1.10.4; 1.10.8; 1.10.18;
Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete.
 1.9  11-Dec-2005  christos merge ktrace-lwp.
 1.8  03-Jun-2005  scw branches: 1.8.2;
Appease -Wshadow
 1.7  13-Feb-2004  wiz Uppercase CPU, plural is CPUs.
 1.6  07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.5  15-Jul-2003  lukem __KERNEL_RCSID()
 1.4  02-Feb-2003  wiz branches: 1.4.2;
guarantee, not guarentee. Idea from miod@openbsd.
 1.3  05-Oct-2002  chs add missing protos.
 1.2  27-Sep-2002  provos remove trailing \n in panic(). approved perry.
 1.1  10-Feb-2002  thorpej branches: 1.1.2; 1.1.14;
Kill arch/arm32. The last platform supported there, Shark, is now
in arch/shark.

(NOTE: arch/dnard, a premature move to split out the Shark support
code, is going to be deleted. It has bit-rotted.)
 1.1.14.3  10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.1.14.2  23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.1.14.1  10-Feb-2002  jdolecek file clock.c was added on branch kqueue on 2002-06-23 17:41:20 +0000
 1.1.2.3  18-Oct-2002  nathanw Catch up to -current.
 1.1.2.2  28-Feb-2002  nathanw Catch up to -current.
 1.1.2.1  10-Feb-2002  nathanw file clock.c was added on branch nathanw_sa on 2002-02-28 04:11:51 +0000
 1.4.2.4  10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.4.2.3  21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.2.2  18-Sep-2004  skrll Sync with HEAD.
 1.4.2.1  03-Aug-2004  skrll Sync with HEAD
 1.8.2.3  03-Sep-2007  yamt sync with head.
 1.8.2.2  30-Dec-2006  yamt sync with head.
 1.8.2.1  21-Jun-2006  yamt sync with head.
 1.10.18.1  16-Sep-2006  rpaulo Pull up following revision(s) (requested by tsutsui in ticket #164):
sys/arch/shark/isa/clock.c: revision 1.11
Add __insn_barrier() to avoid too aggressive optimization by gcc4.
GENERIC compiled by gcc4 now works on my FUNAI's DNARD.
 1.10.8.1  14-Sep-2006  yamt sync with head.
 1.10.4.1  09-Sep-2006  rpaulo sync with head
 1.11.2.1  18-Nov-2006  ad Sync with head.
 1.13.10.1  03-Sep-2007  wrstuden Sync w/ NetBSD-4-RC_1
 1.13.6.1  12-Mar-2007  rmind Sync with HEAD.
 1.13.4.1  28-Aug-2007  liamjfoy Pull up following revision(s) (requested by tsutsui in ticket #844):
sys/arch/shark/isa/isa_irq.S: revision 1.8
sys/arch/shark/isa/clock.c: revision 1.15
Make clockintr() return 1 since it's always handled so that
clock interrupt is properly acounted by evcnt(9) in isa_irq.S.

In irq_setmasks(), refer spl_masks[current_spl_level] directly
rather than spl_mask which is a saved value in splraise() and
splx() functions because the latter one is not always sync'ed with
current_spl_level and interrupt state could be mangled.
Okay'ed by chris@, and should close PR port-shark/22355.
 1.14.18.1  09-Aug-2007  jmcneill Sync with HEAD.
 1.14.16.1  26-Dec-2007  rjs Sync with HEAD.
 1.14.14.1  15-Aug-2007  skrll Sync with HEAD.
 1.14.12.1  07-Aug-2007  matt Sync with HEAD.
 1.14.10.1  03-Oct-2007  garbled Sync with HEAD
 1.14.2.1  20-Aug-2007  ad Sync with HEAD.
 1.15.4.1  06-Nov-2007  matt sync with HEAD
 1.15.2.1  01-Jan-2008  chris Sync with HEAD.
 1.16.84.1  09-Jul-2016  skrll Sync with HEAD
 1.16.64.1  03-Dec-2017  jdolecek update from HEAD
 1.17.18.1  10-Jun-2019  christos Sync with HEAD
 1.17.16.1  06-Sep-2018  pgoyette Sync with HEAD

Resolve a couple of conflicts (result of the uimin/uimax changes)

RSS XML Feed