Commit Graph

1137 Commits

Author SHA1 Message Date
cherry
dfb8e9c033 Use the correct page frame number to steal pages during boot.
Fixes the related sh3 kernel build breakage.
2016-12-24 17:18:00 +00:00
cherry
3b1622fa3c "Make NetBSD great again!"
Introduce uvm_hotplug(9) to the kernel.

Many thanks, in no particular order to:

TNF, for funding the project.

Chuck Silvers - for multiple API reviews and feedback.
Nick Hudson - for testing on multiple architectures and bugfix patches.
Everyone who helped with boot testing.

KeK (http://www.kek.org.in) for hosting the primary developers.
2016-12-23 07:15:27 +00:00
cherry
e08917ef90 switch all ports to use uvm_init.c:uvm_md_init()
uvm_setpagesize() is now subsumed within this funciton.
2016-12-22 14:47:53 +00:00
joerg
18274a7046 binutils decided to shuffle around its extensions a long time ago. Since
we don't actually use them for anything, follow them.
2016-12-05 12:42:33 +00:00
pgoyette
a60b99094c * Split sys/kern/sys_process.c into three parts:
1 - ptrace(2) syscall for native emulation
        2 - common ptrace(2) syscall code (shared with compat_netbsd32)
        3 - support routines that are shared with PROCFS and/or KTRACE

* Add module glue for #1 and #2.  Both modules will be built-in to the
  kernel if "options PTRACE" is included in the config file (this is
  the default, defined in sys/conf/std).

* Mark the ptrace(2) syscall as modular in syscalls.master (generated
  files will be committed shortly).

* Conditionalize all remaining portions of PTRACE code on a new kernel
  option PTRACE_HOOKS.

XXX Instead of PROCFS depending on 'options PTRACE', we should probably
    just add a procfs attribute to the sys/kern/sys_process.c file's
    entry in files.kern, and add PROCFS to the "#if defineds" for
    process_domem().  It's really confusing to have two different ways
    of requiring this file.
2016-11-02 00:11:59 +00:00
christos
3ed49a9ae1 Fix pmap_prefer for topdown and turn topdown on. 2016-09-03 09:07:53 +00:00
christos
83df8f8761 fake some stuff for softfloat. 2016-08-25 12:29:14 +00:00
christos
859026962c use fenv.h 2016-08-25 12:19:42 +00:00
christos
a4f32a2d7b fenv.h for sh 2016-08-25 12:14:10 +00:00
christos
d84c286204 expose the kernel types for standalone code. 2016-01-23 22:31:19 +00:00
christos
4d497c90e6 Hide {p,v}{addr,size}_t and register_t (and a couple more types that
are machine-specific) from userland unless _KERNEL/_KMEMUSER and a
new _KERNTYPES variables is defined. The _KERNTYPES should be fixed
for many subsystems that should not be using it (rump)...
2016-01-23 21:22:13 +00:00
tsutsui
e9ca2f5972 Make options SCIFCONSOLE patchable via a variable using gdb(1) etc.
Tested on dreamcast.
2015-12-06 02:21:55 +00:00
tsutsui
2af5fde181 Remove \n from set_cpumodel(), and explicitly print \n during boot instead.
Fixes dmesg on NetBSD/dreamcast 7.0 (and probably NetBSD/hpcsh 7.0):
---
NetBSD 7.0 (GENERIC.201509250726Z)
SEGA Dreamcasttotal memory = 16384 KB
avail memory = 13668 KB
---
which was mangled when cpu_getmode() and cpu_setmodel() were introduced:
 http://mail-index.netbsd.org/source-changes/2014/03/24/msg053273.html

Should be pulled up to netbsd-7 and netbsd-7-0.
2015-11-22 18:44:25 +00:00
msaitoh
605f564f52 PCI Extended Configuration stuff written by nonaka@:
- Add PCI Extended Configuration Space support into x86.
- Check register offset of pci_conf_read() in MD part. It returns (pcireg_t)-1
  if it isn't accessible.
- Decode Extended Capability in PCI Extended Configuration Space.
  Currently the following extended capabilities are decoded:
   - Advanced Error Reporting
   - Virtual Channel
   - Device Serial Number
   - Power Budgeting
   - Root Complex Link Declaration
   - Root Complex Event Collector Association
   - Access Control Services
   - Alternative Routing-ID Interpretation
   - Address Translation Services
   - Single Root IO Virtualization
   - Page Request
   - TPH Requester
   - Latency Tolerance Reporting
   - Secondary PCI Express
   - Process Address Space ID
   - LN Requester
   - L1 PM Substates
  The following extended capabilities are not decoded yet:
   - Root Complex Internal Link Control
   - Multi-Function Virtual Channel
   - RCRB Header
   - Vendor Unique
   - Configuration Access Correction
   - Multiple Root IO Virtualization
   - Multicast
   - Resizable BAR
   - Dynamic Power Allocation
   - Protocol Multiplexing
   - Downstream Port Containment
   - Precision Time Management
   - M-PCIe
   - Function Reading Status Queueing
   - Readiness Time Reporting
   - Designated Vendor-Specific
2015-10-02 05:22:49 +00:00
christos
b88569ce68 For processors that have memory breakpoints, add macros for them to help
libproc
2015-09-25 16:05:17 +00:00
christos
5020ab68d5 Provide access to pc/sp/syscall-return registers like we have for mcontext 2015-09-15 15:49:02 +00:00
dholland
25d3b9e7cb Final bit of PR 41200: headers that declare ioctls should include sys/ioccom.h.
This covers most if not all of the MD headers.

XXX: a lot of the ioctl definitions in some of these files are cutpasted.
2015-09-07 03:49:44 +00:00
pooka
01d7ebdd80 Fix PTHREAD_FOO_INITIALIZER for C++ by not using volatile in the relevant
pthread types in C++ builds, attempt 2.

The problem with attempt 1 was making assumptions of what the MD
__cpu_simple_lock_t (declared volatile) looks like.  To get a same type
except non-volatile, we change the MD type to __cpu_simple_lock_nv_t
and typedef __cpu_simple_lock_t as a volatile __cpu_simple_lock_nv_t.
IMO, __cpu_simple_lock_t should not be volatile at all, but changing it
now is too risky.

Fixes at least Rumprun w/ gcc 5.1/5.2.  Furthermore, the mpd application
(and possibly others) will no longer require NetBSD-specific patches.

Tested: build.sh for i386, Rumprun for x86_64 w/ gcc 5.2.

Based on the patch from Christos in lib/49989.
2015-08-27 12:30:50 +00:00
martin
e7a3928268 Make clock_t unsigned int everywhere.
Ok: matt@, mrg@
2015-06-17 14:32:31 +00:00
skrll
e66946542b Handle EINVAL in the fault path and send SIGBUS on mmap'd access past EOF.
From martin@
2015-03-04 09:39:26 +00:00
skrll
ff958e114f port-sh3/49613: errno does not set by some systemcall at error case
Branch to correct point when error detected.
2015-02-15 10:48:13 +00:00
christos
ad991e655e We never want the c definitions in <sys/endian.h> 2015-01-06 17:43:16 +00:00
christos
b59f66e17c use the inline bcdtobin and bintobcd directly instead through a macro. 2014-11-20 16:34:25 +00:00
christos
a0a6c85f4d centralize the call unit / dialout macros 2014-11-15 19:20:01 +00:00
christos
3c0fd211c8 instead of bitching about the missing endianness, get it. 2014-10-23 19:39:42 +00:00
martin
b1c3f60336 Adapt formats for debug printfs to clock_subr type changes. 2014-09-08 10:00:18 +00:00
matt
82a12988ef Include <sys/common_int_types.h> if __UINTPTR_TYPE__ is defined. 2014-08-13 22:56:56 +00:00
matt
0b2cac531b Include <sys/common_int_const.h> if __INTMAX_C_SUFFIX__ is defined. 2014-08-13 22:51:58 +00:00
matt
7c5094c243 Include <sys/common_init_limits.h> if __SIG_ATOMIC_MAX__ is defined. 2014-08-13 22:31:06 +00:00
matt
2534797f07 include <sys/common_int_mwgwtypes.h> if __UINT_FAST64_TYPE__ is defined. 2014-08-13 22:25:39 +00:00
matt
efe99ca41d include <sys/common_int_fmtio.h> if __INTPTR_FMTd__ is defined 2014-08-13 19:48:17 +00:00
dholland
f9228f4225 Add d_discard to all struct cdevsw instances I could find.
All have been set to "nodiscard"; some should get a real implementation.
2014-07-25 08:10:31 +00:00
msaitoh
a563525659 fix -Werror=unused-but-set-variable compile error 2014-06-19 18:01:18 +00:00
matt
8ed9a6d892 Since all our compilers support __DBL_* and __FLT_*, use them to define
{DBL,FLT}_{DIG,MIN,MAX}
2014-04-21 10:53:47 +00:00
christos
3ff79dba35 adjust to new signature; return consistent stuff. 0 is ok -1 is error 2014-04-05 18:44:32 +00:00
christos
b2543b9136 use cpu_{g,s}etmodel 2014-03-24 20:06:31 +00:00
christos
13a17f1494 kill sprintf 2014-03-20 18:01:19 +00:00
dholland
a68f9396b6 Change (mostly mechanically) every cdevsw/bdevsw I can find to use
designated initializers.

I have not built every extant kernel so I have probably broken at
least one build; however I've also found and fixed some wrong
cdevsw/bdevsw entries so even if so I think we come out ahead.
2014-03-16 05:20:22 +00:00
dsl
be74e0a9c9 Change the type of the 'cookie' that holds the state of the core dump file
from 'void *' to the actual type 'struct coredump_iostate *'.
In most of the code the contents of the structure are still unknown.
This just stops the wrong type of pointer being passed to the 'void *'
parameter.
I hope I've found everything, amd64 GENERIC and i386 GENERIC & ALL compile.
2014-01-01 18:57:15 +00:00
skrll
9460c4a119 Really remove unused variable. 2013-11-18 15:34:06 +00:00
skrll
3715f6edd9 Removed unused variable 2013-11-14 13:54:08 +00:00
christos
acda221c21 fixed unused variable warning 2013-11-09 21:31:45 +00:00
christos
bf437e30a3 remove unused code 2013-11-09 02:23:57 +00:00
christos
f148a5082f fix unused variables 2013-11-07 21:45:04 +00:00
christos
86b6b2fef2 make cpu_need_resched() macros consistent; __USE flags 2013-10-19 19:20:59 +00:00
joerg
4d12bfcd15 Pass PICFLAGS down to cc-as-as and use __PIC__ to decide if it is small
vs big PIC mode. Retire -DPIC and -DBIGPIC.
2013-09-12 15:36:14 +00:00
uwe
543668cba8 db_stack_trace_print: support trace/[at], starting trace from switchframe. 2013-08-06 21:41:01 +00:00
matt
d67f4a234d Collapse syscall_fancy/syscall_plain to syscall and p_trace_enabled.
Use sy_invoke
2013-06-26 16:28:51 +00:00
christos
5021bb4477 Complete the dosparts -> mbrparts conversion. Only x86k new uses dosparts
because it also uses struct dos_partition.
2013-05-16 19:06:44 +00:00
christos
787cd6d568 name it like other ports do 2013-05-16 18:47:38 +00:00