Commit Graph

217 Commits

Author SHA1 Message Date
agc aad01611e7 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22364, verified by myself.
2003-08-07 16:26:28 +00:00
fvdl d5aece61d6 Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
2003-06-29 22:28:00 +00:00
simonb 7aa3dc6d45 Restore parentheses around return value that were removed with the
previous commit.
2003-06-29 14:09:21 +00:00
darrenr 960df3c8d1 Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records.  The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V
2003-06-28 14:20:43 +00:00
martin d505b18964 Make sure to include opt_foo.h if a defflag option FOO is used. 2003-06-23 11:00:59 +00:00
bsh 4b87783212 in cominit(), turn on UUE bit in IER register if it is PXA2x0's
built-in UART.
2003-06-18 04:35:23 +00:00
simonb 83619b47f3 Wrap some long lines. 2003-06-15 01:34:34 +00:00
thorpej 0eff671820 Also pass a type argument to comcnattach() and com_kgdb_attach().
comspeed() (and thus cominit()) may need this information.
2003-06-14 17:01:06 +00:00
thorpej 5ae120da7b Introduce a new "type" field in the softc which is used to indicate
the general UART type.  Currently, we have "normal", "hayesp" and
"pxa2x0" types.  Replace the corresponding hw flags with the new type
values.
2003-06-14 16:25:52 +00:00
scw 5eb709747b Add support, via a kernel config file option, for the 16550-compatible
com ports found on Intel PXA2x0 processors.

Re-arrange the code which detects the FIFO configuration to defer
printing until _after_ com_fifo is cleared. Some supposedly compatible
chips clear the Tx/Rx FIFOs when this happens, resulting in previous
output being lost.
2003-06-05 13:40:38 +00:00
fvdl 385c785fd2 Inialize sc_tty->t_dev early for serial console, so that cn_check_magic
will match in the case of a break before the console was opened for the
first time. Makes BREAKing into DDB work (again) as soon as interrupts
are enabled.
2003-05-18 15:10:08 +00:00
briggs 742c5dbd3a Allow the console to be used for kgdb if both DDB and KGDB are defined. 2003-04-28 02:46:09 +00:00
gson c8da8f2398 Ignore input when the port is not open. This change is functionally
identical to the patch in kern/6502 (which is hereby fixed), but
modelled after the corresponding fix to the 8530 driver in
z8530tty.c revision 1.60 to maintain consistency with that driver.
2003-04-21 03:43:18 +00:00
simonb 1ff45ded4f Fix some white-space niggles. 2003-03-14 02:21:01 +00:00
matt 7109fe9012 Add cn_halt and cn_flush entries to consdevs. (needed for dma-only console
devices).
2003-03-06 00:38:26 +00:00
thorpej 749715f6ee Use aprint_*(). 2003-01-31 00:26:25 +00:00
thorpej 1cba452d86 Fix signed/unsigned comparison warnings. 2002-11-07 08:02:09 +00:00
jdolecek e0cc03a09b merge kqueue branch into -current
kqueue provides a stateful and efficient event notification framework
currently supported events include socket, file, directory, fifo,
pipe, tty and device changes, and monitoring of processes and signals

kqueue is supported by all writable filesystems in NetBSD tree
(with exception of Coda) and all device drivers supporting poll(2)

based on work done by Jonathan Lemon for FreeBSD
initial NetBSD port done by Luke Mewburn and Jason Thorpe
2002-10-23 09:10:23 +00:00
gehenna 77a6b82b27 Merge the gehenna-devsw branch into the trunk.
This merge changes the device switch tables from static array to
dynamically generated by config(8).

- All device switches is defined as a constant structure in device drivers.

- The new grammer ``device-major'' is introduced to ``files''.

	device-major <prefix> char <num> [block <num>] [<rules>]

- All device major numbers must be listed up in port dependent majors.<arch>
  by using this grammer.

- Added the new naming convention.
  The name of the device switch must be <prefix>_[bc]devsw for auto-generation
  of device switch tables.

- The backward compatibility of loading block/character device
  switch by LKM framework is broken. This is necessary to convert
  from block/character device major to device name in runtime and vice versa.

- The restriction to assign device major by LKM is completely removed.
  We don't need to reserve LKM entries for dynamic loading of device switch.

- In compile time, device major numbers list is packed into the kernel and
  the LKM framework will refer it to assign device major number dynamically.
2002-09-06 13:18:43 +00:00
simonb 21ffe19c1b Don't name parameters in a function declaration. 2002-07-29 05:57:16 +00:00
simonb b8f11b739f ANSIfy, KNF. 2002-07-29 05:54:09 +00:00
christos db29511727 PR/16058: Tero Kivinen: Don't free rbuf or detach tty if rbuf allocation
failed during attach phase.
2002-04-13 17:05:16 +00:00
thorpej ff7306cf44 * Add a new hwflag, COM_HW_NO_TXPRELOAD, which tells comstart() to
not pre-load the chip's Tx buffer, but instead waits for the Tx Ready
  interrupt to transmit the first chunk of data.
* On the IOP310, set COM_HW_NO_TXPRELOAD, rather than COM_HW_TXFIFO_DISABLE.

This solves the "UART hangs" problem on the Npwr in a nicer way (i.e. we
get to use the FIFO, whee).  The COM_HW_NO_TXPRELOAD happens to match the
Linux 16550 driver's Tx algorithm, and the "UART hang" was never observed
on the Npwr running Linux.

Eventually, we might want to eliminate the COM_HW_NO_TXPRELOAD, and simply
always use its algorithm.  But it should be tested on more 16x50 variants
before we do that.

Kudos to Valeriy Ushakov <uwe@netbsd.org> for pointing out this solution
(which also happens to fix the stray UART interrupt issue on the Krups
Javastation), and to Allen Briggs <briggs@netbsd.org> for experimenting
with various methods of fixing this.
2002-04-12 19:32:30 +00:00
atatat 31144d9976 Convert ioctl code to use EPASSTHROUGH instead of -1 or ENOTTY for
indicating an unhandled "command".  ERESTART is -1, which can lead to
confusion.  ERESTART has been moved to -3 and EPASSTHROUGH has been
placed at -4.  No ioctl code should now return -1 anywhere.  The
ioctl() system call is now properly restartable.
2002-03-17 19:40:26 +00:00
lukem 99bccc3cab - pull in opt_kgdb.h where necessary
- replace opt_kgdb_machdep.h with opt_kgdb.h
- defparam opt_kgdb.h:
	KGDB_DEV KGDB_DEVNAME KGDB_DEVADDR KGDB_DEVRATE KGDB_DEVMODE
- move from opt_ddbparam.h to opt_ddb.h:
	DDB_FROMCONSOLE DDB_ONPANIC DDB_HISTORY_SIZE DDB_BREAK_CHAR SYMTAB_SPACE
- replace KGDBDEV with KGDB_DEV
- replace KGDBADDR with KGDB_DEVADDR
- replace KGDBMODE with KGDB_DEVMODE
- replace KGDBRATE with KGDB_DEVRATE
- use `9600' instead of `0x2580' for 9600 baud rate
- use correct quotes for  options KGDB_DEVNAME="\"com\""
- use correct quotes for  options KGDB_DEV="17*256+0"
- remove unnecessary dependancy on Makefile for kgdb_stub.o
- minor whitespace cleanup
2001-11-20 08:43:19 +00:00
lukem 2565646230 don't need <sys/types.h> when including <sys/param.h> 2001-11-15 09:47:59 +00:00
lukem a4bae8b066 add/cleanup RCSID 2001-11-13 13:14:31 +00:00
fvdl 7812d678d8 Initialize the cn_magic goo for kgdb (bah, that should really not
be necessary).
2001-11-05 21:39:24 +00:00
briggs 5301d28a1c Patch to handle odd behavior from exar ST16C1550 UART. It does not set
IIR_NOPEND if the TXRDY condition is true.  Apparently, other chips do
not take TXRDY into account in the IIR_NOPEND case.

Also remove useless assignment (iir = IIR_NOPEND;) in one case.

No response from patch posted on tech-kern 29Aug2001.
2001-09-17 02:47:13 +00:00
enami 97e7cd9cf9 For hayes esp card, set prescaler if specified rate is grater than 115200. 2001-08-27 14:27:01 +00:00
simonb dc0e4c0679 Cosmetic cleanups:
- cominit() is local to com.c, remove prototype from comvar.h.
  - Don't prototype comstop(), cdev_decl(com) does this.
  - Don't use a block device switch table declaration(!).
  - No need to include "com.h".
2001-08-22 12:44:10 +00:00
uwe 35e011d31b Convert to use cnmagic(9). Unifdef DDB and DDB_BREAK_CHAR.
While I'm here, s/ungetc/readahead/ in com_common_* because that's
what it _really_ is, "ungetc" is a very confusing name.
2001-06-20 03:07:25 +00:00
lukem d84d2c6c85 add missing #include "opt_kgdb.h" 2001-05-30 15:24:23 +00:00
scw 2963ff5c58 Add `l_poll' to `struct linesw' and provide an xxxpoll() entry point
in each tty driver to indirect through it.

This allows tty line-disciplines to handle poll(2) system calls.
2001-05-02 10:32:08 +00:00
thorpej 45de366b2e Rename __GENERIC_SOFT_INTERRUPTS to __HAVE_GENERIC_SOFT_INTERRUPTS,
and place the definition in <machine/types.h>.  This can now be used
as a flag to indicate whether or not <machine/intr.h> can be included
to get the generic soft interrupt API.
2001-01-14 23:50:28 +00:00
sommerfeld acc196c4a9 Initialize ring buffer pointers when the ring buffer is allocated.
(comsoft() can be invoked before comopen() on serial consoles; a character
received before the console is opened "for real" can result in a fatal trap
unless the ring buffer pointers are initialized early)
2000-11-18 15:46:23 +00:00
eeh 2a860a3de9 Adapt to the new line discipline scheme. 2000-11-01 23:54:57 +00:00
sommerfeld 91178eae70 Add missing '&& defined(COM_MPLOCK)' 2000-09-26 14:12:42 +00:00
sommerfeld 6a71867356 Add `COM_MPLOCK' option to use a device-instance-specific spinlocks
when running at splserial().  This is a temporary measure (until
there's a MP-safe interrupt handling structure); until then, it should
be used when MULTIPROCESSOR and IPL_SERIAL > IPL_SCHED.
2000-09-23 17:17:11 +00:00
eeh d651adf44a paddr_t -> bus_addr_t. 2000-09-22 14:46:38 +00:00
eeh 56cf963264 Support for SPARC machines with `su' devices. 2000-09-21 23:27:32 +00:00
toshii faf55ac40c Change tiocm_to_{com,zs}'s second argument to u_long to match with
the type in their caller.
2000-09-17 22:07:39 +00:00
sommerfeld 8f5586c98f Avoid calling tsleep when running above splhigh() 2000-08-18 13:22:39 +00:00
jeffs e97c2066ab Add options DDB_BREAK_CHAR. This overrides break on the serial console
break character with the supplied one.  This is useful for cases where
break is hard to generate, or you are connected to a PC that "sends"
breaks when power cycled.  For this mode in com, interpret break char
in the polling section, which allows entry into the debugger before
the tty is opened.  Only supported in the com driver currently.
2000-08-03 00:30:47 +00:00
thorpej cb450cc444 Use device_lookup(). 2000-07-06 01:47:34 +00:00
thorpej b29178acf3 Remove unnecessary junk on #undef line that some C preprocessors
get cranky about.
2000-05-03 19:19:04 +00:00
simonb 9e370d4402 Delete redundant decl of com_attach_subr(), it's in comvar.h. 2000-03-30 02:04:30 +00:00
thorpej fc96443d15 New callout mechanism with two major improvements over the old
timeout()/untimeout() API:
- Clients supply callout handle storage, thus eliminating problems of
  resource allocation.
- Insertion and removal of callouts is constant time, important as
  this facility is used quite a lot in the kernel.

The old timeout()/untimeout() API has been removed from the kernel.
2000-03-23 07:01:25 +00:00
thorpej a183d34f04 - Implement cnbell() -- ring the console bell. The cn_bell entrypoint
is optional.
- Add cn_bell to statically allocated consdevs as appropriate.
2000-03-06 21:36:05 +00:00
jonathan e9a4467c58 Fix thinko in previous revision: it wouldn't catch deassert.
Revert the code inside the new test to the previous-but-one revision.
2000-02-07 02:17:18 +00:00