// SPDX-License-Identifier: MPL-2.0
#include "kernel/conf.h"
#include "kernel/log.h"
#include "std/mem.h"
SH_STATUS sh_conf_get_boot_config(sh_conf_BOOT_CONFIG **config) {
  if (config==SH_NULLPTR) {
    return SH_STATUS_INVALID_PARAMETER;
  }
  *config=(sh_conf_BOOT_CONFIG *)SH_CONF_BOOT_CONFIG_VA;
  static const sh_uint8 sig_start[8]={'S','h','C','f','g','B','e','g'};
  static const sh_uint8 sig_end[8]={'S','h','C','f','g','E','n','d'};
  if (sh_mem_compare((*config)->sig_start,sig_start,sizeof(sig_start))==SH_STATUS_MEM_NOT_EQUAL) {
    return SH_STATUS_INVALID_SIGNATURE;
  }
  if (sh_mem_compare((*config)->sig_end,sig_end,sizeof(sig_end))==SH_STATUS_MEM_NOT_EQUAL) {
    return SH_STATUS_INVALID_SIGNATURE;
  }
  return SH_STATUS_SUCCESS;
}
