aboutsummaryrefslogtreecommitdiff
path: root/lib/include/common.h
blob: 5ea605010a3480a6085ff3203ecb5564f36f4c56 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// Copyright (c) 2020 Johannes Stoelp

#pragma once

#include "io.h"
#include "syscall.h"

#include <asm/unistd.h>

#define ERROR_ON(cond, ...)         \
    do {                            \
        if ((cond)) {               \
            efmt(__VA_ARGS__);      \
            syscall1(__NR_exit, 1); \
        }                           \
    } while (0)