blob: 4b46d88fcc21850eb7565df6646c217736d3dc79 [file] [log] [blame]
// Copyright lowRISC contributors.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0
#include "sw/device/lib/base/hardened_status.h"
#include "sw/device/lib/base/hardened.h"
#include "sw/device/lib/base/status.h"
hardened_bool_t hardened_status_ok(status_t s) {
if (launder32(s.value) >= 0 && launder32(s.value) == kHardenedBoolTrue) {
HARDENED_CHECK_EQ((hardened_bool_t)s.value, kHardenedBoolTrue);
return s.value;
}
return kHardenedBoolFalse;
}