Commit Graph

1119 Commits

Author SHA1 Message Date
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
tsutsui d4d20b3fd3 Don't call sh4_icache_sync_all() before sh_cache_ops is initialized.
Instead, use SH4_EMODE_CACHE_FLUSH() or SH4_CACHE_FLUSH() macro to
invalidate cache before initializing CCR.
This seems to suppress random file system corruption on wd(4) at acardide(4)
(which uses bus-master DMA and calls many cache flush ops) during pkgsrc
packages builds on landisk.
2013-05-14 14:11:43 +00:00
tsutsui b5342d4988 Add a definition of SCSCMR1, smart card mode register available on 7750 etc. 2013-05-14 13:53:47 +00:00
christos caafbf4e1b add missing SSIZE_MIN 2013-04-11 00:57:34 +00:00
christos 3f9b5ba889 Explicitly set KERN_AS (this could be done in /usr/src/sys/conf/Makefile.*)
so that modules work, on config files that did not set it explicitly. All
the files now use the standard logic, except the ones that set KERN_AS=obj
and Makefile.usermode which sets KERN_AS=library.
2013-03-10 07:18:19 +00:00
tsutsui 3a2ce178a4 Sprinkle redundant comments about PAD_P1_SWITCH to avoid stupid confusion. 2012-12-12 16:24:49 +00:00
tsutsui d5805a0a1a Revert part of the previous (reverting RUN_P1 -> PAD_P1_SWITCH again).
We can assume all icache ops are called from (and will return to) P1
so no need to bother to jump to P1 at end of functions.
Pointed out by uwe@.
2012-12-12 15:43:44 +00:00
tsutsui 4d096c7fdd Fix fallouts in rev 1.19:
http://www.nerv.org/~ryo/netbsd/netbsd/?q=id:20080316T191753Z.1654448ada03ce3c4668f3fe472796d0b771e147
 - revert RUN_P1 -> PAD_P1_SWITCH changes where RUN_P1 is
   actually required  (all icache CCIA ops still need RUN_P2)
 - sh4_dcache_wbinv_all() and sh4_dcache_wbinv_range_index()
   (which manipulate CCDA arrays) are no longer have RUN_P2 so
   we can't call them directly from sh4_icache_sync_all() and
   sh4_icache_sync_range_index() funcitons;  use function pointers
   (which have appropriate addresses) instead for 7750 and 7750S
2012-12-12 13:34:49 +00:00
tsutsui 3ce0b43194 Fix one more device/softc split error:
- set sc->sc_dev properly
2012-12-12 13:32:37 +00:00
chs b8c34ff8df fix device/softc split errors. 2012-10-29 12:51:38 +00:00
chs cbab9cadce split device_t/softc for all remaining drivers.
replace "struct device *" with "device_t".
use device_xname(), device_unit(), etc.
2012-10-27 17:17:22 +00:00
ryo 4829c4fc5e adapt for _UC_TLSBASE.
Approved by manu@ and msaitoh@
2012-09-21 09:05:08 +00:00
manu bba80928a8 setcontext() used to be incompatible with -lpthread since it affected
the TLS pointer, therefore wrecking the pthread environement.

Some ports had _UC_TLSBASE flag or equivalent (_UC_UNIQUE on alpha)
that controlled whether setcontext() would change the TLS pointer.
This change let libpthread override setcontext() with its own version
that unsets _UC_TLSBASE, enabling safe usage of setcontext() with
-lpthread.

We also have the following required changes here:
- rename alpha's _UC_UNIQUE into _UC_TLSBASE
- add _UC_TLSBASE definition in header file for all ports
  (powerpc, sh3, sparc and sparc64 lack the implementation for now)
- introduce a libc stub that can be overriden for setcontext()
- modify MD libcs swapcontext() implementations so that they use the
  setcontext() libc stub instead of doing a plain system call.

While we are there:
- document various MD _UC_* flags in header file
- add libc and libpthread tests for swapcontext() behavior
  (hopefully helpful to spot MD problems introduced with this change)

Future work:
- Deciding whether kernel support or _UC_TLSBASE should be added for
  powerpc, sh3, sparc and sparc64 is left to portmasters
  sparc64

Approved by core@
2012-09-12 02:00:51 +00:00
dsl d222864098 The MDP_USEDFPU (amd64 and sh3) and MDP_SSTEP (sh3) are lwp flags not
process ones, rename to MDL_xxx.
2012-07-08 20:14:11 +00:00
martin 6c3cc552c2 Calling _lwp_create() with a bogus ucontext could trigger a kernel
assertion failure (and thus a crash in DIAGNOSTIC kernels). Independently
discovered by YAMAMOTO Takashi and Joel Sing.

To avoid this, introduce a cpu_mcontext_validate() function and move all
sanity checks from cpu_setmcontext() there. Also untangle the netbsd32
compat mess slightly and add a cpu_mcontext32_validate() cousin there.

Add an exhaustive atf test case, based partly on code from Joel Sing.

Should finally fix the remaining open part of PR kern/43903.
2012-05-21 14:15:16 +00:00
christos 7484a2dbbe - Normalize inclusion protection (remove)
- Move CHAR_{MIN,MAX} to a common file.
- Fix broken comments
2012-03-28 17:03:27 +00:00
rmind ad12c77015 Remove COMPAT_SA / KERN_SA. Welcome to 6.99.3!
Approved by core@.
2012-02-19 21:05:51 +00:00
martin c75ce34822 add missing MD code for posix_spawn 2012-02-13 01:04:26 +00:00
matt 1d7f24ead8 Change old-style function defintions to C89 prototypes.
Approved by releng.
2012-02-12 16:34:06 +00:00