Commit Graph

32180 Commits

Author SHA1 Message Date
Daniel Hellstrom
a87964d04f sparc,smp: typo in start.S causing SMP not working 2018-08-24 15:51:38 +02:00
Daniel Cederman
59a0541c5b sparc: Restore npc when returning from the syscall_lazy_fp_switch trap
If the floating point trap occurred in a delay slot it is not certain
that npc will be equal to pc + 4.
2018-08-24 15:51:38 +02:00
Sebastian Huber
6695d02bf0 Update FreeBSD kernel timespec support
This change is based on the following FreeBSD commit:

"Make timespecadd(3) and friends public

The timespecadd(3) family of macros were imported from NetBSD back in
r35029. However, they were initially guarded by #ifdef _KERNEL. In the
meantime, we have grown at least 28 syscalls that use timespecs in some
way, leading many programs both inside and outside of the base system to
redefine those macros. It's better just to make the definitions public.

Our kernel currently defines two-argument versions of timespecadd and
timespecsub.  NetBSD, OpenBSD, and FreeDesktop.org's libbsd, however, define
three-argument versions.  Solaris also defines a three-argument version, but
only in its kernel.  This revision changes our definition to match the
common three-argument version.

Bump _FreeBSD_version due to the breaking KPI change.

Discussed with:	cem, jilles, ian, bde
Differential Revision:	https://reviews.freebsd.org/D14725"

To make the change public (outside #ifdef _KERNEL) it must be integrated
in Newlib.

Update #3472.
2018-08-23 14:39:33 +02:00
Sebastian Huber
ba0e9631a0 score: Do not inline _Thread_Dispatch_enable()
This function is slighly too complex for inlining with two if
statements.  The caller already needs a stack frame due to the potential
call to _Thread_Do_dispatch().  In _Thread_Dispatch_enable() the call to
_Thread_Do_dispatch() can be optimized to a tail call.

A text size comparision

  (text size after patch - text size before patch)
   / text size before patch

on sparc/erc32 with SMP enabled showed these results:

  Minimum -0.000697892 (fsdosfsname01.exe)
  Median -0.00745021 (psxtimes01.exe)
  Maximum -0.0233032 (spscheduler01.exe)

A text size comparision

  text size after patch - text size before patch

on sparc/erc32 with SMP enabled showed these results:

  Minimum -3312 (ada_sp09.exe)
  Median -1024 (tm15.exe)
  Maximum -592 (spglobalcon01.exe)
2018-08-23 14:38:41 +02:00
Sebastian Huber
a36aa8628f Add dummy PI_SOFT to <sys/priority.h>
Update #3472.
2018-08-23 14:38:41 +02:00
Sebastian Huber
d14f9349ea score: Fix ISR enable in _Thread_Dispatch_enable()
This bug had probably no effect since the interrupt enable is idempotent
on all CPU ports.

Close #3496.
2018-08-20 08:36:31 +02:00
Sebastian Huber
2cd3716103 bsps/arm: Fix PL111 register define re-definition
Close #3502.
2018-08-20 08:36:31 +02:00
Christian Mauderer
dcaea71741 dev/sc16is752: Add name space for field names.
The field names for the registers generated a name collision (MSR_RI on
the power pc). This patch adds a SC16IS752_ prefix for all field names.

Closes #3501.
2018-08-15 09:48:31 -05:00
Joel Sherrill
da8b12bcb7 dl06/dl06-o1.c: Remove set, not used warning 2018-08-15 09:48:28 -05:00
Joel Sherrill
adbd7e747e fsdosfssync01/init.c: Remove unused variable 2018-08-15 09:47:53 -05:00
Amaan Cheval
bc7313134f bsps/x86_64: Add APIC timer based clock driver
The APIC timer is calibrated by running the i8254 PIT for a fraction of a
second (determined by PIT_CALIBRATE_DIVIDER) and counting how many times the
APIC counter has ticked. The calibration can be run multiple times (determined
by APIC_TIMER_NUM_CALIBRATIONS) and averaged out.

Updates #2898.
2018-08-13 10:48:20 -05:00
Amaan Cheval
686932125d bsps/x86_64: Add support for RTEMS interrupts
Updates #2898.
2018-08-13 10:48:20 -05:00
Amaan Cheval
4544749e3c bsps/x86_64: Add paging support with 1GiB super pages
Updates #2898.
2018-08-13 10:48:20 -05:00
Amaan Cheval
6eccd0c7e7 bsps/x86_64: Reduce default RamSize to 1GiB
Simulators may not always be able to allocate 4GiB easily, and using an
artificially lower RAM may cause a broken heap.

Updates #2898.
2018-08-13 10:48:20 -05:00
Amaan Cheval
ab971bf5e3 bsps/x86_64: Reorganize header files and compile-options
Updates #2898.
2018-08-13 10:48:20 -05:00
Joel Sherrill
382d6537df libtests/POSIX: Fix warnings and style. 2018-08-10 08:24:29 -05:00
Joel Sherrill
b3693f5d6d bsps/sparc/include/bsp/gradcdac.h: Fix nested comment warning 2018-08-10 08:24:28 -05:00
Joel Sherrill
d071d9a17a qoriq/include/tm27.h: Fix prototype warning 2018-08-10 08:24:28 -05:00
Joel Sherrill
ebd19374c5 motorola_powerpc/include/tm27.h: Fix prototype warning 2018-08-10 08:24:28 -05:00
Joel Sherrill
3cff531fa0 bsps/powerpc/include/mpc83xx/mpc83xx.h: Fix nested comment warning 2018-08-10 08:24:28 -05:00
Joel Sherrill
5896da452c bsps/powerpc/include/bsp/tictac.h: Fix protototype warnings 2018-08-10 08:24:27 -05:00
Joel Sherrill
ae4fbf3b4f gen83xx/include/tm27.h: Fix prototype warning 2018-08-10 08:24:27 -05:00
Joel Sherrill
ec8c955d3e gen5200/include/tm27.h: Fix prototype warning 2018-08-10 08:24:27 -05:00
Joel Sherrill
7de5182999 gen5200/include/bsp/ata.h: Fix warning 2018-08-10 08:24:27 -05:00
Joel Sherrill
0fc87d4785 csb337/include/at91rm9200_dbgu.h: Fix nested comment warning 2018-08-10 08:24:26 -05:00
Sebastian Huber
b2de4260c5 score: Fix _Addresses_Subtract()
Use architecture-specific integer type for an address difference.

Update #3486.
2018-08-10 07:14:43 +02:00
Sebastian Huber
66cb142054 rtems: Parameter types in rtems_partition_create()
Use uintptr_t to specify the length of the partition buffer area instead
of uint32_t.  This is in line with rtems_region_create().  On 64-bit
targets, the length may exceed 4GiB.  Use size_t for the buffer size,
since on some targets the single object size is less than the overall
address range, e.g. m32c sizeof(uintptr_t) > sizeof(size_t).

Update #3486.
2018-08-10 07:14:43 +02:00
Sebastian Huber
b8eae1403a Add dummy PRI_MIN_KERN to <sys/priority.h>
Update #3472.
2018-08-10 07:14:43 +02:00
Sebastian Huber
0e6f7dc4c4 bsps/sparc: Fix external variable declarations 2018-08-10 07:14:43 +02:00
Sebastian Huber
f4424cfb49 bsps/sparc: Move polled APBUART functions
This reduces the link-time dependencies and avoids copy-and-paste.
2018-08-10 07:14:43 +02:00
Sebastian Huber
aac36d153a posix: Add configure check for mprotect()
Update #3491.
2018-08-10 07:14:43 +02:00
Christian Mauderer
8e6cfccf8c bsp/atsam: Fix handling of slow SPI speeds.
This patch fixes an overflow in the frequency calculation of the SPI
driver for slow SPI speeds.
2018-08-09 08:37:38 +02:00
Sebastian Huber
71948f76fa sys/event.h: Update version FreeBSD tag
Update #3472.
2018-08-08 08:15:17 +02:00
dab
ac824fffa0 Make the definition of struct kevent in event.h match what the man page for kevent(2) says.
This is a trivial comment-only fix. The man page for kevent(2) gives
the definition of struct kevent, including a comment on each
field. The actual definition in sys/event.h omitted the comments on
some fields. Add the comments in. Not only does this make the man page
and include file agree, but the comments are useful in and of
themselves.

Reviewed by:	kib (D15778: commented that this should be a separate commit)
MFC after:	3 days
Sponsored by:	Dell EMC
2018-08-08 08:15:17 +02:00
dab
96b32773e4 Address some (although not all) style(9) issues in event.h after r335776.
Reported by:	bde@
MFC after:	1 day
Sponsored by:	Dell EMC
2018-08-08 08:15:17 +02:00
dab
1d00acb1c9 Fix compilation error in r335765 under gcc 4.2.1.
The anonymous object initialization introduced in r335765 was
acceptable to clang, but not gcc 4.2.1. Fix it for both.

Reported by:	jhibbits@
Pointy Hat:	myself
MFC after:	1 week
X-MFC-with:	r335765
Sponsored by:	Dell EMC
2018-08-08 08:15:17 +02:00
dab
b37ef68873 Remove potential identifier conflict in the EV_SET macro.
PR43905 pointed out a problem with the EV_SET macro if the passed
struct kevent pointer were specified with an expression with side
effects (e.g., "kevp++"). This was fixed in rS110241, but by using a
local block that defined an internal variable (named "kevp") to get
the pointer value once. This worked, but could cause issues if an
existing variable named "kevp" is in scope. To avoid that issue,
jilles@ pointed out that "C99 compound literals and designated
initializers allow doing this cleanly using a macro". This change
incorporates that suggestion, essentially verbatim from jilles@
comment on PR43905, except retaining the old definition for pre-C99 or
non-STDC (e.g., C++) compilers.

PR:	43905
Submitted by:	Jilles Tjoelker (jilles@)
Reported by:	Lamont Granquist <lamont@scriptkiddie.org>
Reviewed by:	jmg (no comments), jilles
MFC after:	1 week
Sponsored by:	Dell EMC
Differential Revision:	https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=43905
2018-08-08 08:15:17 +02:00
pfg
bf026dd452 sys/sys: further adoption of SPDX licensing ID tags.
Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.
2018-08-08 08:15:17 +02:00
jhb
57c03363c8 Decode kevent structures logged via ktrace(2) in kdump.
- Add a new KTR_STRUCT_ARRAY ktrace record type which dumps an array of
  structures.

  The structure name in the record payload is preceded by a size_t
  containing the size of the individual structures.  Use this to
  replace the previous code that dumped the kevent arrays dumped for
  kevent().  kdump is now able to decode the kevent structures rather
  than dumping their contents via a hexdump.

  One change from before is that the 'changes' and 'events' arrays are
  not marked with separate 'read' and 'write' annotations in kdump
  output.  Instead, the first array is the 'changes' array, and the
  second array (only present if kevent doesn't fail with an error) is
  the 'events' array.  For kevent(), empty arrays are denoted by an
  entry with an array containing zero entries rather than no record.

- Move kevent decoding tables from truss to libsysdecode.

  This adds three new functions to decode members of struct kevent:
  sysdecode_kevent_filter, sysdecode_kevent_flags, and
  sysdecode_kevent_fflags.

  kdump uses these helper functions to pretty-print kevent fields.

- Move structure definitions for freebsd11 and freebsd32 kevent
  structures to <sys/event.h> so that they can be shared with userland.
  The 32-bit structures are only exposed if _WANT_KEVENT32 is defined.
  The freebsd11 structures are only exposed if _WANT_FREEBSD11_KEVENT is
  defined.  The 32-bit freebsd11 structure requires both.

- Decode freebsd11 kevent structures in truss for the compat11.kevent()
  system call.

- Log 32-bit kevent structures via ktrace for 32-bit compat kevent()
  system calls.

- While here, constify the 'void *data' argument to ktrstruct().

Reviewed by:	kib (earlier version)
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D12470
2018-08-08 08:15:17 +02:00
kib
e9b708ab2a Add abstime kqueue(2) timers and expand struct kevent members.
This change implements NOTE_ABSTIME flag for EVFILT_TIMER, which
specifies that the data field contains absolute time to fire the
event.

To make this useful, data member of the struct kevent must be extended
to 64bit.  Using the opportunity, I also added ext members.  This
changes struct kevent almost to Apple struct kevent64, except I did
not changed type of ident and udata, the later would cause serious API
incompatibilities.

The type of ident was kept uintptr_t since EVFILT_AIO returns a
pointer in this field, and e.g. CHERI is sensitive to the type
(discussed with brooks, jhb).

Unlike Apple kevent64, symbol versioning allows us to claim ABI
compatibility and still name the new syscall kevent(2).  Compat shims
are provided for both host native and compat32.

Requested by:	bapt
Reviewed by:	bapt, brooks, ngie (previous version)
Sponsored by:	The FreeBSD Foundation
Differential revision:	https://reviews.freebsd.org/D11025
2018-08-08 08:15:17 +02:00
pkelsey
f51aec82aa Fix typo.
hist -> hint

MFC after:	3 days
2018-08-08 08:15:16 +02:00
Sebastian Huber
fd27bae5b9 CONFIGURE_MINIMUM_POSIX_THREAD_STACK_SIZE
Make CONFIGURE_MINIMUM_POSIX_THREAD_STACK_SIZE configurable by the user.

Update #3434.
2018-08-08 08:15:13 +02:00
Sebastian Huber
97417bb15f tests: Remove CONFIGURE_MAXIMUM_DRIVERS
This configuration is superfluous in these tests.
2018-08-07 07:37:59 +02:00
Sebastian Huber
0b038bd48b libblock: Add RTEMS_DEPRECATED
Close #3358.
2018-08-07 07:17:19 +02:00
Sebastian Huber
b152d33ba5 fileio: Avoid deprecated rtems_disk_obtain()
Update #3358.
2018-08-07 07:17:19 +02:00
Sebastian Huber
ab96aec60a dosfs: Avoid deprecated routine
Update #3358.
2018-08-07 07:17:18 +02:00
Sebastian Huber
dd66fda397 tests: Avoid deprecated rtems_disk_io_initialize()
Update #3358.
2018-08-07 07:17:18 +02:00
Sebastian Huber
1836c6a456 bsp/gen5200: Avoid deprecated routine
Update #3358.
2018-08-07 07:17:18 +02:00
Sebastian Huber
f7cecc3308 libchip/ata: Use rtems_blkdev_create()
Update #3358.
2018-08-07 07:17:18 +02:00
Sebastian Huber
698093d68d libblock: Use rtems_blkdev_create_partition()
Update #3358.
2018-08-07 07:17:18 +02:00