Commit Graph

485 Commits

Author SHA1 Message Date
cegger e2cb85904d bcopy -> memcpy 2009-03-18 17:06:41 +00:00
cegger c363a9cb62 bzero -> memset 2009-03-18 16:00:08 +00:00
cegger 35fb64746b bcmp -> memcmp 2009-03-18 15:14:29 +00:00
cegger df7f595ecd Ansify function definitions w/o arguments. Generated with sed. 2009-03-18 10:22:21 +00:00
he 62db563030 Re-balance parenthesis in a couple of places. 2009-03-17 10:16:55 +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 981d751aa3 ANSIfy, some KNF, misc cosmetics. 2009-03-08 05:25:30 +00:00
tjam 7ffdc72669 Use 8KB buffer for ZLRB_RING_SIZE to prevent overruns 2009-01-28 19:57:37 +00:00
tjam 99752e43b2 Remove sicallback to use the MI softint(9) APIs directly - from Tsutsui 2009-01-28 19:55:51 +00:00
tsutsui 1e5c3b25c8 Replace multi-statement macro using GCC extension `({})' with
static inline functions to avoid possible side effects or confusion.

Tested on TT030 by David Ross and on Falcon by Tuomo Makinen on port-atari.
2009-01-24 02:02:38 +00:00
tsutsui 77938e8d54 Use firm_gettime() to retain compatibility with old firm_event. From amiga. 2009-01-17 05:23:28 +00:00
yamt 70de973662 g/c BUFQ_FOO() macros and use bufq_foo() directly. 2009-01-13 13:33:58 +00:00
tsutsui 7d8d4998c1 Fix broken RCS Id. 2008-12-28 23:00:39 +00:00
tsutsui fd6ad22aed Clear bp->b_oflags (introduced on vmlocking2 merge) before read
rather than calling brelse(9) after read.
Tested by Tuomo Makinen on port-atari.

Should fix pool panics during installation reported by David Ross
on port-atari:
http://mail-index.NetBSD.org/port-atari/2008/11/13/msg000113.html
and actually close PR port-atari/39850.
2008-12-28 03:13:59 +00:00
tsutsui d79dc17147 Sprinkle volatile to bus_space(9) access functions. 2008-12-27 16:14:12 +00:00
he 1c6fe739fe Correct two typos and remove a now-unused variable to make this
build again.
2008-12-18 10:58:17 +00:00
christos 9a5d3f2817 replace bitmask_snprintf(9) with snprintb(3) 2008-12-16 22:35:21 +00:00
abs b53939be13 To be safe, do not use DMA for Falcon - from Tuomo 2008-11-15 21:35:31 +00:00
abs d36d67412b Another fix from Tuomo Makinen - Use brelse() to unbusy bp buffer
to allow user to swap floppy disks when prompted.
2008-11-04 17:08:45 +00:00
abs 7bb734ab12 Move tc_init(&clk_timecounter); to stop the "timecounter:" message
appearing in the middle of the clock0 attach message. Tested by
Tuomo Makinen
2008-11-04 16:43:47 +00:00
abs 87d661967a Cleanup spelling and syntax in a comment 2008-10-29 14:31:01 +00:00
abs eb89868e67 Remove unwanted 'xs->xs_status |= XS_STS_DONE' which caused scsipi_done()
to bail out early.
Found by T. Makinen, and additional confirmation by David Ross
2008-10-28 11:44:14 +00:00
tsutsui 1a160ac866 Specify volatile to some pointers to access DMA registers. 2008-07-20 16:35:27 +00:00
tsutsui 471f4d63c3 No need to specify '&' to get array's address.
No binary changes.
2008-07-20 16:28:24 +00:00
tsutsui b55114eae7 Fix pointer arithmetic botch in rev 1.37. 2008-07-20 16:23:38 +00:00
cegger 947c9ab610 use device_lookup_private to get softc 2008-06-13 08:49:15 +00:00
tsutsui cb09de1924 Use device_private() and device_lookup_privat() to get softc. 2008-06-11 14:35:53 +00:00
martin 3028e483e4 Convert to new 2 clause license 2008-04-29 06:53:00 +00:00
martin ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
cube a27f79f69e Use M_TEMP for allocations instead of the now deceased M_IOCTLOPS. 2008-03-23 15:50:51 +00:00
cube 7aa6248cdf Split device_t and softc for ATA devices, as well as wd(4). Other
cosmetic changes where appropriate.
2008-03-18 20:46:35 +00:00
cube 8ecf8999bf Split the softc from the device_t for all lpt(4) variants and attachments
except the ppbus stuff (which doesn't compile) and ulpt(4) which is
unrelated and can be dealt with separately.

As usual, it comes with related cosmetic changes.
2008-03-07 17:15:51 +00:00
rmind c6186face4 Welcome to 4.99.55:
- Add a lot of missing selinit() and seldestroy() calls.

- Merge selwakeup() and selnotify() calls into a single selnotify().

- Add an additional 'events' argument to selnotify() call.  It will
  indicate which event (POLL_IN, POLL_OUT, etc) happen.  If unknown,
  zero may be used.

Note: please pass appropriate value of 'events' where possible.
Proposed on: <tech-kern>
2008-03-01 14:16:49 +00:00
joerg 732cd3c8a0 Convert Atari to generic TODR and timecounter. 2008-01-08 18:04:15 +00:00
he 75fc209bcf Fix a cv_timedwait() usage after the vmlocking2 merge, and remove
a now-no-longer-used local variable.
2008-01-03 16:06:24 +00:00
joerg c8ad2035a8 Simplify delay based on x86 version. 2008-01-03 01:02:04 +00:00
ad 4a780c9ae2 Merge vmlocking2 to head. 2008-01-02 11:48:20 +00:00
tsutsui b7b9eda05d - add a missing brace in the previous
- print error message on failure to map aux register
2007-12-04 16:36:54 +00:00
tsutsui 704f93353b Apply missed following MI wdc changes to atari's mainbus wdc backend:
- make bus space handles an array for each command register
  http://mail-index.netbsd.org/source-changes/2003/11/27/0036.html
  (note we no longer have to specify stride for wdc after this change)
- add the notion of "shadow register"
  http://mail-index.netbsd.org/source-changes/2004/05/25/0048.html

Problem reported by Alan Hourihane in PR port-amiga/37464.
2007-12-04 15:28:58 +00:00
ad 4b293a84e1 Interrupt handling changes, in discussion since February:
- Reduce available SPL levels for hardware devices to none, vm, sched, high.
- Acquire kernel_lock only for interrupts at IPL_VM.
- Implement threaded soft interrupts.
2007-12-03 15:33:00 +00:00
ad dc26833bb6 - Factor out too many copies of the same bit of tty code.
- Fix another tty signalling/wakeup problem.
2007-11-19 18:51:36 +00:00
joerg d238692c3e Initialise the callbacks for tty.t_rstrt_ch in ttymalloc
as all drivers but Sun/SPARC's kd.c use the same arguments.
Separate callout_reset into callout_schedule and the initial
callout_setfunc using that.
2007-10-18 18:54:56 +00:00
garbled d974db0ada 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.
2007-10-17 19:52:51 +00:00
he 663275b41c Fix typo: in disk_init() call: fd -> sc. 2007-10-17 17:58:56 +00:00
ad 9f56dfa520 Merge brelse() changes from the vmlocking branch. 2007-10-08 18:02:53 +00:00
ad 2af68666da Merge disk init changes from the vmlocking branch. These seperate init /
destroy of 'struct disk' from attach / detach.
2007-10-08 16:41:05 +00:00
ad 66fefd117b It's not a good idea for device drivers to modify b_flags, as they don't
need to understand the locking around that field. Instead of setting
B_ERROR, set b_error instead. b_error is 'owned' by whoever completes
the I/O request.
2007-07-29 12:15:35 +00:00
he 150caa6d8c Adapt to new signature for callout_init(). 2007-07-11 19:13:23 +00:00
ad 88ab7da936 Merge some of the less invasive changes from the vmlocking branch:
- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
2007-07-09 20:51:58 +00:00
tsutsui f343bfa8eb Treat bus_space_handle_t as opaque, and use bus_space_vaddr(9) to
get device address.

XXX: This driver should be rewritten to use bus_space(9) more properly.
2007-03-06 14:45:31 +00:00
tsutsui 35788e9981 - remove volatile from *regkva member in struct grfabs_et_priv
and use temporary variables on register accesses
- also remove volatile from *memkva member in struct grfabs_et_priv
  because it isn't used to refer memory
XXX: I'm not sure if bm->plane should be volatile or not
     but I don't think previous code treats it as volatile anyway.
     (though I'm not sure how compiler handled "volatile caddr_t")
2007-03-06 14:40:25 +00:00
tsutsui 7bad4d945e - change pointers which actually required caddr_t to calculate address
from (void *) to (char *)
- add (char *) cast to appease -Wpointer-arith
2007-03-06 14:15:13 +00:00
tsutsui 46cc919e1f Make TX buffer (uint8_t *) and remove an unnecessary cast. 2007-03-06 14:13:02 +00:00
tsutsui 1f79355c9b Add (char *) cast to appease -Wpointer-arith. 2007-03-06 14:10:07 +00:00
tsutsui bc4a41fd8b Make req_addr (char *) rather than adding an extra cast
since it's used only in this function to calculate buffer address.
2007-03-06 14:07:15 +00:00
tsutsui d319901154 Make io_data (char *) rather than adding an extra cast
since it's used only in this file to calculate buffer address.
2007-03-06 14:03:07 +00:00
he 582dc91458 More fixes after the caddr_t removal.
Mostly cast to char* for pointer arithmetic,
but also one missing indirection, and one "void *v, x;" fix.
2007-03-06 13:54:44 +00:00
christos 53524e44ef Kill caddr_t; there will be some MI fallout, but it will be fixed shortly. 2007-03-04 05:59:00 +00:00
reinoud 43061c75ae Rename the B_XXX flag to B_DEVPRIVATE flag since it was never used for
debugging and its main use is in device drivers. Its used there to signal
that the flagged buffer has a special meaning or should be handled
differently.

OK'd by Bill Sudenmund on tech-kern.
2007-02-15 18:33:26 +00:00
hubertf 142c2a33ba Remove duplicate #includes, patch contributed in private mail
by Slava Semushin <slava.semushin@gmail.com>.

To verify that no nasty side effects of duplicate includes (or their
removal) have an effect here, I've compiled an i386/ALL kernel with
and without the patch, and the only difference in the resulting .o
files was in shifted line numbers in some assert() calls.
The comparison of the .o files was based on the output of "objdump -D".

Thanks to martin@ for the input on testing.
2007-01-24 13:08:11 +00:00
wiz 6919c6578c s/independant/independent/, from Zafer. 2006-11-24 22:04:21 +00:00
elad 65792a0340 More from Matt Fleming:
Adapt to KAUTH_DEVICE_TTY_PRIVSET and KAUTH_DEVICE_TTY_OPEN.
2006-10-01 20:31:49 +00:00
elad e8373398dc Adapt MD code to KAUTH_DEVICE_TTY_OPEN. Patch from Matt Fleming, thanks! 2006-10-01 18:56:21 +00:00
he 4493c76313 Use the common <dev/sun/vuid_event.h> header file instead of maintaining
separate copies in port-specific directories.  Add duplicate include
protection.  Makes the alpha and atari ports build usr.bin/kdump/ again.
2006-08-28 16:41:04 +00:00
mhitch fa97ed2f83 More gcc4 "uninitilized" variables. 2006-08-04 01:45:05 +00:00
ad f474dceb13 Use the LWP cached credentials where sane. 2006-07-23 22:06:03 +00:00
elad 8ccb6c9341 integrate kauth. 2006-05-14 21:55:09 +00:00
skrll a9f4c28a3d Fix a bunch of cast lvalues. 2006-05-10 06:24:02 +00:00
blymn 3c0adb7d99 Make i/o statistics collection more generic, include tape drives and
nfs mounts in the set of devices that statistics will be reported on.
2006-04-14 13:09:05 +00:00
thomas 2f48a02e05 Do not disable access to tseng private registers 2006-03-29 18:05:57 +00:00
thorpej bf53a8ce6f Use device_unit(). 2006-03-26 04:39:40 +00:00
lukem a1f606d3fd Use the SI capitalization for "Hz", "kHz", and "MHz" in comments and strings.
Add a space between numbers and Hz unit.
2006-03-08 23:46:22 +00:00
he 377126348b Remove another instance of the macro triplet SET/CLR/ISSET, now
found in <sys/types.h>.
2006-03-06 18:42:58 +00:00
wiz 5d1e8b2745 Fix some typos. 2006-02-25 02:28:55 +00:00
thorpej 458b3e43f7 Use device_parent(). 2006-02-23 05:37:46 +00:00
dsl 6f0f9f8763 Make almost everything #include <sys/bswap.h> instead of <machine/bswap.h>
The bswap.h and endian.h files are all rather incestuous, but I want to
get the constant folding stuff into one place - sys/bswap.h
2006-01-29 21:42:40 +00:00
bouyer bf1a4d2af5 properly use ata_channel->ch_ndrive:
- initialize it properly in the bus front-ends (all 2, exept in wdc_pcmcia.c
  for the "Sandisk CompactFlash Card" where it's set to 1)
- remplace hardcoded '2' by ata_channel->ch_ndrive in MI IDE drivers.

From Christos Zoulas in kern/32501.
2006-01-16 20:30:18 +00:00
perry 50a256a3a0 __asm__ -> __asm
__const__ -> const
__inline__ -> inline
__volatile__ -> volatile
2005-12-24 23:23:59 +00:00
perry 2d65de2479 bare asm -> __asm 2005-12-24 22:45:33 +00:00
perry 5f1c88d70d Remove leading __ from __(const|inline|signed|volatile) -- it is obsolete. 2005-12-24 20:06:46 +00:00
christos 95e1ffb156 merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
yamt aec75b1cc6 - change the way to specify a bufq strategy. (by string rather than by number)
- rather than embedding bufq_state in driver softc,
  have a pointer to the former.
- move bufq related functions from kern/subr_disk.c to kern/subr_bufq.c.
- rename method to strategy for consistency.
- move some definitions which don't need to be exposed to the rest of kernel
  from sys/bufq.h to sys/bufq_impl.h.
  (is it better to move it to kern/ or somewhere?)
- fix some obvious breakage in dev/qbus/ts.c.  (not tested)
2005-10-15 17:29:10 +00:00
kleink aece7a90fd Change the driver open function's conditional for overriding exclusive tty
use from checking the proc's uid to suser(9), and account for the use of
privileges.  Noted by David Holland in PR kern/31126.
2005-09-06 21:40:37 +00:00
he 5cc5caddf2 Adapt to compiling with -Wshadow and -Wcast-qual, by adding const
qualification in places and renaming a few local variables.
Also adds a couple uses of __UNVOLATILE() to allow passing volatile
variables to functions wanting e.g. caddr_t.
2005-06-04 14:42:36 +00:00
he dfaf8269a3 Remove the unused global variable "baud" because it is causing
shadowing warnings.
2005-06-04 14:31:15 +00:00
he e8576a0a7f Prefix local variables in macros with _, and add a character to
one variable name to avoid a shadowing warning.
2005-06-04 14:30:10 +00:00
jdc bca4709f30 Add some definitions of the (Falcon) IDE register locations and use these
to initialise the wdc register array.

Doesn't make the wdc probe work on the Falcon, but at least the kernel no
longer dies at boot time.
2005-05-10 20:28:35 +00:00
chs bd2d26b450 getitesp() can return NULL, so check for that in iteopen().
pointed out by Michael Hitch.
2005-03-02 08:14:26 +00:00
thorpej df9803ce96 Part 1 of a cleanup pass over the SCSI subsystem. The aim is to name
everything "scsi_*", since we really are talking about the SCSI command
set, ATAPI transport not withstanding.  Improve the names of many structures,
and prepend "SCSI_" onto all SCSI command opcodes.  Place items described
by the SCSI Primary Commands document into scsi_spc.h.
2005-02-21 00:29:06 +00:00
simonb 3cebd9325e White space nit- don't put a space before/after increment/decrement
operators.
2005-02-11 06:21:21 +00:00
he e23b180fd3 Adapt to the change in type of ite_on() -- don't pretend that it returns
a value anymore (return type is now void).
2005-01-23 09:25:52 +00:00
chs ea145b7bd7 use a flag in the softc to indicate if an instance has been configured,
rather than a bit in 32-bit global variable indexed by unit number.
2005-01-19 02:13:02 +00:00
thorpej a974bfe8ce - Use the cmdlen specified in the scsipi_xfer structure. Keying off
the command group ID won't necessarily work for vendor-specific commands.
- Expand the storage in the SC_REQ structure to account for 16-byte commands.
2004-12-07 21:12:42 +00:00
yamt 05f25dcc2a move buffer queue related stuffs from buf.h to their own header, bufq.h. 2004-10-28 07:07:35 +00:00
thorpej 9cc521a148 Move most of wdc_softc into a new atac_softc structure that contains
info common to all types of ATA controllers.
2004-08-20 06:39:37 +00:00
thorpej 4b51cecfc2 - Split the register handles out of struct wdc_channel into a separate
wdc_regs structure, and array of which (indexed per channel) is pointed
  to by struct wdc_softc.
- Move the resulting wdc_channel structure to atavar.h and rename it to
  ata_channel.  Rename the corresponding flags.
- Add a "ch_ndrive" member to struct ata_channel, which indicates the
  maximum number of drives that can be present on the channel.  For now,
  this is always 2.  Add an ATA_MAXDRIVES constant that places an upper
  limit on this value, also currently 2.
2004-08-14 15:08:04 +00:00
thorpej ab20886f7b Don't bother with bits that tell of the presence of optional callbacks;
just check the function pointers for NULL.
2004-08-13 03:12:59 +00:00
he c9a13e2ac5 Include <machine/kbdmap.h> only outside the kernel, as that file
isn't present in that location in the source tree.
2004-05-19 08:44:20 +00:00