History log of /freebsd-current/sys/powerpc/include/reg.h
Revision Date Author Comments
# 71625ec9 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

sys: Remove $FreeBSD$: one-line .c comment pattern

Remove /^/[*/]\s*\$FreeBSD\$.*\n/


# 76d6bb6a 23-Nov-2021 Warner Losh <imp@FreeBSD.org>

powerpc: Make machine/reg.h self-contained

Make powerpc*'s machine/reg.h self-contained so that sys/reg.h can be
self-contained.

Sponsored by: Netflix


# 35a1aa5f 02-May-2021 Brandon Bergren <bdragon@FreeBSD.org>

[PowerPC] Fix outdated FP regs on fork(2) and friends

Summary:
Failure to update the FP / vector state was causing daemon(3) to violate C ABI by failing to preserve nonvolatile registers.

This was causing a weird issue where moused was not working on PowerBook G4s when daemonizing, but was working fine when running it foreground.

Force saving off the same state that cpu_switch() does in cases where we are about to copy a thread.

MFC after: 1 week
Sponsored by: Tag1 Consulting, Inc.

Test Plan:
```
/*
* Test for ABI violation due to side effects of daemon(3).
*
* NOTE: Compile with -O2 to see the effect.
*/
/* Allow compiling for Linux too. */

static double test = 1234.56f;

/*
* This contrivance coerces clang to not bounce the double
* off of memory again in main.
*/
void __attribute__((noinline))
print_double(int j1, int j2, double d)
{
printf("%f\n", d);
}

int
main(int argc, char *argv[])
{
print_double(0, 0, test);

if (daemon(0, 1)) {
}
/* Compiler assumes nonvolatile regs are intact... */
print_double(0, 0, test);
return(0);
}
```

Working output:
```
1234.560059
1234.560059
```

Output in broken case:
```
1234.560059
0.0
```

Reviewers: #powerpc

Subscribers: jhibbits, luporl, alfredo

Tags: #powerpc

Differential Revision: https://reviews.freebsd.org/D29851


# 31174518 03-Dec-2019 John Baldwin <jhb@FreeBSD.org>

Use uintptr_t instead of register_t * for the stack base.

- Use ustringp for the location of the argv and environment strings
and allow destp to travel further down the stack for the stackgap
and auxv regions.
- Update the Linux copyout_strings variants to move destp down the
stack as was done for the native ABIs in r263349.
- Stop allocating a space for a stack gap in the Linux ABIs. This
used to hold translated system call arguments, but hasn't been used
since r159992.

Reviewed by: kib
Tested on: md64 (amd64, i386, linux64), i386 (i386, linux)
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D22501


# 6469bdcd 06-Apr-2018 Brooks Davis <brooks@FreeBSD.org>

Move most of the contents of opt_compat.h to opt_global.h.

opt_compat.h is mentioned in nearly 180 files. In-progress network
driver compabibility improvements may add over 100 more so this is
closer to "just about everywhere" than "only some files" per the
guidance in sys/conf/options.

Keep COMPAT_LINUX32 in opt_compat.h as it is confined to a subset of
sys/compat/linux/*.c. A fake _COMPAT_LINUX option ensure opt_compat.h
is created on all architectures.

Move COMPAT_LINUXKPI to opt_dontuse.h as it is only used to control the
set of compiled files.

Reviewed by: kib, cem, jhb, jtl
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D14941


# 93312a91 01-Feb-2016 John Baldwin <jhb@FreeBSD.org>

Restore the ABI of 'struct fpreg' on powerpc.

The PT_{GET,SET}FPREGS requests use 'struct fpreg' and the NT_FPREGSET
core note stores a copy of 'struct fpreg'. As with x86 and the floating
point state there compared to the extended state in XSAVE, struct fpreg
on powerpc now only holds the 'base' FP state, and setting it via
PT_SETFPREGS leaves the extended vector state in a thread unchanged.

Reviewed by: jhibbits
Differential Revision: https://reviews.freebsd.org/D5004


# dbee5c67 08-Apr-2015 John Baldwin <jhb@FreeBSD.org>

Move the 32-bit compatible procfs types from freebsd32.h to <sys/procfs.h>
and export them to userland.
- Define __HAVE_REG32 on platforms that define a reg32 structure and check
for this in <sys/procfs.h> to control when to export prstatus32, etc.
- Add prstatus32_t and prpsinfo32_t typedefs for the 32-bit structures.
libbfd looks for these types, and having them fixes 'gcore' in gdb of a
32-bit process on a 64-bit platform.
- Use the structure definitions from <sys/procfs.h> in gcore's elf32 core
dump code instead of duplicating the definitions.

Differential Revision: https://reviews.freebsd.org/D2142
Reviewed by: kib, nathanw (powerpc bits)
MFC after: 1 week


# 35f612b8 22-Feb-2015 Nathan Whitehorn <nwhitehorn@FreeBSD.org>

Kernel support for the Vector-Scalar eXtension (VSX) found on the POWER7
and POWER8. This instruction set unifies the 32 64-bit scalar floating
point registers with the 32 128-bit vector registers into a single bank
of 64 128-bit registers. Kernel support mostly amounts to saving and
restoring the wider version of the floating point registers and making
sure that both scalar FP and vector registers are enabled once a VSX
instruction is executed. get_mcontext() and friends currently cannot
see the high bits, which will require a little more work.

As the system compiler (GCC 4.2) does not support VSX, making use of this
from userland requires either newer GCC or clang.

Relnotes: yes
Sponsored by: FreeBSD Foundation


# 64b83a05 14-Jan-2015 Justin Hibbits <jhibbits@FreeBSD.org>

Add Altivec/VMX register support to ptrace.

MFC after: 2 weeks
Relnotes: yes


# a7d5f7eb 19-Oct-2010 Jamie Gritton <jamie@FreeBSD.org>

A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.


# c3e289e1 12-Jul-2010 Nathan Whitehorn <nwhitehorn@FreeBSD.org>

MFppc64:

Kernel sources for 64-bit PowerPC, along with build-system changes to keep
32-bit kernels compiling (build system changes for 64-bit kernels are
coming later). Existing 32-bit PowerPC kernel configurations must be
updated after this change to specify their architecture.


# d7f03759 19-Oct-2008 Ulf Lilleengen <lulf@FreeBSD.org>

- Import the HEAD csup code which is the basis for the cvsmode work.


# a6e340aa 29-Jul-2004 Suleiman Souhlal <ssouhlal@FreeBSD.org>

Add comment explaining struct reg and struct fpreg must match the trapframe.

Approved by: grehan (mentor)


# bafbd492 29-Aug-2002 Jake Burkholder <jake@FreeBSD.org>

Renamed poorly named setregs to exec_setregs. Moved its prototype to
imgact.h with the other exec support functions.


# 812344bc 20-Mar-2002 Alfred Perlstein <alfred@FreeBSD.org>

Remove __P.

Reveiwed by: benno


# 1f042619 21-Oct-2001 Dag-Erling Smørgrav <des@FreeBSD.org>

[partially forced commit due to pilot error in earlier commit attempt]

{set,fill}_{,fp,db}regs() fixup:

- Add dummy {set,fill}_dbregs() on architectures that don't have them.

- KSEfy the powerpc versions (struct proc -> struct thread).

- Some architectures had the prototypes in md_var.h, some in reg.h, and
some in both; for consistency, move them to reg.h on all platforms.

These functions aren't really MD (the implementation is MD, but the interface
is MI), so they should move to an MI header, but I haven't figured out which
one yet.

Run-tested on i386, build-tested on Alpha, untested on other platforms.


# 5fd2c51e 19-Sep-2001 Mark Peek <mp@FreeBSD.org>

Update PowerPC MD code to compile and do initial bootstrap based on
recent changes (KSE and VM requiring physmem to be setup).

Reviewed by: benno, jhb, julian


# f9bac91b 09-Jun-2001 Benno Rice <benno@FreeBSD.org>

Bring in NetBSD code used in the PowerPC port.

Reviewed by: obrien, dfr
Obtained from: NetBSD