chromium/v8/src/sandbox/hardware-support.cc

// Copyright 2024 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "src/sandbox/hardware-support.h"

#if V8_ENABLE_SANDBOX_HARDWARE_SUPPORT
#include "src/base/platform/memory-protection-key.h"
#endif

namespace v8 {
namespace internal {

#if V8_ENABLE_SANDBOX_HARDWARE_SUPPORT

int SandboxHardwareSupport::pkey_ =;

// static
bool SandboxHardwareSupport::TryEnable(Address addr, size_t size) {}

// static
void SandboxHardwareSupport::InitializeBeforeThreadCreation() {}

// static
void SandboxHardwareSupport::SetDefaultPermissionsForSignalHandler() {}

// static
void SandboxHardwareSupport::NotifyReadOnlyPageCreated(
    Address addr, size_t size, PageAllocator::Permission perm) {}

// static
SandboxHardwareSupport::BlockAccessScope
SandboxHardwareSupport::MaybeBlockAccess() {}

SandboxHardwareSupport::BlockAccessScope::BlockAccessScope(int pkey)
    :{}

SandboxHardwareSupport::BlockAccessScope::~BlockAccessScope() {}

#else  // V8_ENABLE_SANDBOX_HARDWARE_SUPPORT

// static
bool SandboxHardwareSupport::TryEnable(Address addr, size_t size) {
  return false;
}

// static
void SandboxHardwareSupport::InitializeBeforeThreadCreation() {}

// static
void SandboxHardwareSupport::SetDefaultPermissionsForSignalHandler() {}

// static
void SandboxHardwareSupport::NotifyReadOnlyPageCreated(
    Address addr, size_t size, PageAllocator::Permission perm) {}

// static
SandboxHardwareSupport::BlockAccessScope
SandboxHardwareSupport::MaybeBlockAccess() {
  return BlockAccessScope();
}

#endif

}  // namespace internal
}  // namespace v8