Commit Graph

2130 Commits

Author SHA1 Message Date
pgoyette
9929afbc35 One more implementation of the quick_{read,write} I2C protocol. Note
that this is currently used only by the I2C_SCAN code (disabled by
default).

XXX Not tested due to lack of hardware.  Reviewed by simon@ and shige@.
2009-04-20 12:11:50 +00:00
mrg
fcc023545e - add new RLIMIT_AS (aka RLIMIT_VMEM) resource that limits the total
address space available to processes.  this limit exists in most other
modern unix variants, and like most of them, our defaults are unlimited.
remove the old mmap / rlimit.datasize hack.

- adds the VMCMD_STACK flag to all the stack-creation vmcmd callers.
it is currently unused, but was added a few years ago.

- add a pair of new process size values to kinfo_proc2{}. one is the
total size of the process memory map, and the other is the total size
adjusted for unused stack space (since most processes have a lot of
this...)

- patch sh, and csh to notice RLIMIT_AS.  (in some cases, the alias
RLIMIT_VMEM was already present and used if availble.)

- patch ps, top and systat to notice the new k_vm_vsize member of
kinfo_proc2{}.

- update irix, svr4, svr4_32, linux and osf1 emulations to support
this information.  (freebsd could be done, but that it's best left
as part of the full-update of compat/freebsd.)


this addresses PR 7897.  it also gives correct memory usage values,
which have never been entirely correct (since mmap), and have been
very incorrect since jemalloc() was enabled.

tested on i386 and sparc64, build tested on several other platforms.

thanks to many folks for feedback and testing but most espcially
chuq and yamt for critical suggestions that lead to this patch not
having a special ugliness i wasn't happy with anyway :-)
2009-03-29 01:02:48 +00:00
martin
bce5c2205a Now that we compile the Atheros HAL from source we pass all the right
flags to the compiler so it obeys the same ABI as the rest of the kernel.
Remove the hacks used to work around the abi differences (using %s7 as
curlwp) intruduced for the binary hal.
2009-03-24 21:36:46 +00:00
cegger
e2cb85904d bcopy -> memcpy 2009-03-18 17:06:41 +00:00
cegger
c363a9cb62 bzero -> memset 2009-03-18 16:00:08 +00:00
dsl
7cc9af7d64 ANSIfy functions with function-pointer arguments 2009-03-16 23:11:09 +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
joerg
f5b0fec0e0 Remove SHMMAXPGS from all kernel configs. Dynamically compute the
initial limit as 1/4 of the physical memory. Ensure the limit is at
least 1024 pages, the old default on most platforms.
2009-03-06 20:31:46 +00:00
cube
ec543a2ce5 Convert the recently introduced awk command to retrieve the value of the
option MODULAR to using %MODULAR%.  While it is now possible to only
request the new version in the affected Makefiles, it is made mandatory for
everybody because I just fixed a bug in config(1) that would not make it
fail in the case of a syntax error in the Makefile template.
2009-02-15 01:58:01 +00:00
apb
6c4fc39a9f Now that "options MODULAR" is handled via defflag, the Makefile
generated by config(1) in the kernel compile directory no longer
contains IDENT=-DMODULAR.  Instead, there's an opt_modular.h file that
might or might not contain "#define MODULAR 1".

Adapt to this by adding an OPT_MODULAR variable to relevant Makefiles,
set via an awk script that parses opt_modular.h.
2009-02-14 16:53:55 +00:00
dogcow
f1b5400fb5 major() and minor() are now int32_t. 2009-01-22 11:01:32 +00:00
pooka
367deb8e0a Use userspace version unless _HARDKERNEL. Otherwise we use atomic
cas to implement spinlocks and spinlocks to implement atomic cas....
which might suck.

Since the userspace version uses ll/sc, which doesn't exist on
R2000/R3000, rump will not work on those platforms.  *snif* (well,
pthread in general AFAICT).
2009-01-12 03:05:10 +00:00
cegger
b4fe900840 adaption for making kgdb_dev a dev_t 2009-01-11 23:20:37 +00:00
rumble
159e3d7ff8 Make this compile. 2009-01-11 19:58:29 +00:00
christos
461a86f9bd merge christos-time_t 2009-01-11 02:45:45 +00:00
ad
12e4db0e90 Update flags to match reality. 2008-12-21 11:48:30 +00:00
christos
9a5d3f2817 replace bitmask_snprintf(9) with snprintb(3) 2008-12-16 22:35:21 +00:00
alc
31f44cb2ed Clean-up makefile stub used to include in the build the binary HAL object 2008-12-11 05:27:42 +00:00
pooka
ee352f3d33 Make kernel_pmap_ptr a const. Requested by steve_martin. 2008-12-10 11:10:17 +00:00
pooka
29d439f898 Make pmap_kernel() a MI macro for struct pmap *kernel_pmap_ptr,
which is now the "API" provided by the pmap module.  pmap_kernel()
remains as the syntactic sugar.

Bonus cosmetics round: move all the pmap_t pointer typedefs into
uvm_pmap.h.

Thanks to Greg Oster for providing cpu muscle for doing test builds.
2008-12-09 20:45:44 +00:00
nakayama
b5158d6d2a No need to dig into mips/conf since mips/conf/Makefile has been removed. 2008-11-27 10:18:08 +00:00
ad
93ea4650a6 dumpsys: don't spew numbers into the log. 2008-11-25 15:51:34 +00:00
tsutsui
1f6333d7e3 <machine/bsd-aout.h> -> <mips/bsd-aout.h>, no MD bits in each port.
(who still has a.out for 4.4BSD pmax or news3400?)
2008-11-24 17:07:19 +00:00
tsutsui
a40510af14 No need to install kern.ldscript since /usr/lkm is gone and
modload(8) no longer uses a linker script.
2008-11-21 11:46:36 +00:00
he
b8ed284744 Only include opt_* headers under _KERNEL_OPT. 2008-11-21 06:57:35 +00:00
ad
92ce8c6a3d Make the emulations, exec formats, coredump, NFS, and the NFS server
into modules. By and large this commit:

- shuffles header files and ifdefs
- splits code out where necessary to be modular
- adds module glue for each of the components
- adds/replaces hooks for things that can be installed at runtime
2008-11-19 18:35:57 +00:00
tsutsui
c5f4f0e1da Fix errors which were hidden in #ifdef COMPAT_09:
- fix a typo in rev 1.43 (ep_setup_stack -> es_setup_stack)
- fix an arg missed on ktrace-lwp merge in rev 1.47

XXX Is it really worth to have COMPAT_09 code on mips?
XXX No mips port in 0.9 and quite few a.out MIPS binaries..
2008-11-19 13:55:00 +00:00
ad
a471d58a44 Remove compat ifdef. 2008-11-15 11:15:22 +00:00
dyoung
90a821d0b5 To fix compilation, consistently use 'cmd' instead of 'command'
for the ioctl command code.  Thanks he@.
2008-11-13 19:44:02 +00:00
ad
5b57d1bcce LKM -> MODULAR 2008-11-13 10:51:23 +00:00
dyoung
de87fe677d *** Summary ***
When a link-layer address changes (e.g., ifconfig ex0 link
02🇩🇪ad:be:ef:02 active), send a gratuitous ARP and/or a Neighbor
Advertisement to update the network-/link-layer address bindings
on our LAN peers.

Refuse a change of ethernet address to the address 00:00:00:00:00:00
or to any multicast/broadcast address.  (Thanks matt@.)

Reorder ifnet ioctl operations so that driver ioctls may inherit
the functions of their "class"---ether_ioctl(), fddi_ioctl(), et
cetera---and the class ioctls may inherit from the generic ioctl,
ifioctl_common(), but both driver- and class-ioctls may override
the generic behavior.  Make network drivers share more code.

Distinguish a "factory" link-layer address from others for the
purposes of both protecting that address from deletion and computing
EUI64.

Return consistent, appropriate error codes from network drivers.

Improve readability.  KNF.

*** Details ***

In if_attach(), always initialize the interface ioctl routine,
ifnet->if_ioctl, if the driver has not already initialized it.
Delete if_ioctl == NULL tests everywhere else, because it cannot
happen.

In the ioctl routines of network interfaces, inherit common ioctl
behaviors by calling either ifioctl_common() or whichever ioctl
routine is appropriate for the class of interface---e.g., ether_ioctl()
for ethernets.

Stop (ab)using SIOCSIFADDR and start to use SIOCINITIFADDR.  In
the user->kernel interface, SIOCSIFADDR's argument was an ifreq,
but on the protocol->ifnet interface, SIOCSIFADDR's argument was
an ifaddr.  That was confusing, and it would work against me as I
make it possible for a network interface to overload most ioctls.
On the protocol->ifnet interface, replace SIOCSIFADDR with
SIOCINITIFADDR.  In ifioctl(), return EPERM if userland tries to
invoke SIOCINITIFADDR.

In ifioctl(), give the interface the first shot at handling most
interface ioctls, and give the protocol the second shot, instead
of the other way around. Finally, let compatibility code (COMPAT_OSOCK)
take a shot.

Pull device initialization out of switch statements under
SIOCINITIFADDR.  For example, pull ..._init() out of any switch
statement that looks like this:

        switch (...->sa_family) {
        case ...:
                ..._init();
                ...
                break;
        ...
        default:
                ..._init();
                ...
                break;
        }

Rewrite many if-else clauses that handle all permutations of IFF_UP
and IFF_RUNNING to use a switch statement,

        switch (x & (IFF_UP|IFF_RUNNING)) {
        case 0:
                ...
                break;
        case IFF_RUNNING:
                ...
                break;
        case IFF_UP:
                ...
                break;
        case IFF_UP|IFF_RUNNING:
                ...
                break;
        }

unifdef lots of code containing #ifdef FreeBSD, #ifdef NetBSD, and
#ifdef SIOCSIFMTU, especially in fwip(4) and in ndis(4).

In ipw(4), remove an if_set_sadl() call that is out of place.

In nfe(4), reuse the jumbo MTU logic in ether_ioctl().

Let ethernets register a callback for setting h/w state such as
promiscuous mode and the multicast filter in accord with a change
in the if_flags: ether_set_ifflags_cb() registers a callback that
returns ENETRESET if the caller should reset the ethernet by calling
if_init(), 0 on success, != 0 on failure.  Pull common code from
ex(4), gem(4), nfe(4), sip(4), tlp(4), vge(4) into ether_ioctl(),
and register if_flags callbacks for those drivers.

Return ENOTTY instead of EINVAL for inappropriate ioctls.  In
zyd(4), use ENXIO instead of ENOTTY to indicate that the device is
not any longer attached.

Add to if_set_sadl() a boolean 'factory' argument that indicates
whether a link-layer address was assigned by the factory or some
other source.  In a comment, recommend using the factory address
for generating an EUI64, and update in6_get_hw_ifid() to prefer a
factory address to any other link-layer address.

Add a routing message, RTM_LLINFO_UPD, that tells protocols to
update the binding of network-layer addresses to link-layer addresses.
Implement this message in IPv4 and IPv6 by sending a gratuitous
ARP or a neighbor advertisement, respectively.  Generate RTM_LLINFO_UPD
messages on a change of an interface's link-layer address.

In ether_ioctl(), do not let SIOCALIFADDR set a link-layer address
that is broadcast/multicast or equal to 00:00:00:00:00:00.

Make ether_ioctl() call ifioctl_common() to handle ioctls that it
does not understand.

In gif(4), initialize if_softc and use it, instead of assuming that
the gif_softc and ifp overlap.

Let ifioctl_common() handle SIOCGIFADDR.

Sprinkle rtcache_invariants(), which checks on DIAGNOSTIC kernels
that certain invariants on a struct route are satisfied.

In agr(4), rewrite agr_ioctl_filter() to be a bit more explicit
about the ioctls that we do not allow on an agr(4) member interface.

bzero -> memset.  Delete unnecessary casts to void *.  Use
sockaddr_in_init() and sockaddr_in6_init().  Compare pointers with
NULL instead of "testing truth".  Replace some instances of (type
*)0 with NULL.  Change some K&R prototypes to ANSI C, and join
lines.
2008-11-07 00:20:01 +00:00
tsutsui
7605567fa0 Wrap #include "opt_sa.h" with #if defined(_KERNEL_OPT)/#endif
since this file is also used for compat_irix.
2008-10-25 10:41:05 +00:00
dyoung
2be1ba83a2 Use aprint_error_dev() instead of printf(). 2008-10-24 22:16:26 +00:00
ad
d1b01a3709 Provide a small inline wrapper for sysent::sy_call() and use it to store
the active syscall description in struct lwp. To be used at some future
point to prevent unloading of modules that provide syscalls, while the
syscalls are in use.
2008-10-21 12:16:58 +00:00
uebayasi
b4f453049e Oops; redo previous. 2008-10-17 00:46:07 +00:00
uebayasi
8922bc6f78 p_smutex was merged into p_lock some time ago. 2008-10-17 00:29:21 +00:00
wrstuden
fc7511b00e Merge wrstuden-revivesa into HEAD. 2008-10-15 06:51:17 +00:00
tsutsui
1a0c6c8f90 Remove advertising clause for UCB in various genassym.cf files,
which were derived from genassym.c in 4.4BSD-Lite2 (or 386BSD).
Closes PR misc/39573.  Approved by martin@.
2008-09-20 18:29:04 +00:00
matt
91d4704c12 Update <machine/ieeefp.h> to use the C99 FE_* definitions instead of the
NetBSD defined ones.  Redefine the NetBSD ones in terms of the C99 ones.
Step 1 to having <fenv.h>
2008-08-05 16:47:41 +00:00
tsutsui
70612e5c54 Remove __weak_alias() for mips3_delay(). It's in mips3_clock.c. 2008-08-03 09:14:28 +00:00
tsutsui
2d4879d193 Add CPU_MIPS_DOUBLE_COUNT to R10K family CPUs and
also remove (unused?) MIPS_NOT_SUPP flag from them.

Problem on R10k O2 is reported by martin@ on port-sgimips.
2008-08-03 00:09:20 +00:00
joerg
52c17c8946 - device/softc split for ath(4) 2008-07-09 19:47:23 +00:00
gmcgarry
8cb6efd4df Add stdargs support for pcc. 2008-06-21 00:56:39 +00:00
cegger
54a1f88f19 fix typo. should compile again. 2008-06-16 08:36:51 +00:00
cegger
27309530b4 use device_lookup_private to get softc 2008-06-13 12:08:01 +00:00
cegger
175e9cfe68 use __array_count 2008-06-13 11:57:08 +00:00
cegger
3d8fe45fc9 use device_lookup_private to get softc 2008-06-11 23:54:45 +00:00
ad
06c343ac94 vm_page: put TAILQ_ENTRY into a union with LIST_ENTRY, so we can use both. 2008-06-04 12:41:40 +00:00
ad
fd089e08cf Remove ref to uvm.page_idle_zero 2008-06-04 11:30:25 +00:00
dyoung
71f2cf5b71 Make this compile again: don't use USBDEVNAME().
While I'm here, use device_t, device_private(), aprint_error_dev().
2008-05-27 21:24:15 +00:00
tsutsui
40f5425d58 Remove all initialization of obsolete ci_divisor_recip in
mips struct cpu_info and related macroes.
The member was prepared for a hack in MD microtime(9) implementation
but it has been superseded by MI timecounter(9).
2008-05-26 15:59:29 +00:00
tsutsui
31d6cdf996 Add simple help messages for MD machine commands on ddb(4).
PR port-mips/38306
2008-05-23 17:01:32 +00:00
martin
5d1469bd77 Backout previous: the license sweep touched these files in error, so
restore the old license.
2008-05-10 15:31:03 +00:00
martin
ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
christos
1a72a1c693 fix signature 2008-04-25 17:39:20 +00:00
ad
284c2b9aef Merge proc::p_mutex and proc::p_smutex into a single adaptive mutex, since
we no longer need to guard against access from hardware interrupt handlers.

Additionally, if cloning a process with CLONE_SIGHAND, arrange to have the
child process share the parent's lock so that signal state may be kept in
sync. Partially addresses PR kern/37437.
2008-04-24 18:39:20 +00:00
drochner
16304febf2 minor fixes for device/softc split, approved by dogcow
(not tested on real hardware yet)
2008-04-03 15:12:43 +00:00
dogcow
50ea53d902 ...and fix my fix to do the proper device_t split. 2008-03-31 03:19:20 +00:00
dogcow
0e06ed5d6e fix device_t split fallout. 2008-03-31 02:42:42 +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
607ead0ef4 Split device_t and softc for all com(4) devices (well, everything that
uses a com_softc backend).  Use proper types and ansify where appropriate.
2008-03-14 15:09:09 +00:00
dyoung
7bbfa300c6 Do not use sc_invalid, it is no more. 2008-03-12 18:08:43 +00:00
dyoung
d347ff7717 Prepare for PMF self-suspension: in the if_stop() methods, clear
IFF_UP and IFF_RUNNING before running the 'disable' step, instead
of after.  Soon I will handle the 'disable' step by calling into
PMF, which may call if_stop(, 0).  Ordinarily, that is harmless.
This change lets the if_stop() routines exit early when they find
on entry that IFF_RUNNING is not set.
2008-03-11 23:58:06 +00:00
dyoung
25cf32ee3d Use device_t and accessors. 2008-03-11 23:19:03 +00:00
dyoung
f612df5fb6 Use PMF_FN_ARGS, PMF_FN_PROTO. 2008-02-29 06:38:28 +00:00
xtraeme
f402cadf9a Remove CTL_MACHDEP_NAMES, it's not used anywhere.
Ok by martin@.
2008-02-27 18:26:15 +00:00
simonb
fa9544ebbf Add entries for MIPS's 24K, 24KE, 34K and 74K cores.
From Alexander Voropay in mail to port-mips@.
2008-02-19 12:15:46 +00:00
simonb
4ffc28b34a Add PrID's for MIPS's 24K, 24KE, 34K and 74K cores.
From Alexander Voropay in mail to port-mips@.
2008-02-19 11:26:40 +00:00
tsutsui
556a6829d8 Backout previous. vr_idle.S no longer depends on assym.h. 2008-02-18 15:21:04 +00:00
joerg
34c8721568 Another assym.h dependency for hpcmips 2008-02-18 13:23:34 +00:00
ad
372461e58e Add aliases for atomic_cas_foo_ni(). 2008-02-10 13:32:14 +00:00
dyoung
2ccede0a9c Start patching up the kernel so that a network driver always has
the opportunity to handle an ioctl before generic ifioctl handling
occurs.  This will ease extending the kernel and sharing of code
between drivers.

First steps:  Make the signature of ifioctl_common() match struct
ifinet->if_ioctl.  Convert SIOCSIFCAP and SIOCSIFMTU to the new
ifioctl() regime, throughout the kernel.
2008-02-07 01:21:52 +00:00
dsl
c2a8c787c3 Remove the 'args' parameter to 'trace_exit()' it is no longer used.
Instead of passing the (un)real system call code and syscall table pointer,
just pass the number of arguments - which is what ktrace really wants.
Ride forthcoming 4.99.53
2008-02-06 22:12:39 +00:00
tsutsui
3bf45f63f8 Avoid using division ops in delay(9). 2008-01-31 17:37:45 +00:00
tsutsui
ff0e8a32fd Make these TX39xx stuff compile without "-mips2" option.
TX39xx has a sync instruction, but it doesn't support all mips2 instructions.
2008-01-26 14:40:08 +00:00
joerg
6e869e402d Refactor in_cksum/in4_cksum/in6_cksum implementations:
- All three functions are included in the kernel by default.
  They call a backend function cpu_in_cksum after possibly
  computing the checksum of the pseudo header.
- cpu_in_cksum is the core to implement the one-complement sum.
  The default implementation is moderate fast on most platforms
  and provides a 32bit accumulator with 16bit addends for L32 platforms
  and a 64bit accumulator with 32bit addends for L64 platforms.
  It handles edge cases like very large mbuf chains (could happen with
  native IPv6 in the future) and provides a good base for new native
  implementations.
- Modify i386 and amd64 assembly to use the new interface.

This disables the MD implementations on !x86 until the conversion is
done. For Alpha, the portable version is faster.
2008-01-25 21:12:10 +00:00
skrll
ebb5deb738 Define PT_MACHDEP_STRINGS 2008-01-25 11:59:20 +00:00
dyoung
993dda8c48 Make this compile again: delete an unused variable from ae_ioctl(). 2008-01-23 05:24:28 +00:00
dyoung
3a08c4a544 Make these compile again by #including <prop/problib.h>. 2008-01-23 05:23:59 +00:00
dogcow
2b441c15a9 kill unused variable 2008-01-20 14:18:05 +00:00
dyoung
b480b62270 Make many ethernet drivers share the common code for MII media
handling, ether_mediastatus() and ether_mediachange().  Check for
a non-ENXIO error return from mii_mediachg().  (ENXIO indicates
that a PHY is suspended.)

This patch shrinks the source code size by 979 lines.  There was
a 5100-byte savings on the NetBSD/i386 kernel configuration, ALL.

I have made a few miscellaneous changes, too:

gem(4): use LIST_EMPTY(), LIST_FOREACH().
mtd(4): handle media ioctls, for a change!
axe(4): do not track link status in sc->axe_link any longer
nfe(4), aue(4), axe(4), udav(4), url(4): do not reset all PHYs
        on a change of media

Except for the change to mtd(4), no functional changes are intended.

XXX This patch affects more architectures than I can feasibly
XXX compile and run.  I have compiled macppc, sparc64, i386.  I
XXX have run the patches on i386 boxen with bnx(4) and sip(4).
XXX Compiling and running on evbmips (MERAKI, ADM5120) is in
XXX progress.
2008-01-19 22:10:14 +00:00
dyoung
7b2bde237b Change software interrupts initialization, and add an #include, to
help ADM5120 support compile in -current again.
2008-01-15 22:22:37 +00:00
tsutsui
df9b6a3215 The MIPS3 CP0 counter is not cleared at compare-match and
it always counts upto UINT32_MAX, so no need to handle
wrapped around case with ci_cycles_per_hz value.
2008-01-10 14:29:08 +00:00
wiz
35023be713 Fix typo in macro name and comments. 2008-01-09 20:38:34 +00:00
tsutsui
774fc1f9f9 Fix another botch on migration to MI mips3_clock.c for algor in 2006:
- in algor_p????_cal_timer() functions, initialize ci_divisor_delay
  and ci_cycles_per_hz values in curcpu() for MI mips3_clock.c:mips3_delay()
  rather than obsolete and homegrown delay_divisor
- remove old _delay() stuff from locore_machdep.S
- make MI mips3_delay() work even before frequency values in curcpu()
  are initialized

Now NetBSD/algor P5064 kernel works on gxemul.

While here, add a hack for emulators:
- ignore a measured CPU frequency if the value looks unlikely

Pullup request for netbsd-4 will be sent later.
2008-01-09 14:46:48 +00:00
elad
7e7e1a0aef Kill two KAUTH_GENERIC_ISSUSER requests and replace them with something
more meaningful.
2008-01-09 08:15:53 +00:00
joerg
58facc2685 Remove __HAVE_TIMECOUNTER conditionals. 2008-01-08 14:46:28 +00:00
simonb
c4bf54683c Add timecounter support for sbmips machines and Broadcom SiByte CPUs.
Based on patch from joerg@, with tweaks by me to work with sbmips
non-use of the CP0 count/compare registers for clock interrupts.
2008-01-08 14:38:47 +00:00
dogcow
b24bad5798 add include for incomplete struct blah blah blah 2008-01-08 13:26:26 +00:00
dyoung
40fec83596 Delete unused mips_ipl_si_to_sr[]. 2008-01-07 07:28:14 +00:00
dyoung
cb1ed32e14 Update AR5312 interrupt masks along the same lines as the AR5315. 2008-01-07 07:14:37 +00:00
dyoung
b82c6f8442 Cosmetic: re-number the comments on elements of ipl_sr_bits[]. 2008-01-07 07:12:06 +00:00
dyoung
189256ad32 Make this compile again by making changes similar to the changes
that ad@ made to arch/mips/alchemy/au_icu.c.  Compiles and runs,
but this probably deserves a looksie by someone with more MIPS
clue.
2008-01-07 06:55:32 +00:00
dyoung
b82e361f77 Use pmf(9). Use device_t and device_private(). 2008-01-07 06:53:08 +00:00
dsl
b8bcdbe9e6 Don't pass 'curlwp' into trace_enter() and trace_exit(). 2008-01-05 12:53:52 +00:00
ad
0fbfbb4408 Correct headers. 2008-01-04 22:15:58 +00:00
ad
910c8a56ab Use new style memory barriers. 2008-01-04 21:53:00 +00:00
joerg
26ecc8b33a Add missing include of dev/clock_subr.h. 2008-01-03 22:35:27 +00:00
joerg
a8affe0a2c Missing assym.h dependency. 2008-01-03 20:02:22 +00:00
ad
ea3f10f7e0 Merge more changes from vmlocking2, mainly:
- Locking improvements.
- Use pool_cache for more items.
2007-12-26 16:01:34 +00:00
ad
8044d72190 Make compile (hi moof). 2007-12-22 01:21:41 +00:00
dsl
7e2790cf6f Convert all the system call entry points from:
int foo(struct lwp *l, void *v, register_t *retval)
to:
    int foo(struct lwp *l, const struct foo_args *uap, register_t *retval)
Fixup compat code to not write into 'uap' and (in some cases) to actually
pass a correctly formatted 'uap' structure with the right name to the
next routine.
A few 'compat' routines that just call standard ones have been deleted.
All the 'compat' code compiles (along with the kernels required to test
build it).
98% done by automated scripts.
2007-12-20 23:02:38 +00:00
perry
9b2b412c19 __FUNCTION__ -> __func__ 2007-12-15 00:39:14 +00:00
ad
4a57ad63bb Make it compile. 2007-12-06 21:01:49 +00:00
he
a2a6dd1963 Define the various MIPS* CPU macros also for _STANDALONE in addition
to for _LKM, so that we don't #error out in that case.

This fixes the build for sgimips boot programs, which wants to use
libkern, which now includes the atomic stuff, which for the mips ports
ends up including this file.

"simonb said OK"
2007-12-04 02:43:48 +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
92d7e73c2a Add alias for atomic_cas_64() if available. 2007-11-29 01:04:20 +00:00
ad
f5474801b3 __HAVE_ATOMIC64_OPS if 64-bit 2007-11-29 00:58:03 +00:00
ad
c291a9d4fa RW_GIVE() needs to do a mb_memory() now. 2007-11-29 00:17:54 +00:00
ad
872af53778 - Change _lock_cas and friends to do "compare and swap" instead of "compare
and set".
- Rename them to _atomic_cas_uint, _atomic_cas_ulong etc and provide strong
  aliases for the other names CAS goes by.
2007-11-29 00:14:27 +00:00
ad
34db286793 Use the softint API. 2007-11-26 23:29:36 +00:00
ad
afa1151e21 IPL_STATCLOCK -> IPL_HIGH 2007-11-26 23:28:31 +00:00
yamt
38d5e34116 make kmutex_t and krwlock_t smaller by killing lock id.
ok'ed by Andrew Doran.
2007-11-21 10:19:06 +00:00
ad
59a5b82b4e Fix cpu_need_resched(). 2007-11-19 19:03:13 +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
skrll
74c813c4e9 s/proc/lwp/ in comment 2007-11-16 07:36:10 +00:00
ad
bd6663fc4d Don't set l_usrpri / spc_curpriority here. mi_userret() does it. 2007-11-05 20:37:48 +00:00
yamt
23005df1e0 defparam PAGER_MAP_SIZE. 2007-10-25 13:03:03 +00:00
ad
bccf777b72 Make ras_lookup() lockless. 2007-10-24 14:50:38 +00:00
ad
45fa3176c7 Merge from vmlocking: add CPU_INFO_ITERATOR. 2007-10-19 11:41:27 +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
simonb
198e82a3b8 Recognise the R2000A cpu as found in some pmaxen.
From Dennis Grevenstein on port-pmax@.
2007-10-16 12:19:19 +00:00
scw
7385793c3a s/NPBFILTER/NBPFILTER/ in #endif comment. No functional change. 2007-09-29 18:33:51 +00:00
martin
d9a407bba2 Add a new option DDB_VERBOSE_HELP that adds online help to ddb.
From Adam Hamsik.
Minor modifications by me, all bugs are probably mine.
2007-09-22 18:40:20 +00:00
skrll
9fdaf800d9 Merge nick-csl-alignment. 2007-09-10 11:34:05 +00:00
drochner
dce09ea075 clean up some definitions around rune_t which are not needed anymore 2007-09-03 20:31:56 +00:00
drochner
0e0fe2c353 Fix definitions of UCHAR_MAX/USHRT_MAX and related
types. C99 requires that these definitions promote to (signed/unsigned)
integer the same way as the types the definition is for. And since
unsigned char/short fit into an "int" on all our archs and thus promote
to signed int, the definitions must not be unsigned.
Fixes PR lib/31306 by Neil Booth.
2007-08-31 16:24:21 +00:00
dyoung
6f7649313f Constify. 2007-08-26 22:28:52 +00:00
ad
8b381466db The Atheros HAL on MIPS uses %s7 as a general purpose register, but the
rest of the kernel uses it to store the value of curlwp. Sam won't
recompile the HAL for us (fair enough), and we can't modify the HAL
to use another register because doing so could put us in breach of
the license (v. crappy). So, do a save/set/restore on %s7 in KernIntr()
and in the stubs that the HAL uses to call back into the kernel.
2007-08-24 23:52:10 +00:00
ad
07b0fe01aa cpu_lwp_fork: don't rely on struct mdlwp being zeroed in advance. 2007-08-17 23:58:45 +00:00
ad
63c4506184 Changes to make ktrace LKM friendly and reduce ifdef KTRACE. Proposed
on tech-kern.
2007-08-15 12:07:23 +00:00
kiyohara
ec1fb4e2a6 Remove white-spaces. 2007-08-14 14:10:52 +00:00
ad
9c6535a6de Add ci_cpuid where it's missing. 2007-08-04 09:49:51 +00:00
ad
744a92f0f8 Don't depend on uvm_extern.h pulling in proc.h. 2007-07-21 19:06:20 +00:00
tsutsui
a02017d6e7 Don't set PSL_LOWIPL to SR on switching to lwp_trampoline().
If interrupts are enabled when kernel is switched to lwp_trampoline(),
we could get lock errors by interrupts before lwp_unlock() in lwp_startup()
is called. The spl is lowered by spl0() in lwp_startup() after lwp_unlock().

Ok'ed by mhitch@ and ad@ on port-mips.
2007-07-18 13:46:46 +00:00
macallan
57a324e6fa if we have 64bit paddr_t add a flag which indicates non-cachable for use
with mmap*() and pmap_enter()
Mainly for allowing userland to mmap() the O2's framebuffer uncached
2007-07-17 04:01:34 +00:00
macallan
8bad22882a add definitions for non-cached pages 2007-07-17 03:53:56 +00:00
macallan
a1457f5905 change pmap_phys_address()s parameter to paddr_t since that's what it gets
fed from mmap*() anyway
approved by gimpy
2007-07-16 23:48:03 +00:00
he
f39d28c4bf Adapt to the new signature of callout_init(). 2007-07-12 22:02:38 +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
pooka
0bc323f5cd Initialize the link context in a signal frame to the receiving lwp's
link context instead of NULL.  Otherwise, if we got a signal while the
lwp had a link context set, the link context would be set to NULL upon
return from signal delivery.

christos@tech-kern: "I think you are right."
2007-07-08 10:19:21 +00:00
tsutsui
6a8a584d1a Remove leftover netns stuff. 2007-07-07 05:13:14 +00:00
uebayasi
2360b1d428 Fix typo. 2007-06-27 08:16:58 +00:00
tsutsui
73b3a64df4 Move declaretions of _spl*() and _{clr,set}softintr() functions
(which are in mips/locore.S) into <mips/locore.h>
from various MD files.
2007-06-17 06:04:27 +00:00
tsutsui
82e46da13f Use the kernel symbol table to see the beginning of the current
subroutine to get more proper backtrace on ddb(4).

In the previous code it scans backwards from the current PC
for the end of the previous subroutine and checks "jr ra" or
"jr k0" instructions, but it often fails because gcc is
so aggressive nowadays as to reorder instruction blocks
to create efficient code path by branch predict etc. and
"jr ra" is not always located at the end of subroutines.

No objection on port-mips.
2007-05-29 12:03:45 +00:00
tsutsui
5964c0cd2d Pass correct args to lwp_startup() in lwp_trampoline().
Should fix "panic: TLB out of universe" on MIPS3 machines.
2007-05-27 13:57:30 +00:00
tsutsui
aee64784f3 proc_trampoline -> lwp_trampoline in comment. 2007-05-25 23:58:43 +00:00
tsutsui
0f31f5cb6c Preserve local symbols on linking a kernel so that
we can get more useful trace on ddb(4).
2007-05-25 10:44:27 +00:00