Commit Graph

2127 Commits

Author SHA1 Message Date
matt 852d6f5d31 Only include md_uptes if USPACE > PAGE_SIZE 2009-08-17 18:56:09 +00:00
matt e7693e1d73 Don't install aout_machpep.h and bsd-aout.h 2009-08-17 18:55:11 +00:00
matt ab902ee68d Move MID_MACHINE to <mips/mips_param.h> and use local values so we don't
need to include exec_aout.h
2009-08-13 05:15:08 +00:00
matt 9b2fb10da6 Nuke a.out support for MIPS. 2009-08-12 23:29:18 +00:00
simonb 00bf4c87d7 Remove many magic numbers for addresses and interrupt numbers, and use
constants defined in SiByte/Broadcom standard header files.  Switch from
using offsets for locators to actual addresses.

Tested on a swarm (my rhone is dead, but should be OK there too).
2009-08-12 12:56:29 +00:00
matt 3fbfc25940 If using the N32 ABI, define _BSD_JBSLOT_T as long long. Keep _JBLEN
constant since _BSD_JBSLOT_T will now change in size so _JBLEN doesn't
have to.
2009-08-12 05:12:58 +00:00
simonb 8ed35a9caa Sync SiByte includes with cfe-1.4.2.
Includes support for bcm1x55 and bcm1x80 chips.
Tested on a BCM1250 board.
2009-08-11 12:34:06 +00:00
matt 9ca6f3bb04 Fix loongson2 sdcache init. 2009-08-11 02:38:30 +00:00
matt 54096a5ecc Flush by increasing way, then increasing addr. flush L1 before L2 (even
though according to the specification it should be needed).  Reset
mips_sdcache_size to 0 so we will configure it.
2009-08-11 00:34:29 +00:00
matt 2ec5520014 If using 16KB pages and VMSWAP_UAREA isn't defined, then cpu_switch_resume
becomes a empty routine since the UAREA is now mapped via KSEG0 instead of
via TLB.
2009-08-09 22:24:53 +00:00
matt b75d8d8bd3 If using 16KB pages, don't enable special CCA for loongson2 cpus. 2009-08-09 22:22:51 +00:00
matt 147944b204 Add 16KB variants of MIPS3_PG_{ODDPG,HVN,SVN} 2009-08-09 22:21:44 +00:00
matt 8987d18d1a Initialize Page Mask register based on PAGE_SIZE, don't assume it's always
going to be 4KB.  (And this change, I can boot a GDIUM kernel with 16KB
pages as far as I could with 4KB).
2009-08-09 17:53:54 +00:00
matt e51839706f Use PGSHIFT + 1 instead hardcoding 13.
Don't set Page Mask to 0 when invalidating a TLB entry.
2009-08-09 05:36:22 +00:00
matt ead615cc2a s/struct device */device_t /g 2009-08-09 04:09:55 +00:00
matt 4d59439aa7 Change TLBMiss to use values based on NBPG and PGSHIFT instead of magic
numbers.
Use REG_S instead of sw in a few more places.  Use _MFCO as well.
2009-08-09 04:08:14 +00:00
matt 05f21e1df1 Add disabled code to set K0 CCA if CCA_SPECIAL is being used. 2009-08-09 04:06:35 +00:00
matt efe42514d3 If Loongson2 way size is <= page size, don't enable mips_virtual_alias 2009-08-09 04:05:03 +00:00
matt c9bc7bdfee Add latent ENABLE_MIPS_16KB_PAGE option. 2009-08-09 04:04:12 +00:00
matt cc15998b88 Beginning of large-page support. 2009-08-09 04:02:40 +00:00
matt 17fa6905db s/struct device */device_t /;g 2009-08-09 04:02:00 +00:00
matt 0c80f83e59 Clean up a bit. No reason to use 4way on icache ops (it clears all ways). 2009-08-07 23:23:58 +00:00
matt fab892c926 Add loongson2 specific cache ops 2009-08-07 18:39:10 +00:00
matt ec695a81bd Mark LOONGSON as uncached for the moment. 2009-08-07 03:33:28 +00:00
matt 5161730624 Fix references to mips_ipl_si_to_sr which were off by 1. 2009-08-07 01:26:13 +00:00
matt 01327baca5 attach the missed evcnt too 2009-08-07 01:14:26 +00:00
matt d9c091be8f Use mips3_get_cache_config for Loongson2 2009-08-06 23:16:39 +00:00
matt 5e3f78448a print ra on trap. 2009-08-06 23:07:55 +00:00
matt 2891bea040 Update Loongston. Set colors and mark it as having virtual aliases. 2009-08-06 22:56:31 +00:00
matt 7cb1141cfa Change MIPS64_LOONGSON2 to MIP3_LOONGSON2 since it's a MIPS3 and not MIPS64. 2009-08-06 16:13:07 +00:00
matt cff0705eb4 The Loongson2 secondary cache is unified. 2009-08-06 15:58:46 +00:00
matt bb6666c5a7 Make cidnames const 2009-08-06 15:58:12 +00:00
msaitoh f02cd49d11 Add disassemble code for DMT, DMF, MTH and MFH. 2009-08-06 04:34:50 +00:00
matt 144bdbe663 Add Loongson2 support. 2009-08-06 01:27:47 +00:00
matt fcbae537a4 Add ICT Loongson2 identification. 2009-08-06 00:46:34 +00:00
matt 48f76ccf28 LOONGSON2 is a MIPS III 2009-08-06 00:42:58 +00:00
matt d9fa6bc288 Use bool instead of int. 2009-08-06 00:42:22 +00:00
matt c08351c1cd Add MIPS64_LOONGSON2F since it needs some special help in various places. 2009-08-01 22:59:52 +00:00
matt e7b97f7d32 Extract bonito support from sys/arch/algor/conf/files.algor so it can be
used by multiple ports.
2009-08-01 22:58:36 +00:00
matt ab4ed2bee9 Add Loongson2 chip ids 2009-08-01 22:50:41 +00:00
alc 6ce0e276a4 Update reference to the Atheros HAL exported headers.
`external/isc/atheros_hal/dist', former `contrib/dev/ath/' is now in cpp(1)'s
include path.

Fix build of MERAKI kernel.
2009-07-06 00:43:22 +00:00
tsutsui 54604067b9 Since pmap.c rev 1.163, page attributes of PV_MODIFIED and PV_REFERENCED
have beem moved from pv_flags in struct pv_entry to pvh_attrs in
struct vm_page_md, so no need to copy pv_flags to keep these flags
in pv header in pmap_remove_pv(). Pointed out by uebayasi@ on port-mips.
Also rename those page attribute flags from PV_FOO to PGA_FOO like alpha.
While here, make pv_flags unsigned.

Briefly tested on sgimips O2.
2009-06-29 13:22:51 +00:00
martin f8047b2aa2 Per discussion with <simonb> also block the interrupts from icu 1 for
splvm(), even if we don't currently support any handlers for gpio
interrupts.
2009-05-31 11:34:01 +00:00
martin 839da53f59 Block MIPS_INT_MASK_1 for splvm() too - if_aumac.c establishes it's
interrupt handler at icu 0 req 1, which needs to be blocked by splvm().
2009-05-31 09:39:10 +00:00
martin 250d329095 Do not use the same trampoline for cpu_lwp_fork and cpu_setfunc - only
the former needs to call lwp_startup().
2009-05-30 18:26:06 +00:00
skrll e03976623a Add TLS relocation definitions. 2009-05-30 05:56:52 +00:00
cegger 1d89a182fb change pmap flags argument from int to u_int.
discussed with christos@ on source-changes-d@
2009-04-21 21:29:58 +00:00
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