Path: blob/master/tools/testing/selftests/arm64/signal/test_signals.c
26295 views
// SPDX-License-Identifier: GPL-2.01/*2* Copyright (C) 2019 ARM Limited3*4* Generic test wrapper for arm64 signal tests.5*6* Each test provides its own tde struct tdescr descriptor to link with7* this wrapper. Framework provides common helpers.8*/910#include <sys/auxv.h>11#include <sys/prctl.h>1213#include <kselftest.h>1415#include "test_signals.h"16#include "test_signals_utils.h"1718struct tdescr *current = &tde;1920int main(int argc, char *argv[])21{22/*23* Ensure GCS is at least enabled throughout the tests if24* supported, otherwise the inability to return from the25* function that enabled GCS makes it very inconvenient to set26* up test cases. The prctl() may fail if GCS was locked by27* libc setup code.28*/29if (getauxval(AT_HWCAP) & HWCAP_GCS)30gcs_set_state(PR_SHADOW_STACK_ENABLE);3132ksft_print_msg("%s :: %s\n", current->name, current->descr);33if (test_setup(current) && test_init(current)) {34test_run(current);35test_cleanup(current);36}37test_result(current);3839/* Do not return in case GCS was enabled */40exit(current->result);41}424344