Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/coreclr/debug/daccess/ppc64le/primitives.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

//

#include "stdafx.h"

#include "../../shared/ppc64le/primitives.cpp"
8 changes: 8 additions & 0 deletions src/coreclr/debug/ee/ppc64le/dbghelpers.S
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

#include "asmconstants.h"
#include "unixasmmacros.inc"

#error Unsupported platform

9 changes: 9 additions & 0 deletions src/coreclr/debug/ee/ppc64le/primitives.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

//

#include "stdafx.h"
#include "threads.h"
#include "../../shared/ppc64le/primitives.cpp"

15 changes: 15 additions & 0 deletions src/coreclr/debug/shared/ppc64le/primitives.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
//*****************************************************************************
// File: primitives.cpp
//

//
// Platform-specific debugger primitives
//
//*****************************************************************************

#include "primitives.h"

#error Unsupported platform

2 changes: 2 additions & 0 deletions src/coreclr/inc/crosscomp.h
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,8 @@ typedef struct _T_KNONVOLATILE_CONTEXT_POINTERS {
#define DAC_CS_NATIVE_DATA_SIZE 96
#elif defined(TARGET_LINUX) && defined(TARGET_LOONGARCH64)
#define DAC_CS_NATIVE_DATA_SIZE 96
#elif defined(TARGET_LINUX) && defined(TARGET_POWERPC64)
#define DAC_CS_NATIVE_DATA_SIZE 96
#elif defined(TARGET_NETBSD) && defined(TARGET_AMD64)
#define DAC_CS_NATIVE_DATA_SIZE 96
#elif defined(TARGET_NETBSD) && defined(TARGET_ARM)
Expand Down
2 changes: 2 additions & 0 deletions src/coreclr/inc/pedecoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ inline CHECK CheckOverflow(RVA value1, COUNT_T value2)
#define IMAGE_FILE_MACHINE_NATIVE IMAGE_FILE_MACHINE_ARM64
#elif defined(TARGET_LOONGARCH64)
#define IMAGE_FILE_MACHINE_NATIVE IMAGE_FILE_MACHINE_LOONGARCH64
#elif defined(TARGET_POWERPC64)
#define IMAGE_FILE_MACHINE_NATIVE IMAGE_FILE_MACHINE_POWERPC
#elif defined(TARGET_S390X)
#define IMAGE_FILE_MACHINE_NATIVE IMAGE_FILE_MACHINE_UNKNOWN
#else
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/inc/switches.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
#if defined(TARGET_X86) || defined(TARGET_ARM)
#define USE_LAZY_PREFERRED_RANGE 0

#elif defined(TARGET_AMD64) || defined(TARGET_ARM64) || defined(TARGET_S390X) || defined(TARGET_LOONGARCH64)
#elif defined(TARGET_AMD64) || defined(TARGET_ARM64) || defined(TARGET_S390X) || defined(TARGET_LOONGARCH64) || defined(TARGET_POWERPC64)

#if defined(HOST_UNIX)
// In PAL we have a smechanism that reserves memory on start up that is
Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/inc/volatile.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@
#error The Volatile type is currently only defined for Visual C++ and GNU C++
#endif

#if defined(__GNUC__) && !defined(HOST_X86) && !defined(HOST_AMD64) && !defined(HOST_ARM) && !defined(HOST_ARM64) && !defined(HOST_LOONGARCH64) && !defined(HOST_S390X)
#error The Volatile type is currently only defined for GCC when targeting x86, AMD64, ARM, ARM64, LOONGARCH64, or S390X CPUs
#if defined(__GNUC__) && !defined(HOST_X86) && !defined(HOST_AMD64) && !defined(HOST_ARM) && !defined(HOST_ARM64) && !defined(HOST_LOONGARCH64) && !defined(HOST_S390X) && !defined(HOST_POWERPC64)
#error The Volatile type is currently only defined for GCC when targeting x86, AMD64, ARM, ARM64, LOONGARCH64, PPC64LE, or S390X CPUs
#endif

#if defined(__GNUC__)
Expand Down
153 changes: 153 additions & 0 deletions src/coreclr/pal/inc/pal.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ typedef PVOID NATIVE_LIBRARY_HANDLE;
#define _M_LOONGARCH64 1
#elif defined(__s390x__) && !defined(_M_S390X)
#define _M_S390X 1
#elif defined(__powerpc__) && !defined(_M_PPC64)
#define _M_PPC64 1
#endif

#if defined(_M_IX86) && !defined(HOST_X86)
Expand All @@ -110,6 +112,8 @@ typedef PVOID NATIVE_LIBRARY_HANDLE;
#define HOST_LOONGARCH64
#elif defined(_M_S390X) && !defined(HOST_S390X)
#define HOST_S390X
#elif defined(_M_PPC64) && !defined(HOST_POWERPC64)
#define HOST_POWERPC64
#endif

#endif // !_MSC_VER
Expand Down Expand Up @@ -2399,6 +2403,153 @@ typedef struct _KNONVOLATILE_CONTEXT_POINTERS {

} KNONVOLATILE_CONTEXT_POINTERS, *PKNONVOLATILE_CONTEXT_POINTERS;

#elif defined(HOST_POWERPC64)

// There is no context for ppc64le defined in winnt.h,
// so we re-use the amd64 values.
#define CONTEXT_PPC64 0x100000

#define CONTEXT_CONTROL (CONTEXT_PPC64 | 0x1L)
#define CONTEXT_INTEGER (CONTEXT_PPC64 | 0x2L)
#define CONTEXT_FLOATING_POINT (CONTEXT_PPC64 | 0x4L)

#define CONTEXT_FULL (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_FLOATING_POINT)

#define CONTEXT_ALL (CONTEXT_CONTROL | CONTEXT_INTEGER | CONTEXT_FLOATING_POINT)

#define CONTEXT_EXCEPTION_ACTIVE 0x8000000
#define CONTEXT_SERVICE_ACTIVE 0x10000000
#define CONTEXT_EXCEPTION_REQUEST 0x40000000
#define CONTEXT_EXCEPTION_REPORTING 0x80000000

typedef struct DECLSPEC_ALIGN(16) _CONTEXT {

//
// Control flags.
//

DWORD ContextFlags;

//
// Integer Registers
//

DWORD64 R0;
DWORD64 R1;
DWORD64 R2;
DWORD64 R3;
DWORD64 R4;
DWORD64 R5;
DWORD64 R6;
DWORD64 R7;
DWORD64 R8;
DWORD64 R9;
DWORD64 R10;
DWORD64 R11;
DWORD64 R12;
DWORD64 R13;
DWORD64 R14;
DWORD64 R15;
DWORD64 R16;
DWORD64 R17;
DWORD64 R18;
DWORD64 R19;
DWORD64 R20;
DWORD64 R21;
DWORD64 R22;
DWORD64 R23;
DWORD64 R24;
DWORD64 R25;
DWORD64 R26;
DWORD64 R27;
DWORD64 R28;
DWORD64 R29;
DWORD64 R30;
DWORD64 R31;

//
// Floaring Point Registers
//

DWORD64 F0;
DWORD64 F1;
DWORD64 F2;
DWORD64 F3;
DWORD64 F4;
DWORD64 F5;
DWORD64 F6;
DWORD64 F7;
DWORD64 F8;
DWORD64 F9;
DWORD64 F10;
DWORD64 F11;
DWORD64 F12;
DWORD64 F13;
DWORD64 F14;
DWORD64 F15;
DWORD64 F16;
DWORD64 F17;
DWORD64 F18;
DWORD64 F19;
DWORD64 F20;
DWORD64 F21;
DWORD64 F22;
DWORD64 F23;
DWORD64 F24;
DWORD64 F25;
DWORD64 F26;
DWORD64 F27;
DWORD64 F28;
DWORD64 F29;
DWORD64 F30;
DWORD64 F31;
DWORD64 Fpscr;

//
// Control Registers
//

DWORD64 Nip;
DWORD64 Msr;
DWORD64 Ctr;
DWORD64 Link;

DWORD Xer;
DWORD Ccr;


} CONTEXT, *PCONTEXT, *LPCONTEXT;

//
// Nonvolatile context pointer record.
//

typedef struct _KNONVOLATILE_CONTEXT_POINTERS {
PDWORD64 R14;
PDWORD64 R15;
PDWORD64 R16;
PDWORD64 R17;
PDWORD64 R18;
PDWORD64 R19;
PDWORD64 R20;
PDWORD64 R21;
PDWORD64 R22;
PDWORD64 R23;
PDWORD64 R24;
PDWORD64 R25;
PDWORD64 R26;
PDWORD64 R27;
PDWORD64 R28;
PDWORD64 R29;
PDWORD64 R30;
PDWORD64 R31;

//
// Need to add Floating point non-volatile registers.
//

} KNONVOLATILE_CONTEXT_POINTERS, *PKNONVOLATILE_CONTEXT_POINTERS;

#else
#error Unknown architecture for defining CONTEXT.
#endif
Expand Down Expand Up @@ -2536,6 +2687,8 @@ PALIMPORT BOOL PALAPI PAL_VirtualUnwindOutOfProc(CONTEXT *context, KNONVOLATILE_
#define PAL_CS_NATIVE_DATA_SIZE 96
#elif defined(__linux__) && defined(HOST_S390X)
#define PAL_CS_NATIVE_DATA_SIZE 96
#elif defined(__linux__) && defined(HOST_POWERPC64)
#define PAL_CS_NATIVE_DATA_SIZE 96
#elif defined(__NetBSD__) && defined(__amd64__)
#define PAL_CS_NATIVE_DATA_SIZE 96
#elif defined(__NetBSD__) && defined(__earm__)
Expand Down
Loading