Commit Graph

1875 Commits

Author SHA1 Message Date
tsutsui 145f39b7b6 Don't install built boot.atari loaders into / of DESTDIR because
there are two variants of boot.atari per machine types (std or milan)
and they should be selected and copied from /usr/mdec/{std,milan} dirs
to /targetroot during installation.

Problem on default installation with sysinst was reported by David Ross.
2009-01-13 13:44:01 +00:00
yamt 70de973662 g/c BUFQ_FOO() macros and use bufq_foo() directly. 2009-01-13 13:33:58 +00:00
tsutsui fe5a481b54 Fix PR port-atari/40315: Bootloader fails on Atari TT030
Add asm sources which provide a fixed entry point for raw bootxx and bootxxx
 because modern aggressive gcc4 may reorder functions in the same source
 and the first function in a C source won't always appear at the beginning
 in its object.

Also overhaul various files in the stand directory:
- rename stand/Makefile.inc to stand/Makefile.booters and
  explicitly include it from each Makefile because the stand
  directory contains non standalone programs like installboot and
  Makefile.inc will be included implicitly from all Makefiles in SUBDIRs
- put more common options into Makefile.booters so that
  all boot programs use proper options (-Os etc.)
- make standalone boot programs compile without installed ${DESTDIR}:
  - create machine and m68k symlinks in ${.OBJDIR} in all boot programs
  - set appropriate make environments to suppress errors and warnings
  - <string.h> isn't there in _STANDALONE case
  - put #ifdef TOSTOOLS (looks equivarent with !_STANDALONE)
    to some files in stand/tostools
  - use ${LD} ${LINKFLAGS} rather than ${CC} ${LDFLAGS}
- create raw binaries on ${PROG} target rather than on beforeinstall
  and stop weird renaming on beforeinstall and afterinstall
- print proper error message if bootxx size is larger than limit
- create ${DESTDIR}/usr/mdec/{milan,std} directories on beforeinstall
  in all boot programs
  (XXX: how can we put MD /usr/mdec/foo directories into src/etc/mtree?)
- prototype warnsfy
- cleanup Makefiles for readablity and remove unnecessary rules
- no need to use daddr_t in installboot because the AHDI label doesn't
  support 64 bit block numbers

Tested by David Ross (PR submitter) on port-atari, and
finally NetBSD/atari on TT030 is now fully functional.

Should be pulled up to netbsd-4 (where gcc4 was initially imported)
and netbsd-5.
2009-01-06 13:35:30 +00:00
tsutsui 636ff16d48 Use howmany(x, y) rather than roundup(x, y)/y. No binary change. 2009-01-04 04:18:35 +00:00
tsutsui cff68ad349 Sync with an update on amiga:
Rewrite a weird calculation marked "XXX fix calculations XXX"
for an index value of lev2 segment table for the kernel Sysptmap
with more meaningful expressions and PAGE_SIZE independent macro.
Also use "~0" rather than "-1" for an unsigned bitmap value.

Should produce the same results and no functional change.

Tested on Falcon with 68060 by Tuomo Makinen.
2009-01-03 07:11:02 +00:00
tsutsui c61c988be5 Raise IPL to splsoftnet() before calling callback functions registered
via (atari specific) add_sicallback(), as a workaround hack.

Many drivers which use the MD sicallback depend on BASEPRI() macro
defined in <machine/cpu.h> to check nested interrupts,
but functions invoked from MI softint(9) won't run at IPL_SOFT
any longer and the BASEPRI() macro doesn't return expected value
as the past.

Fixes lost interrupt problem on Falcon wdc(4) reported by
Tuomo Makinen on port-atari, and also confirmed by him.

Should be pulled up to netbsd-5.
2009-01-03 06:36:58 +00:00
tsutsui cf6816d68a Update one more comment which was missed in previous. 2009-01-02 04:38:09 +00:00
tsutsui 21ac960f24 Remove declarations of CADDR1, CADDR2, and vmmap.
These variables have been moved into pmap_bootstrap.c
and <m68k/pmap_motorola.h> has extern decls for them.
2009-01-01 08:11:45 +00:00
tsutsui 8e2bef0189 Pull the following amiga's pmap changes to atari:
arch/amiga/amiga/amiga_init.c		1.95-1.97, 1.100-1.102
arch/amiga/amiga/pmap.c			1.123, 1.126-1.131, 1.142, 1.145
arch/amiga/amiga/pmap_bootstrap.c	1.1, 1.2, 1.3, 1.4
arch/amiga/conf/files.amiga		1.137
arch/amiga/include/pcb.h		1.16
arch/amiga/include/pmap.h		1.44
arch/amiga/include/pte.h		1.19
arch/amiga/include/vmparam.h		1.35

- change kernel address space layout (i.e. move Sysmap to the end of KVA)
  to match other m68k ports, which should be done on yamt-km merge
- rework pmap_zero_page(), pmap_copy_page() and some more other functions
  to make them compatible with m68k/pmap_motorola.c
- move pmap_bootstrap() into a separate file to allow using either
  the atari pmap.c or the m68k common pmap_motorola.c
- use common m68k include files, pcb.h, pmap_motorola.h, and pte_motorola.h
- misc style and cosmetic changes

Most merge work is done by Tuomo Makinen, and
miscellaneous fixes and cleanups are done by me.

Tested on Falcon with both 68030 and 68060 by Tuomo, and
also tested on TT030 by David Ross on port-atari.

Should be pulled up to netbsd-4 (it requires at least Sysmap changes)
and netbsd-5.
2009-01-01 04:10:25 +00:00
tsutsui d38ce2ebbc Pull a change from amiga/pmap.c rev 1.124 for yamt-idlelwp merge. 2009-01-01 03:43:30 +00:00
tsutsui baffe80103 Remove quite obsolete pcb_cmap2. 2008-12-31 11:11:05 +00:00
tsutsui 7d8d4998c1 Fix broken RCS Id. 2008-12-28 23:00:39 +00:00
tsutsui fd6ad22aed Clear bp->b_oflags (introduced on vmlocking2 merge) before read
rather than calling brelse(9) after read.
Tested by Tuomo Makinen on port-atari.

Should fix pool panics during installation reported by David Ross
on port-atari:
http://mail-index.NetBSD.org/port-atari/2008/11/13/msg000113.html
and actually close PR port-atari/39850.
2008-12-28 03:13:59 +00:00
tsutsui 8a0754e5d7 Account idepth in all interrupt handlers in locore.s. 2008-12-27 16:17:24 +00:00
tsutsui d79dc17147 Sprinkle volatile to bus_space(9) access functions. 2008-12-27 16:14:12 +00:00
cegger dcf705893e use M_ZERO on malloc() and remove subsequent bzero(). 2008-12-19 18:49:37 +00:00
he 1c6fe739fe Correct two typos and remove a now-unused variable to make this
build again.
2008-12-18 10:58:17 +00:00
christos 9a5d3f2817 replace bitmask_snprintf(9) with snprintb(3) 2008-12-16 22:35:21 +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
martin 719a906ef5 As discussed on tech-kern: mutex_init is too heavyweight for early bootstrap
phases, so move the initialization of the ksyms mutex back into main via
a function called ksyms_init. Rename the existing (but quite different)
ksyms_init* variations into ksyms_addsyms_elf() and ksyms_addsyms_explicit()
and adapt machdep code accordingly.
2008-11-30 18:21:31 +00:00
ad 93ea4650a6 dumpsys: don't spew numbers into the log. 2008-11-25 15:51:34 +00:00
ad 6ba528b5bc Remove softdep, pass 1. We are focused on improving journalling.
Proposed on tech-kern@.
2008-11-24 11:41:07 +00:00
abs b53939be13 To be safe, do not use DMA for Falcon - from Tuomo 2008-11-15 21:35:31 +00:00
abs 5dd888f5c3 Since dl.d_type is always "unknown" now, pick the type of bootblock to
install based on the device name: eg /dev/fd0c would be floppy
2008-11-15 21:33:12 +00:00
abs 58051692c8 Remove bogus DEBUG uvm_map() calls - (sync with amiga pmap). From Tuomo 2008-11-15 21:30:50 +00:00
abs 85609809d6 Regenerate: Increase min ST_POOL_SIZE from 22 to 24 to avoid out of ST memory issues. Tested by Tuomo 2008-11-15 21:22:03 +00:00
abs 53aa0265b2 Increase min ST_POOL_SIZE from 22 to 24 to avoid out of ST memory issues. Tested by Tuomo 2008-11-15 21:21:23 +00:00
ad 0efea177e3 Remove LKMs and switch to the module framework, pass 1.
Proposed on tech-kern@.
2008-11-12 12:35:50 +00:00
dyoung 94d985722a It is not appropriate to call pmf_system_shutdown(9) from
doshutdownhooks(9): shutdown hooks registered by shutdownhook_establish(9)
expect to be called with interrupts disabled, but shutdown hooks
registered with pmf_device_register1(9) expect to be called with
interrupts enabled.  So I have made two changes:

1 Do not call pmf_system_shutdown() from doshutdownhooks().  Instead,
change every call to doshutdownhooks() to a call to doshutdownhooks()
followed by a call to pmf_system_shutdown().  No functional change
is intended by this change.

2 Make i386 re-enable interrupts briefly while it calls
pmf_system_shutdown().  I leave it to others either to fix the
other ports, or to factor out some MI shutdown code, as joerg@
suggests, and fix that.  Note that a functional change *is* intended
by this change.

I hope that this patch will stop us from flip-flopping between
calling doshutdownhooks() and pmf_system_shutdown() sometimes with
and sometimes without interrupts enabled.
2008-11-11 06:46:40 +00:00
abs 66b0aa634e Regenerate from GENERIC.in 1.75
Enable 68060 support in FALCON & BOOTX kernels for CT60/63 upgrades
Drop KERNFS from INSTALL kernels
Drop 68040 support from ATARITT kernels
2008-11-09 07:50:39 +00:00
abs 0282f5b26e Enable 68060 support in FALCON & BOOTX kernels for CT60/63 upgrades
Drop KERNFS from INSTALL kernels
Drop 68040 support from ATARITT kernels
2008-11-09 07:49:59 +00:00
abs 96dc40fee6 Add the following note to README:
Please commit changes to 'GENERIC.in' and other source files *first*, then
 run 'makeconf' and commit the generated files to ensure the 'Created from:'
 tags are correct.

Then follow it. Noted by tsutsui@
2008-11-06 17:12:20 +00:00
abs 09149f66a7 Add a note that SERCONSOLE breaks on the Falcon, and remove from
FALCON config.
2008-11-05 23:55:06 +00:00
abs d36d67412b Another fix from Tuomo Makinen - Use brelse() to unbusy bp buffer
to allow user to swap floppy disks when prompted.
2008-11-04 17:08:45 +00:00
abs 7bb734ab12 Move tc_init(&clk_timecounter); to stop the "timecounter:" message
appearing in the middle of the clock0 attach message. Tested by
Tuomo Makinen
2008-11-04 16:43:47 +00:00
abs 87d661967a Cleanup spelling and syntax in a comment 2008-10-29 14:31:01 +00:00
abs eb89868e67 Remove unwanted 'xs->xs_status |= XS_STS_DONE' which caused scsipi_done()
to bail out early.
Found by T. Makinen, and additional confirmation by David Ross
2008-10-28 11:44:14 +00:00
apb f46c1de7cb Use ${TOOL_SED} instead if plain sed in Makefiles. 2008-10-25 22:27:34 +00:00
apb 96230fab84 Use ${TOOL_AWK} instead of ${AWK} or plain "awk" in make commands.
Pass AWK=${TOOL_AWK:Q} to shell scripts that use awk.
2008-10-19 22:05:19 +00:00
wrstuden fc7511b00e Merge wrstuden-revivesa into HEAD. 2008-10-15 06:51:17 +00:00
simonb dc9029a896 Regen for "options WAPBL". 2008-07-31 07:48:37 +00:00
simonb ef38d7e5a7 Move "options WAPBL" so that it also gets added to INSTALL kernels. 2008-07-31 07:47:43 +00:00
simonb 0751ba4bff Add "options WAPBL" to standard GENERIC/INSTALL type configs. 2008-07-31 07:40:59 +00:00
tsutsui 1a160ac866 Specify volatile to some pointers to access DMA registers. 2008-07-20 16:35:27 +00:00
tsutsui 471f4d63c3 No need to specify '&' to get array's address.
No binary changes.
2008-07-20 16:28:24 +00:00
tsutsui b55114eae7 Fix pointer arithmetic botch in rev 1.37. 2008-07-20 16:23:38 +00:00
ad b94f79f0e8 Replce exec_map with a pool. Proposed on tech-kern@, reviewed by chs@. 2008-07-02 17:28:54 +00:00
tsutsui 2c77262457 Sync with arch/m68k/m68k/pmap_motorola.c rev 1.38:
> Remove ({ }) gcc extensions and use static inline functions instead.
2008-06-29 09:03:47 +00:00
isaki 3e6d14da34 Unify splraiseipl(9) implementation among m68k ports,
discussed with tsutsui@ on port-m68k. OK'ed by jdc@.

For atari:
- export ipl2psl_table[] and make it uint16_t
- make makeiplcookie(9) inline
- put PSL_S bit into ipl2psl_table[] rather than adding it in makeiplcookie(9)
- vme/if_le_vme.c: fix a wrong usage of IPL_NET
2008-06-28 05:26:33 +00:00
cegger 947c9ab610 use device_lookup_private to get softc 2008-06-13 08:49:15 +00:00
tsutsui cb09de1924 Use device_private() and device_lookup_privat() to get softc. 2008-06-11 14:35:53 +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 48ced055d4 pci_intr_setattr(), allows PCI interrupts to be marked MPSAFE on x86, and
other platforms if the code is added.

pci_intr_map(...)
pci_intr_setattr(pc, ih, PCI_INTR_MPSAFE, 1);
pci_intr_establish(...)
2008-05-30 19:26:35 +00:00
martin 11a6dbe728 Convert TNF licenses to new 2 clause variant 2008-04-30 13:10:46 +00:00
martin 3028e483e4 Convert to new 2 clause license 2008-04-29 06:53:00 +00:00
martin ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
tsutsui 285b0f56d9 Fix warnings #ifdef DEBUG case. 2008-04-27 14:44:25 +00:00
tsutsui c070e2d90e - use mutex(9) for uvm_kernel_object
- fix warnings in #ifdef DEBUG
2008-04-27 14:44:04 +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
tsutsui d9941582bf Split device_t/softc for le(4) and variants and misc cosmetic changes. 2008-04-04 12:25:06 +00:00
cube a27f79f69e Use M_TEMP for allocations instead of the now deceased M_IOCTLOPS. 2008-03-23 15:50:51 +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
yamt b09761a4bb arint_normal -> aprint_normal 2008-03-17 00:00:55 +00:00
cube bb192d4cfd Split device_t and softc for the ... wait for it ... [air quotes] MI
variant of fdc(4)/fd(4).  Other cosmetic changes as appropriate.
2008-03-16 00:58:56 +00:00
cube 8ecf8999bf Split the softc from the device_t for all lpt(4) variants and attachments
except the ppbus stuff (which doesn't compile) and ulpt(4) which is
unrelated and can be dealt with separately.

As usual, it comes with related cosmetic changes.
2008-03-07 17:15:51 +00:00
rmind c6186face4 Welcome to 4.99.55:
- Add a lot of missing selinit() and seldestroy() calls.

- Merge selwakeup() and selnotify() calls into a single selnotify().

- Add an additional 'events' argument to selnotify() call.  It will
  indicate which event (POLL_IN, POLL_OUT, etc) happen.  If unknown,
  zero may be used.

Note: please pass appropriate value of 'events' where possible.
Proposed on: <tech-kern>
2008-03-01 14:16:49 +00:00
xtraeme f402cadf9a Remove CTL_MACHDEP_NAMES, it's not used anywhere.
Ok by martin@.
2008-02-27 18:26:15 +00:00
drochner bb33f35f20 Since files.wscons et al. are included by ~all ports anyway, include
them in the mi "files" file, and remove include statements from md files.
These shouldn't pull in additional kernel code when not in use, so it
shouldn't do any harm except a risk of namespace collisions which
should be easy to fix.
2008-02-20 21:43:33 +00:00
joerg d28597deae Add some assym.h dependencies. 2008-01-25 20:02:06 +00:00
joerg 3615cf7715 Now that __HAVE_TIMECOUNTER and __HAVE_GENERIC_TODR are invariants,
remove the conditionals and the code associated with the undef case.
2008-01-20 18:09:03 +00:00
he 4b2e779458 Include <sys/simplelock.h> to pull in appropriate definitions. 2008-01-11 14:03:47 +00:00
joerg 732cd3c8a0 Convert Atari to generic TODR and timecounter. 2008-01-08 18:04:15 +00:00
he 75fc209bcf Fix a cv_timedwait() usage after the vmlocking2 merge, and remove
a now-no-longer-used local variable.
2008-01-03 16:06:24 +00:00
joerg c8ad2035a8 Simplify delay based on x86 version. 2008-01-03 01:02:04 +00:00
joerg 62fcc14f1c ANSIfy. 2008-01-03 00:31:28 +00:00
ad 4a780c9ae2 Merge vmlocking2 to head. 2008-01-02 11:48:20 +00:00
ad 2ecdf58c2c Remove systrace. Ok core@. 2007-12-31 15:31:24 +00:00
tsutsui b7b9eda05d - add a missing brace in the previous
- print error message on failure to map aux register
2007-12-04 16:36:54 +00:00
tsutsui 704f93353b Apply missed following MI wdc changes to atari's mainbus wdc backend:
- make bus space handles an array for each command register
  http://mail-index.netbsd.org/source-changes/2003/11/27/0036.html
  (note we no longer have to specify stride for wdc after this change)
- add the notion of "shadow register"
  http://mail-index.netbsd.org/source-changes/2004/05/25/0048.html

Problem reported by Alan Hourihane in PR port-amiga/37464.
2007-12-04 15:28:58 +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 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
ad bd6663fc4d Don't set l_usrpri / spc_curpriority here. mi_userret() does it. 2007-11-05 20:37:48 +00:00
xtraeme 4ba09b41c3 Remove System V semaphores and share memory options to set the limits:
SEMMNI, SEMMNS, SEMUME and SHMMAXPGS.

They can be tweaked via sysctl now. Ports that were setting values on
them weren't touched, I only removed the ones that were commented out.
2007-11-04 14:34:19 +00:00
joerg d238692c3e Initialise the callbacks for tty.t_rstrt_ch in ttymalloc
as all drivers but Sun/SPARC's kd.c use the same arguments.
Separate callout_reset into callout_schedule and the initial
callout_setfunc using that.
2007-10-18 18:54:56 +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
he 663275b41c Fix typo: in disk_init() call: fd -> sc. 2007-10-17 17:58:56 +00:00
ad 9f56dfa520 Merge brelse() changes from the vmlocking branch. 2007-10-08 18:02:53 +00:00
ad 2af68666da Merge disk init changes from the vmlocking branch. These seperate init /
destroy of 'struct disk' from attach / detach.
2007-10-08 16:41:05 +00:00
mhitch 9b0f085da1 68030 and 68040 processors consider the read portion of a read-modify-write
transfer as a write to ensure the memory is writable before starting any
transfer.  The fault status information does not reflect this in the 'read'
status bit (i.e. it shows up as a read access), so faults with a RMW access
to non-writable memory was not getting the correct protection.  The page would
be read-only and the instruction would fault over and over.

A specific example is when a process forks, and the child process attempts
to execute a RMW access to a data page, which is read-only because it's CoP
Copy-On-Write.

When checking if the page needs to be writablek, also check the locked transfer
and treat any locked transfer as a write.

68060 already handled this correctly, since it has separate read and write
fault bits, and both are set on a RMW access and the trap code was checking
the write status bit.

Fixes PR#36848.
2007-09-01 21:31:55 +00:00
adrianp 475217d719 Remove iso(4) from GENERIC kernels, as discussed on tech-net@
Ok'ed by core@
2007-08-06 21:26:53 +00:00
ad 9c6535a6de Add ci_cpuid where it's missing. 2007-08-04 09:49:51 +00:00
ad 66fefd117b It's not a good idea for device drivers to modify b_flags, as they don't
need to understand the locking around that field. Instead of setting
B_ERROR, set b_error instead. b_error is 'owned' by whoever completes
the I/O request.
2007-07-29 12:15:35 +00:00
he a4d164aaef Same change as -r1.133 of src/sys/arch/amiga/amiga/pmap.c:
As per hint from ad@, change uvm.kernel_object to uvm_kernel_object,
  to adapt to the recent uvm changes.
2007-07-23 23:13:04 +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 3bb4d9ddb8 Regenerate configurations after adding COMPAT_40 to GENERIC.in. 2007-07-16 06:35:53 +00:00
he 13a06ef4a8 The COMPAT_AOUT_M68K option now requies COMPAT_40 after the changes
to mount(), so define COMPAT_40 too.
2007-07-16 06:26:54 +00:00
ad 63811f5275 Generic soft interrupts are mandatory. 2007-07-14 21:48:17 +00:00
he 150caa6d8c Adapt to new signature for callout_init(). 2007-07-11 19:13:23 +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