dragonfly.git
15 years agoIn xl_list_tx_init_90xB()
Sepherosa Ziehau [Tue, 27 Sep 2005 03:12:55 +0000 (03:12 +0000)]
In xl_list_tx_init_90xB()
- Don't call bzero(), xl_stop() has done it
- Minor style changes

15 years ago- Factor out xl_dma_alloc() from xl_attach()
Sepherosa Ziehau [Tue, 27 Sep 2005 02:41:29 +0000 (02:41 +0000)]
- Factor out xl_dma_alloc() from xl_attach()
- Factor out xl_dma_free() from xl_detach()
- Allocate and deallocate RX/TX descriptor DMA map during device's attaching
  and detaching (i.e. in xl_dma_{alloc, free}()), instead of in xl_stop() and
  xl_list_{rx, tx}_init*().  This brings us:
  1) xl_init()'s failure chance is reduced
  2) In the original code, xl_stop() would destroy TX descriptor DMA map if
     xl_chain.xl_mbuf != NULL, but normally TX descriptor's xl_chain.xl_mbuf
     *is* NULL.  So "ifconfig xl0 down; ifconfig xl0 up" or xl_detach()
     promised TX descriptor DMA map leakage, which is fixed now
- After the above change, xl_list_tx_init*() will not fail, so do not return
  `int' from them.  Adjust their caller accordingly
- Add comment for xl_chain.xl_prev
- Minor style changes

15 years agosetup UpPoll register before installing RX list pointer
Sepherosa Ziehau [Mon, 26 Sep 2005 06:25:10 +0000 (06:25 +0000)]
setup UpPoll register before installing RX list pointer

15 years agocppinternals.texi includes generated gcc-common.texi in .OBJDIR.
YONETANI Tomokazu [Mon, 26 Sep 2005 03:01:46 +0000 (03:01 +0000)]
cppinternals.texi includes generated gcc-common.texi in .OBJDIR.
Let make know it and fix occasional build failure for -jN(N > 1) case.

15 years agogetchar() is void in its prototype.
Jeroen Ruigrok/asmodai [Sun, 25 Sep 2005 20:49:55 +0000 (20:49 +0000)]
getchar() is void in its prototype.

15 years agoAdd iwi (fixes building of LINT).
Sascha Wildner [Sun, 25 Sep 2005 16:05:36 +0000 (16:05 +0000)]
Add iwi (fixes building of LINT).

15 years agoRework Makefile logic so that it actually does what it should.
Simon Schubert [Sun, 25 Sep 2005 15:30:26 +0000 (15:30 +0000)]
Rework Makefile logic so that it actually does what it should.

While here partially sync amd64 with i386.

15 years agoRemove bin/ls from the bootstrap-tools.
Jeroen Ruigrok/asmodai [Sun, 25 Sep 2005 13:07:24 +0000 (13:07 +0000)]
Remove bin/ls from the bootstrap-tools.

15 years agoGet rid of ls and use basic sh/echo constructs.
Jeroen Ruigrok/asmodai [Sun, 25 Sep 2005 13:06:49 +0000 (13:06 +0000)]
Get rid of ls and use basic sh/echo constructs.

15 years agoReplace use of ls with echo and tr.
Jeroen Ruigrok/asmodai [Sun, 25 Sep 2005 12:52:44 +0000 (12:52 +0000)]
Replace use of ls with echo and tr.

15 years agoUse echo instead of ls to test for files, change test logic slightly for
Jeroen Ruigrok/asmodai [Sun, 25 Sep 2005 12:48:46 +0000 (12:48 +0000)]
Use echo instead of ls to test for files, change test logic slightly for
this.

15 years agoAdd usr.bin/stat to bootstrap-tools:
Jeroen Ruigrok/asmodai [Sun, 25 Sep 2005 12:43:58 +0000 (12:43 +0000)]
Add usr.bin/stat to bootstrap-tools:
Make boot2 use stat for getting the filesize instead of ls.

15 years agoReplace FreeBSD mailing list aliases with appropriate ones for some
Sascha Wildner [Sun, 25 Sep 2005 06:09:07 +0000 (06:09 +0000)]
Replace FreeBSD mailing list aliases with appropriate ones for some
DragonFly lists.

15 years agoSync with FreeBSD. This enables 'set -o emacs' by default (for command
Sascha Wildner [Sun, 25 Sep 2005 06:04:52 +0000 (06:04 +0000)]
Sync with FreeBSD. This enables 'set -o emacs' by default (for command
line editing).

15 years ago- in xl_attach(), print xl card type ("90X"/"90XB"), if verbose booting is
Sepherosa Ziehau [Sun, 25 Sep 2005 05:33:32 +0000 (05:33 +0000)]
- in xl_attach(), print xl card type ("90X"/"90XB"), if verbose booting is
  enabled
- in xl_start() and xl_start_90xB(), do BUS_DMASYNC_PREWRITE after *all* of
  the CPU memory updating is finished
- use UpPoll feature for XL_TYPE_905B typed card.  this can eliminate device
  register accessing during xl_rxeof() thus improving recv performance(*) with
  less CPU overhead
Inspired-by: FreeBSD pci/if_xl.c rev1.58's commit log
(*)
benchmark setting:
1) sephe:xl0 (dev-1.3.6 Sep.24) <----> sephe-test:vr0 (dev-1.3.6 Sep.24)
2) except for the different xl driver, rest part of the kernel running on
   sephe is same
3) xl0 is a <3Com 3c905C-TX Fast Etherlink XL> card, XL_TYPE_905B typed
4) netperf is executed with only "-H <host> -p <port> -t <test type>"

benchmark result:
1) run netperf from sephe-test:vr0
   17.0% (41.30[new xl]/35.28[old xl]) performance boost is observed for
   "TCP STREAM TEST"
2) run netperf from sephe:xl0
   13.6% (7405.79[new xl]/6518.39[old xl]) performance boost is observed for
   "TCP REQUEST/RESPONSE TEST"
3) minor performance boosts are observed in the rest of netperf "TEST"s

# Thank Bill Paul for that detailed commit log

15 years ago* Document the {build,install}world targets instead of just world.
Sascha Wildner [Sun, 25 Sep 2005 04:49:39 +0000 (04:49 +0000)]
* Document the {build,install}world targets instead of just world.

* Add reference to build(7).

* Add references to the DragonFly handbook.

15 years agoFix a memory leak I introduced when I changed the vtb_buffer from
Sascha Wildner [Sat, 24 Sep 2005 14:40:00 +0000 (14:40 +0000)]
Fix a memory leak I introduced when I changed the vtb_buffer from
'vm_offset_t' to 'uint16_t *' in my last commit. This caused the
vtb_buffer never to be free()'d again in sc_vtb_destroy(). Ouchie!

15 years agoClean up a little after removing Buf_GetAll()
Max Okumoto [Sat, 24 Sep 2005 07:38:03 +0000 (07:38 +0000)]
Clean up a little after removing Buf_GetAll()

15 years agoGet rid of Buf_GetAll()
Max Okumoto [Sat, 24 Sep 2005 07:37:38 +0000 (07:37 +0000)]
Get rid of Buf_GetAll()

15 years agoMove OPEN_PAREN, CLOSE_PAREN, OPEN_BRACE, and CLOSE_BRACE into util.h
Max Okumoto [Sat, 24 Sep 2005 07:37:01 +0000 (07:37 +0000)]
Move OPEN_PAREN, CLOSE_PAREN, OPEN_BRACE, and CLOSE_BRACE into util.h
and use them.  This inproves code readablity.

15 years agoRemove Var_Exists() and just use Var_Value() and compare
Max Okumoto [Sat, 24 Sep 2005 07:27:26 +0000 (07:27 +0000)]
Remove Var_Exists() and just use Var_Value() and compare
with NULL.

15 years agoChange prototypes to clearify that the input is an array.
Max Okumoto [Sat, 24 Sep 2005 07:25:57 +0000 (07:25 +0000)]
Change prototypes to clearify that the input is an array.

15 years agoin if_xl.c, xl_detach():
Sepherosa Ziehau [Sat, 24 Sep 2005 03:50:30 +0000 (03:50 +0000)]
in if_xl.c, xl_detach():
- do not use XL_FLAG_ATTACH_MAPPED to test whether xl_stop(), xl_reset() and
  ether_ifdetach() can be performed, use device_is_attached() instead.  this
  can prevent ether_ifdetach() from being called if ether_ifattach() is not
  done yet (e.g. xl_attach() fails before calling ether_ifattch())
- adjust white spaces

in if_xl.c, xl_attach():
- in various busdma operation, use BUS_DMA_WAITOK instead of BUS_DMA_NOWAIT,
  since xl_attach() is already intr safe
- use BUS_DMA_ZERO in bus_dmamem_alloc() instead of calling bzero() afterwards
Suggested-by: joerg
- do not set XL_FLAG_ATTACH_MAPPED in xl_softc.xl_flags
- minor cleanup

in if_xlreg.h
- GC now unused XL_FLAG_ATTACH_MAPPED macro

15 years agodo not build following files:
Sepherosa Ziehau [Sat, 24 Sep 2005 02:50:47 +0000 (02:50 +0000)]
do not build following files:
fromhost.c -- TLI junks
myvsyslog.c -- we have vsyslog(3)
tli.c -- TLI junks
workarounds.c -- compat junks

15 years ago- remove compat junks
Sepherosa Ziehau [Sat, 24 Sep 2005 02:34:11 +0000 (02:34 +0000)]
- remove compat junks
- declare fix_options()
Obtained-from: NetBSD lib/libwrap/tcpd.h rev 1.2, 1.12

- declare hosts_ctl(), as stated in hosts_access(3)

15 years ago* Add braces to while statements and remove the '?' option
Sascha Wildner [Fri, 23 Sep 2005 19:56:32 +0000 (19:56 +0000)]
* Add braces to while statements and remove the '?' option
  in the example.

Noticed by: corecode

15 years agoRemove description of the old release infrastructure.
Sascha Wildner [Fri, 23 Sep 2005 19:47:49 +0000 (19:47 +0000)]
Remove description of the old release infrastructure.

15 years ago* Initialize nlist entries and bump WARNS to 6.
Sascha Wildner [Fri, 23 Sep 2005 18:51:34 +0000 (18:51 +0000)]
* Initialize nlist entries and bump WARNS to 6.

Some cleanup:

* Remove parameter names from prototypes.

* Get rid of '?' option.

15 years agoAdd the wide character files for ncurses.
Jeroen Ruigrok/asmodai [Fri, 23 Sep 2005 09:42:17 +0000 (09:42 +0000)]
Add the wide character files for ncurses.

15 years agoRevert last commit for two reasons:
Jeroen Ruigrok/asmodai [Fri, 23 Sep 2005 07:09:03 +0000 (07:09 +0000)]
Revert last commit for two reasons:

1) Simon had already fixed it
2) Don't do this when just awake

15 years agoFix accidental reversal of assignment for suffix/suffixlen.
Jeroen Ruigrok/asmodai [Fri, 23 Sep 2005 07:03:11 +0000 (07:03 +0000)]
Fix accidental reversal of assignment for suffix/suffixlen.

Noticed by: Kyle Butt

15 years ago- Catch up with rev 1.157 of sys/dev/acpica/acpi.c in FreeBSD:
YONETANI Tomokazu [Fri, 23 Sep 2005 02:28:50 +0000 (02:28 +0000)]
- Catch up with rev 1.157 of sys/dev/acpica/acpi.c in FreeBSD:
    Don't forget to pass shutdown events down to children first now that we
    handle them at the bus level too.
  This should prevent acpi_cpu_idle() from doing something nasty
  in the middle of shutdown procedure(by turning of cpu_cx_count).

- Move prototype for cpu_idle_hook into <machine/md_var.h>.

- In acpi_cpu_shutdown(), use lwkt_cpusync_simple() to synchronize
  CPUs instead of dropping into DDB.

Reported-by: Rumko <rumcic at gmail.com>
15 years agoRe-initialize the interrupt mask on ACPI wakeup. This seems to
Matthew Dillon [Fri, 23 Sep 2005 02:22:48 +0000 (02:22 +0000)]
Re-initialize the interrupt mask on ACPI wakeup.  This seems to
fix a panic/failure on some machines when waking up from sleep mode.

Submitted-by: Johannes Hofmann <Johannes.Hofmann@gmx.de>
15 years agoCorrectly pass arguments. This enables doing e.g.
Simon Schubert [Fri, 23 Sep 2005 00:31:37 +0000 (00:31 +0000)]
Correctly pass arguments.  This enables doing e.g.

wmake -n DESTDIR=/ install

which failed before.

15 years agoAdd declaration of struct tm to suppress a warning.
Simon Schubert [Thu, 22 Sep 2005 23:50:10 +0000 (23:50 +0000)]
Add declaration of struct tm to suppress a warning.

15 years agostyle(9) cleanup
Simon Schubert [Thu, 22 Sep 2005 23:47:14 +0000 (23:47 +0000)]
style(9) cleanup

15 years agoUnbreak basename suffix removal introduced in last commit.
Simon Schubert [Thu, 22 Sep 2005 23:44:55 +0000 (23:44 +0000)]
Unbreak basename suffix removal introduced in last commit.

Submitted-by: Kyle Butt <kylebutt@gmail.com>
15 years agoEnable wide character support in ncurses, since we have it, better make
Jeroen Ruigrok/asmodai [Thu, 22 Sep 2005 11:14:44 +0000 (11:14 +0000)]
Enable wide character support in ncurses, since we have it, better make
use of it.

This also enables the wide character functions for ncurses so that we
actually synchronise the library and header files which the manual pages
we install.

Furthermore reflect the SYSTEM_NAME properly (1.1->1.3.6) and update to
reflect the currently installed compiler suites.

15 years agoMove commandShell from shell.[ch] to job.[ch]
Max Okumoto [Thu, 22 Sep 2005 09:13:38 +0000 (09:13 +0000)]
Move commandShell from shell.[ch] to job.[ch]

15 years agoSuppress kernel message "mfree: m->m_nextpkt != NULL",
Noritoshi Demizu [Thu, 22 Sep 2005 06:45:01 +0000 (06:45 +0000)]
Suppress kernel message "mfree: m->m_nextpkt != NULL",
which is printed by m_free() in kern/uipc_mbuf.c.
Reported-by: Dave Hayes
15 years agoImplement permanent answers to confirmation questions.
Simon Schubert [Thu, 22 Sep 2005 01:49:44 +0000 (01:49 +0000)]
Implement permanent answers to confirmation questions.
This allows the user to enter "always" or "never" at the prompt.

15 years agoPrefer the general purpose m_getl() routine for mbuf allocation.
Jeffrey Hsu [Wed, 21 Sep 2005 21:03:10 +0000 (21:03 +0000)]
Prefer the general purpose m_getl() routine for mbuf allocation.
Remove special case for 2-mbuf chains, which we haven't created
since FreeBSD rev 1.35 to mbuf.h in Nov 1999.

15 years agoMake zalloc() and zfree() non-blocking for ZONE_INTERRUPT zones.
Jeffrey Hsu [Wed, 21 Sep 2005 19:48:05 +0000 (19:48 +0000)]
Make zalloc() and zfree() non-blocking for ZONE_INTERRUPT zones.

15 years agoGive each CPU its own taskqueue thread so per-cpu data can be
Jeffrey Hsu [Wed, 21 Sep 2005 18:58:55 +0000 (18:58 +0000)]
Give each CPU its own taskqueue thread so per-cpu data can be
safely manipulated in taskqueue-defered routines.

15 years agopull changes from gcc34/libstdc++: rename ctype class flags
Simon Schubert [Wed, 21 Sep 2005 00:25:53 +0000 (00:25 +0000)]
pull changes from gcc34/libstdc++: rename ctype class flags

15 years agoFix the function declaration.
Jeroen Ruigrok/asmodai [Tue, 20 Sep 2005 15:00:45 +0000 (15:00 +0000)]
Fix the function declaration.

memchr() has had its second argument as int ever since c90.

15 years agoDocument and order the wlan devices.
Jeroen Ruigrok/asmodai [Tue, 20 Sep 2005 11:55:42 +0000 (11:55 +0000)]
Document and order the wlan devices.

15 years agoActually hook up ipw.
Jeroen Ruigrok/asmodai [Tue, 20 Sep 2005 11:48:23 +0000 (11:48 +0000)]
Actually hook up ipw.

Forgotten since 2005-03-06.

15 years agoActually add a manual page for xe(4).
Jeroen Ruigrok/asmodai [Tue, 20 Sep 2005 11:38:33 +0000 (11:38 +0000)]
Actually add a manual page for xe(4).

Taken from: FreeBSD

15 years agoSetup intr in the last step of uhci_pci_attach().
Sepherosa Ziehau [Tue, 20 Sep 2005 09:06:58 +0000 (09:06 +0000)]
Setup intr in the last step of uhci_pci_attach().

This can (reliably) prevent uhci_intr() from being called before uhci_init()
and child devices's attachment.

Reviewed-and-Approved-by: asmodai
# This shuts up "livelock!" complaining (only during system starting up)
# on my test box, to which a USB ethernet card is attached.

15 years agoPull in sys/types.h if it has not been parsed yet.
Jeroen Ruigrok/asmodai [Tue, 20 Sep 2005 08:42:51 +0000 (08:42 +0000)]
Pull in sys/types.h if it has not been parsed yet.

Tripped over by: Jeremy C. Reed

15 years agocheck pointer for NULL before calling free()
Sepherosa Ziehau [Tue, 20 Sep 2005 07:17:37 +0000 (07:17 +0000)]
check pointer for NULL before calling free()

15 years agoFix the infinite-watchdog timeout problem. the pending_txs count was not
Matthew Dillon [Tue, 20 Sep 2005 01:51:08 +0000 (01:51 +0000)]
Fix the infinite-watchdog timeout problem.  the pending_txs count was not
being reset when the interface was reinitized, even though al lthe packets
in the tx ring are lost by that action.

call pfnInit() at attach time.  This appears to fix the initial watchdog
timeout problem, which was probably occuring because nv_init() was calling
nv_stop() which was making NVidia API calls before actually initializing
the NVidia interface for the first time.

Properly clear OACTIVE in the TX packet callback if the TX ring previously
became full. (freebsd)

Add support for MCP8-11 (FreeBSD)

NOTE: watchdog resets will cause mbufs for packets in the txring to be
lost (this occured before this commit too).

15 years agoFix strmode()'s parameters to reflect the reality it had been in for a long
Jeroen Ruigrok/asmodai [Mon, 19 Sep 2005 21:20:33 +0000 (21:20 +0000)]
Fix strmode()'s parameters to reflect the reality it had been in for a long
time.

Tripped by over: ANSI C conversion and Michael Ray

15 years agoSynchronise with FreeBSD:
Jeroen Ruigrok/asmodai [Mon, 19 Sep 2005 10:14:29 +0000 (10:14 +0000)]
Synchronise with FreeBSD:

Use humanize_number().

15 years agoSynchronise with v1.73:
Jeroen Ruigrok/asmodai [Mon, 19 Sep 2005 10:06:39 +0000 (10:06 +0000)]
Synchronise with v1.73:

Remove from the printfns the assumption that dp->list != NULL.  Even
if there are no entries, these functions may be called to print the
total number of blocks (0) for consistency's sake.

15 years agoBump OpenBSD Id.
Jeroen Ruigrok/asmodai [Mon, 19 Sep 2005 09:44:30 +0000 (09:44 +0000)]
Bump OpenBSD Id.

Synchronise:

v1.6: Use pid_t for cpid.

15 years agoGet rid of the third clause where we can.
Jeroen Ruigrok/asmodai [Mon, 19 Sep 2005 09:34:53 +0000 (09:34 +0000)]
Get rid of the third clause where we can.

15 years agoFix broken comment.
Jeroen Ruigrok/asmodai [Mon, 19 Sep 2005 09:25:15 +0000 (09:25 +0000)]
Fix broken comment.

15 years agoGet rid of the third clause.
Jeroen Ruigrok/asmodai [Mon, 19 Sep 2005 09:20:38 +0000 (09:20 +0000)]
Get rid of the third clause.

Add DragonFly where appropriate.

15 years agoReflect type change and remove third clause.
Jeroen Ruigrok/asmodai [Mon, 19 Sep 2005 09:05:31 +0000 (09:05 +0000)]
Reflect type change and remove third clause.

15 years agoSynchronise with NetBSD:
Jeroen Ruigrok/asmodai [Mon, 19 Sep 2005 09:02:02 +0000 (09:02 +0000)]
Synchronise with NetBSD:

- remove third clause from UCB,
- cast flags to int again after & with DB_FLAGS,
- change mode's type from int to mode_t as it should be nowadays.

15 years agocheck NULL pointer, before free()
Sepherosa Ziehau [Mon, 19 Sep 2005 04:22:15 +0000 (04:22 +0000)]
check NULL pointer, before free()

15 years agoPort rue(4) from FreeBSD:
Sepherosa Ziehau [Mon, 19 Sep 2005 02:53:27 +0000 (02:53 +0000)]
Port rue(4) from FreeBSD:
dev/usb/if_rue.c rev 1.14, 1.20
dev/usb/if_ruereg.h rev 1.3
dev/mii/ruephy.c rev 1.1.4.1
dev/mii/ruephyreg.h rev 1.1.4.1
modules/rue/Makefile rev 1.2

This driver supports:
RealTek RTL8150 based USB ethernet devices
- Melco LUA-KTX
- GREEN HOUSE GH-USB100B
- Billionton ThumbLAN USBKR2-100B

Changes to FreeBSD version:
- use hw.rue as sysctl node instead of hw.usb.rue
- cleanup rue_attach() code path
- RUE_{LOCK, UNLOCK}() ==> crit_{enter, exit}()
- get rid of qdat
- nuke rue_softc.{rue_info, rue_unit}
- use callout_*()
- use m_getcl() instead of MGETHDR() and MCLGET()

Thanks Shunsuke Akiyama <akiyama@FreeBSD.org> and others for rue(4)

Lack of rue(4) in our base was first noticed by swilder,
thanks him for his reminding

Approved-by: dillon
Tested-by: me (with a Billionton ThumbLAN USBKR2-100B)
15 years agoSynchronise with FreeBSD up to and including v1.86.
Jeroen Ruigrok/asmodai [Sun, 18 Sep 2005 18:55:20 +0000 (18:55 +0000)]
Synchronise with FreeBSD up to and including v1.86.

15 years agoSynchronise with FreeBSD:
Jeroen Ruigrok/asmodai [Sun, 18 Sep 2005 18:35:23 +0000 (18:35 +0000)]
Synchronise with FreeBSD:

Treat filenames as multibyte character strings (according to the current
LC_CTYPE setting) when determining which characters are printable.
This is an often-requested feature.

Use wcwidth() to determine the number of column positions a character
takes up, although there are still a few places left where we assume
1 byte = 1 column position, e.g. line-wrapping when handling the -m option.

The error handling here is somewhat more complicated than usual: we do
our best to show what we can of a filename in the presence of conversion
errors, instead of simply aborting.

15 years agoSynchronise with FreeBSD:
Jeroen Ruigrok/asmodai [Sun, 18 Sep 2005 18:01:49 +0000 (18:01 +0000)]
Synchronise with FreeBSD:

Bump Id where needed.

Constify parameters that do not get touched.

Do something sensible if both -h and -k are given.

If we are asked to print the total number of blocks, do so even if we
have no entries to print (either due to an empty directory or an
error).  This makes the -l and -s options more consistent, like
Solaris and (Debian) Linux.  To make this happen, tweak two
optimizations on the second call to display():

- Don't skip display() altogether, even if list == NULL.
- Don't skip the call to the printfn in display() if we
  need to print the total.

Small clean ups and casts.

15 years agoBump FreeBSD Id.
Jeroen Ruigrok/asmodai [Sun, 18 Sep 2005 17:54:48 +0000 (17:54 +0000)]
Bump FreeBSD Id.

15 years agoPartial synch with FreeBSD 1.74:
Jeroen Ruigrok/asmodai [Sun, 18 Sep 2005 16:59:54 +0000 (16:59 +0000)]
Partial synch with FreeBSD 1.74:

Make the first parameter to display() const.

Move the initmax2 assignment a bit down, after jinitmax's malloc() succeeds.

Update the maxblock, maxinode, and maxnlink variables to the current types
and reflect this in the format specifiers.

15 years agoAdd inttypes.h for intmax_t.
Jeroen Ruigrok/asmodai [Sun, 18 Sep 2005 16:43:40 +0000 (16:43 +0000)]
Add inttypes.h for intmax_t.

15 years agoPartial synch with FreeBSD v1.74:
Jeroen Ruigrok/asmodai [Sun, 18 Sep 2005 16:37:56 +0000 (16:37 +0000)]
Partial synch with FreeBSD v1.74:

convert makenines() to a macro.

15 years agoWelcome to 2005:
Jeroen Ruigrok/asmodai [Sun, 18 Sep 2005 16:32:34 +0000 (16:32 +0000)]
Welcome to 2005:

Convert to ANSI C function declarations.

15 years agoRestore the MAXPATHLEN comparison in basename.c, don't forget that strlcpy()
Jeroen Ruigrok/asmodai [Sun, 18 Sep 2005 16:09:45 +0000 (16:09 +0000)]
Restore the MAXPATHLEN comparison in basename.c, don't forget that strlcpy()
returns the size of the *source string* and not destination.

Rework dirname.c as well to a hybrid of the old and new situation due to path
being a potential large source string than we want to compare with to
MAXPATHLEN.
Get rid of the old strncpy() construct though by using strlcpy().

15 years agoRework dirname() with the same logic Joerg introduced for basename():
Jeroen Ruigrok/asmodai [Sun, 18 Sep 2005 15:15:06 +0000 (15:15 +0000)]
Rework dirname() with the same logic Joerg introduced for basename():
using strlcpy() instead of the memcpy().

15 years agoFix one last nit: compare the result of strlcpy() only to see if it is
Jeroen Ruigrok/asmodai [Sun, 18 Sep 2005 14:00:14 +0000 (14:00 +0000)]
Fix one last nit: compare the result of strlcpy() only to see if it is
bigger than MAXPATHLEN.  strlcpy() NUL-terminates the destination string
and thus we are allowed to be equal in length to MAXPATHLEN's value.

15 years agoMove the Ids down to where they should be.
Jeroen Ruigrok/asmodai [Sun, 18 Sep 2005 13:36:11 +0000 (13:36 +0000)]
Move the Ids down to where they should be.

15 years agoUpdate FreeBSD Id and synchronise with FreeBSD:
Jeroen Ruigrok/asmodai [Sun, 18 Sep 2005 13:33:52 +0000 (13:33 +0000)]
Update FreeBSD Id and synchronise with FreeBSD:

Reduce libc.so's memory footprint by lazily allocating memory used internally
by basename() and dirname().

15 years agoFix long standing logic bug in basename() introduced in 1.4.
Jeroen Ruigrok/asmodai [Sun, 18 Sep 2005 13:21:13 +0000 (13:21 +0000)]
Fix long standing logic bug in basename() introduced in 1.4.

We do not want to copy MAXPATHLEN/sizeof(bname) with strlcpy() since that will
happily copy ANY trailing slash, negating the entire pointer arithmatic of
endp and startp above.
Instead, reinstate endp - startp as size parameter to the copy function.
However, normally where a + 1 would be needed to solve the outcome, we now need
+ 2 due to strlcpy() only copying *size - 1*.

15 years agoSynchronise with FreeBSD:
Jeroen Ruigrok/asmodai [Sun, 18 Sep 2005 11:57:33 +0000 (11:57 +0000)]
Synchronise with FreeBSD:

Reduce libc.so's memory footprint by lazily allocating memory used internally
by basename() and dirname().

Furthermore:

Drop sizeof(bname) and replace with MAXPATHLEN since that is what it boils
down to.

15 years agoSynchronise with FreeBSD v1.65:
Jeroen Ruigrok/asmodai [Sun, 18 Sep 2005 11:43:47 +0000 (11:43 +0000)]
Synchronise with FreeBSD v1.65:

Use FALLTHROUGH instead of some hand-rolled alternative.
This allows us to use lint.

15 years agoMake sure err() does not use a NULL format string, this way we at least
Jeroen Ruigrok/asmodai [Sun, 18 Sep 2005 11:40:09 +0000 (11:40 +0000)]
Make sure err() does not use a NULL format string, this way we at least
know what part is failing.

Synchronises with FreeBSD, apparently GCC can complain about it.

15 years agoSynchronise with FreeBSD:
Jeroen Ruigrok/asmodai [Sun, 18 Sep 2005 11:36:08 +0000 (11:36 +0000)]
Synchronise with FreeBSD:

make printlink()'s FTSENT parameter const, it doesn't get modified at all
during the function call, reflect that.

Use the unit_t typedef for the unitp array.

Use u_int for unit_sz as other unsigned integers do.

Cast ilogb()'s return value to u_int to match unit_sz (ilogb() returns an int).

Cast UNIT_MAX to u_int because enum types are int.

15 years agoUpdate FreeBSD Id.
Jeroen Ruigrok/asmodai [Sun, 18 Sep 2005 11:32:19 +0000 (11:32 +0000)]
Update FreeBSD Id.

15 years agols.1: Add y to SYNOPSIS line.
Jeroen Ruigrok/asmodai [Sun, 18 Sep 2005 11:31:08 +0000 (11:31 +0000)]
ls.1: Add y to SYNOPSIS line.

util.c: Update FreeBSD Id and add y to the usage printing.

15 years agoUse warnx() instead of home-rolled fprintf() constructions.
Jeroen Ruigrok/asmodai [Sun, 18 Sep 2005 11:07:38 +0000 (11:07 +0000)]
Use warnx() instead of home-rolled fprintf() constructions.
Update FreeBSD Id.

15 years agoMake len size_t, since strlen() returns a size_t, case i to size_t later
Jeroen Ruigrok/asmodai [Sun, 18 Sep 2005 10:47:59 +0000 (10:47 +0000)]
Make len size_t, since strlen() returns a size_t, case i to size_t later
on to silence a comparison warning.

15 years agoGet rid of the third clause from the UCB license.
Jeroen Ruigrok/asmodai [Sun, 18 Sep 2005 10:39:35 +0000 (10:39 +0000)]
Get rid of the third clause from the UCB license.

15 years agoMove the termwidth declaration over to extern.h, where is make more sense
Jeroen Ruigrok/asmodai [Sun, 18 Sep 2005 10:37:50 +0000 (10:37 +0000)]
Move the termwidth declaration over to extern.h, where is make more sense
grouped with the other terminal declarations.
Also synchronises the source with FreeBSD.

15 years agoSynchronise with FreeBSD:
Jeroen Ruigrok/asmodai [Sun, 18 Sep 2005 10:12:55 +0000 (10:12 +0000)]
Synchronise with FreeBSD:

v1.15: Ensure that suffix matches occur on character boundaries.

15 years agoNo need to prototype main().
Jeroen Ruigrok/asmodai [Sun, 18 Sep 2005 09:45:26 +0000 (09:45 +0000)]
No need to prototype main().

15 years agoUsing the ACPI idle hook while shutting down ACPI during a halt or reboot
Matthew Dillon [Sat, 17 Sep 2005 23:53:47 +0000 (23:53 +0000)]
Using the ACPI idle hook while shutting down ACPI during a halt or reboot
can panic the system.  Restore the original idle hook before initiating the
ACPI shutdown.

Reported-by: =?ISO-8859-2?Q?Toma=BE_Bor=B9tnar?= <tomaz.borstnar@amis.net>
15 years agoToo many windhills in the third party software world to fight them all.
Joerg Sonnenberger [Sat, 17 Sep 2005 14:39:44 +0000 (14:39 +0000)]
Too many windhills in the third party software world to fight them all.
Maybe programmers learn once not to mess with namespaces, but capitulate
for now and prefix the ctype masks with _CTYPEMASK.

15 years agoChange shell.c API to reduce usage of global commandShell.
Max Okumoto [Sat, 17 Sep 2005 11:07:23 +0000 (11:07 +0000)]
Change shell.c API to reduce usage of global commandShell.

15 years agoWith the new FSMID flag scheme we can optimize the update of the chain by
Matthew Dillon [Sat, 17 Sep 2005 08:29:42 +0000 (08:29 +0000)]
With the new FSMID flag scheme we can optimize the update of the chain by
stopping once we hit a namecache node that already has NCF_FSMID set.  Since
the bit is only cleared when a node is 'observed' with [f][l]stat(), or
when it is reclaimed, the result is that high performance I/O's on a node
do not have to update the entire namecache chain to root on each operation.

Basically the idea of the FSMID is to be able to optimally monitor changes
in a filesystem hierarchy.  When we see the FSMID of a node change we know
we have to scan its sub-tree.  But there's no reason to change the FSMID of
the parent node AGAIN while further changes are made to the children AFTER
the original observation if the scan of the sub-tree has NOT YET REACHED
those children.  This is a kind of Einsteinian-observer effect, but it
works!

If on the other hand we are trying to detect changes in a tree by
monitoring an FSMID, but we do not bother to rescan the tree after noting
such a change in a parent node, this optimization will break us.

This is a solution to a problem Joerg Sonnenberger posed with regard to
the detrimental effect that could occur when a high rate of I/O is
performed on a file deep in a directory tree.

15 years agoAdd an argument to vfs_add_vnodeops() to specify VVF_* flags for the vop_ops
Matthew Dillon [Sat, 17 Sep 2005 07:43:12 +0000 (07:43 +0000)]
Add an argument to vfs_add_vnodeops() to specify VVF_* flags for the vop_ops
structure.  Add a new flag called VVF_SUPPORTS_FSMID to indicate filesystems
which support persistent storage of FSMIDs.  Rework the FSMID code a bit
to reduce overhead.

Use the spare field in the UFS inode structure to implement a persistent
FSMID.  The FSMID is recursively marked in the namecache but not adjusted
until the next getattr() call on the related inode(s), or when the vnode
is reclaimed.

15 years agoAdd an option, -y, which displays the 64 bit FSMID for a file or directory.
Matthew Dillon [Sat, 17 Sep 2005 07:08:43 +0000 (07:08 +0000)]
Add an option, -y, which displays the 64 bit FSMID for a file or directory.

15 years agoSplit spinlock.h into spinlock.h and spinlock2.h so we can embed spinlocks in
Matthew Dillon [Fri, 16 Sep 2005 21:50:13 +0000 (21:50 +0000)]
Split spinlock.h into spinlock.h and spinlock2.h so we can embed spinlocks in
other structures/header files without having to bring in a ton of includes.

15 years agoReserve the same amount of space for the spinlock structure whether we are
Matthew Dillon [Fri, 16 Sep 2005 20:55:44 +0000 (20:55 +0000)]
Reserve the same amount of space for the spinlock structure whether we are
SMP or not, so other structures using it do not change size.

15 years agoBump __Dragonfly_version to 130006 (+ slip preview on the file)
Matthew Dillon [Fri, 16 Sep 2005 19:25:03 +0000 (19:25 +0000)]
Bump __Dragonfly_version to 130006 (+ slip preview on the file)

Reminded-by: Joerg Sonnenberger <joerg@britannica.bec.de>
15 years agoAdd -d /cvs to tag update targets.
Matthew Dillon [Fri, 16 Sep 2005 18:50:15 +0000 (18:50 +0000)]
Add -d /cvs to tag update targets.