Ben Gras [Tue, 7 Jun 2011 12:48:31 +0000 (14:48 +0200)]
changes for detecting and building for clang/binutils elf
and minor fixes:
. add ack/clean target to lib, 'unify' clean target
. add includes as library dependency
. mk: exclude warning options clang doesn't have in non-gcc
. set -e in lib/*.sh build files
. clang compile error circumvention (disable NOASSERTS for release builds)
Thomas Cort [Tue, 7 Jun 2011 12:46:18 +0000 (12:46 +0000)]
/etc/group: add 'games' group
Several pkgsrc packages under the games category won't install
without a games group. This change adds the group with gid 13,
the default games gid on NetBSD.
Thomas Cort [Mon, 6 Jun 2011 14:31:20 +0000 (14:31 +0000)]
libarchive: fix bad timestamp bug caused by bit shift.
The file timestamps in archives created by libarchive all had
dates in the year 2038. It was caused by a bit shift in
archive_write_set_format_ustar which shifted 1 instead of 1ull.
Tomas Hruby [Fri, 6 May 2011 15:41:14 +0000 (17:41 +0200)]
PCI - do not panic when ACPI cannot map bridges
- when ACPI does not find mappings for pci brdiges, do no panic,
only report a warning and continue to a fallback which uses
only the root bus IRQ routing table. Fail only if that is not
present.
Thomas Veerman [Thu, 21 Apr 2011 13:18:00 +0000 (13:18 +0000)]
Make test40 behave
Make test40 behave better. It should create its own subdirectory to
conduct its tests and should not write to /tmp. Also, the master-slave
terminal pair it tries to open might be in use; it should try to obtain
another pair. These changes allow the test to be run multiple times
simultaneously from different paths (to test select() more intensively).
Kernel: try_async/try_one fixes
- skip processes that are not asynsending to the target
- do not clear whole asynsend table upon IPC permission error
- be more accepting when one table entry is bogus later on
Thomas Veerman [Wed, 13 Apr 2011 13:25:34 +0000 (13:25 +0000)]
Clean up and fix multiple bugs in select:
- Remove redundant code.
- Always wait for the initial reply from an asynchronous select request,
even if the select has been satisfied on another file descriptor or
was canceled due to a serious error.
- Restart asynchronous selects if upon reply from the driver turns out
that there are deferred operations (and do not forget we're still
interested in the results of the deferred operations).
- Do not hang a non-blocking select when another blocking select on
the same filp is still blocking.
- Split blocking operations in read, write, and exceptions (i.e.,
blocking on read does not imply the write will block as well).
- Some loops would iterate over OPEN_MAX file descriptors instead of
the "highest" file descriptor.
- Use proper internal error return values.
- A secondary reply from a synchronous driver is essentially the same
as from an asynchronous driver (the only difference being how the
answer is received). Merge.
- Return proper error code after a driver failure.
- Auto-detect whether a driver is synchronous or asynchronous.
- Remove some code duplication.
- Clean up code (coding style, add missing comments, put all select
related code together).
Server/driver protocols: no longer allow third-party copies.
Before safecopies, the IO_ENDPT and DL_ENDPT message fields were needed
to know which actual process to copy data from/to, as that process may
not always be the caller. Now that we have full safecopy support, these
fields have become useless for that purpose: the owner of the grant is
*always* the caller. Allowing the caller to supply another endpoint is
in fact dangerous, because the callee may then end up using a grant
from a third party. One could call this a variant of the confused
deputy problem.
From now on, safecopy calls should always use the caller's endpoint as
grant owner. This fully obsoletes the DL_ENDPT field in the
inet/ethernet protocol. IO_ENDPT has other uses besides identifying the
grant owner though. This patch renames IO_ENDPT to USER_ENDPT, not only
because that is a more fitting name (it should never be used for I/O
after all), but also in order to intentionally break any old system
source code outside the base system. If this patch breaks your code,
fixing it is fairly simple:
- DL_ENDPT should be replaced with m_source;
- IO_ENDPT should be replaced with m_source when used for safecopies;
- IO_ENDPT should be replaced with USER_ENDPT for any other use, e.g.
when setting REP_ENDPT, matching requests in CANCEL calls, getting
DEV_SELECT flags, and retrieving of the real user process's endpoint
in DEV_OPEN.
The changes in this patch are binary backward compatible.
Thomas Veerman [Fri, 8 Apr 2011 15:23:12 +0000 (15:23 +0000)]
Enable a process to find out what the error code was when delivery of an
asynchronous message resulted in an error.
The model here is that:
- Iff a sender wishes to be notified, the sender MUST check for errors
BEFORE sending another asynchronous message.
The reason is that in order to remember the error code, we can't clean up
the message table and hence we risk running out of table space. This is
less of a problem when the sender enables notifications only for errors.
Thomas Veerman [Fri, 8 Apr 2011 15:14:48 +0000 (15:14 +0000)]
Enable sending a notification when sending of an asynchronous message was
completed (successfully or not). AMF_NOTIFY_ERR can be used if the sender
only wishes to be notified in case of an error (e.g., EDEADSRCDST). A new
endpoint ASYNCM will be the sender of the notification.
Tomas Hruby [Thu, 7 Apr 2011 07:44:27 +0000 (07:44 +0000)]
LWIP - Fix for dhcpd broadcast to work after boot
Dhcp only works if devices are configured with a broadcast source
address at the begining as it currently uses raw ip sockets and the
sockets sets the source address. It is a quick hack and proper hdcpd
fix is preferable
Tomas Hruby [Thu, 7 Apr 2011 07:44:17 +0000 (07:44 +0000)]
LWIP - dhcpd --lwip
A sort of quick hack for dhcpd to work as a client with lwip server.
- The functionality is not changed unless --lwip switch is supplied.
dhcpd does not use broadcast udp sockets but some sort of raw
sockets and changes their behavior during their life by ioctls.
- I thought there is no need to polute lwip just to make dhcp client
work. Instead I decided to twist the client a little bit.
- It is so far the only big collision I found between inet and lwip.
Tomas Hruby [Thu, 7 Apr 2011 07:43:03 +0000 (07:43 +0000)]
LWIP - udp_io_hdr.h
lwip server needs to include struct udp_io_hdr but must not include
struct udp-hdr as it conflicts with its internal type. So it is split
into to files now.
VFS: bugfixes for handling block-special files:
- on driver restarts, reopen devices on a per-file basis, not per-mount
- do not assume that there is just one vnode per block-special device
- update block-special files in the uncommon mounting success paths, too
- upon mount, sync but also invalidate affected buffers on the root FS
- upon unmount, check whether a vnode is in use before updating it
Gianluca Guida [Tue, 22 Mar 2011 13:47:35 +0000 (13:47 +0000)]
Add libminlib for NBSD libc compilation.
This library includes various random and minix-specific functions
included in the Minix libc. Most of them should be part of libsys,
and in general it would be nice to extinguish this library over
time.
Thomas Veerman [Fri, 18 Mar 2011 10:29:54 +0000 (10:29 +0000)]
- Refactor mthread structure fields to prevent name clashes
- Remove sanity checks for initialized mutexes and condition variables. This
significantly boosts performance. The checks can be turned back on by
compiling libmthread with MTHREAD_STRICT. According to POSIX operations on
uninitialized variables are a MAY fail if, therefore allowing this
optimization.
- Test59 has to be accommodated to the lack of sanity checks on uninitialized
variables in the library. It specifically tests for them and will run into
segfaults when the checks are absent in the library.
- Fix a few bugs related to the scheduler
- Do some general code cleanups
Ben Gras [Thu, 10 Mar 2011 12:54:58 +0000 (12:54 +0000)]
release.sh: explicitly use the pkgin pkg_install pkg_add
. when switching from the base pkg_install to the pkgin pkg_install,
the version number changed, causing a compatability problem if the
old base system binary was inadvertently left behind.
. this change checks for that situation by specifically invoking
the pkgin instance of pkg_install and telling the user to install
it if it doesn't exist.
Gianluca Guida [Fri, 4 Mar 2011 23:15:48 +0000 (23:15 +0000)]
Various fixes for NBSD include.
This patch include various fixes to NBSD includes.
- unistd.h: Avoid different linkages on non-_NETBSD_SOURCE
compilation;
- stdlib.h: remove devname declaration.
- sys/select.h: Add _MINIX specific flags.
- limits.h: Add SYMLOOP_MAX and SYMLINK_MAX
- time.h: Fix CLOCKS_PER_SEC and remove BSD's timer_t, as it
confuses minix own specific timers.
- utmp.h: Set Minix-specific paths and use Minix utmp format.
- param.h: Do not set BSD4_4, as this mostly means sa_len in
struct sock_addr.
- arch/i386/include/param.h: include <machine/vmparam.h> to
add PAGE_SIZE and related macros, defined round_page() and
trunc_page() for minix compatibility.
- dirent.h: remove DIRBLKSIZ and fix d_ino/d_fileno.
- sys/dir.h: ADD from existing includes and edit include
conditions.
- sys/dirent.h: include <minix/dirent.h>, fix d_ino/d_fileno.
- sys/fd_set.h: set default FD_SETSIZE at __MINIX_OPENMAX, as
the default NetBSD value is too big and cause vfs to return
an error.
- sys/cdefs.h: Always include <minix/ansi.h>
- minix/paths.h: Add Minix-specific paths.
- minix/dirent.h: ADD, keep only "direct" and "flex"definitions.
- minix/types.h: include <minix/ansi.h>
Gianluca Guida [Fri, 4 Mar 2011 22:37:43 +0000 (22:37 +0000)]
Sync NBSD libc errno.h with minix errno.h
This patch fixes some wrong error code number in nbsd libc's sys/errno.h
and adds new ones.
As in NetBSD the errno.h is used to automatically generate errlist.c array,
EBADCPU set to 1000 to be a bit too large, so we instruct the awk script
to stop at EDEADEPT (ELAST).
Gianluca Guida [Fri, 4 Mar 2011 22:31:31 +0000 (22:31 +0000)]
Fix stat, add fstat and other NBSD libc fixes.
This patch changes the NBSD libc stat implemenation and adds
fstat (and headers), taken from current libc.
It also adds weaks alias to functions in the resolver that
were removed from public use in NetBSD but that are still
used by Minix, and fixes a NetBSD non-REENTRANT bug in
in gen/initdir.c.
Gianluca Guida [Thu, 3 Mar 2011 16:41:19 +0000 (16:41 +0000)]
mk scripts: add flag for compiling with nbsd libc.
This patch changes the system mk scripts to enable compilation
of programs using the BSD make system to compile with the new
libc.
In details, it does the following:
- it always defines the __MINIX make variable. This can be used,
in porting applications, to specialize Makefiles for Minix.
- If the environment variable NBSD is set to something different
than 'no' and if the compiler is not ack, set NBSD_LIBC to 'yes'.
This will set the destination lib directory to '/usr/netbsd/lib'
and set up CPPFLAGS and LDFLAGS to use new libc's includes and
library directory.
Gianluca Guida [Thu, 3 Mar 2011 16:39:02 +0000 (16:39 +0000)]
Move even more includes to common/include.
This patch moves more includes (most of them, to tell the truth) to
common/include directory. This completes the list of includes needed
to compile current trunk with the new libc (but to do that you need
more patches in queue).
This patch also contains some modification (for compilation with new
headers) to the common includes under __NBSD_LIBC, the define used
in mk script to specialize compilation with new includes.