]> Git Repo - J-u-boot.git/blame - include/errno.h
Merge tag 'u-boot-atmel-2021.10-a' of https://source.denx.de/u-boot/custodians/u...
[J-u-boot.git] / include / errno.h
CommitLineData
83d290c5 1/* SPDX-License-Identifier: GPL-2.0+ */
00e9e6d1
SG
2/*
3 * Copyright (C) 2014 Samsung Electronics
4 * Przemyslaw Marczak <[email protected]>
00e9e6d1 5 */
65cd3fa8 6#ifndef _ERRNO_H
00e9e6d1 7#define _ERRNO_H
65cd3fa8 8
5d97dff0 9#include <linux/errno.h>
65cd3fa8 10
be1e77f2
MB
11#ifdef __SANDBOX__
12#define __errno_asm_label asm("__u_boot_errno")
13#else
14#define __errno_asm_label
15#endif
16
17extern int errno __errno_asm_label;
65cd3fa8
WD
18
19#define __set_errno(val) do { errno = val; } while (0)
20
f279e1d9
HS
21/**
22 * errno_str() - get description for error number
23 *
24 * @errno: error number (negative in case of error)
25 * Return: string describing the error. If CONFIG_ERRNO_STR is not
26 * defined an empty string is returned.
27 */
59345b1f
PM
28#ifdef CONFIG_ERRNO_STR
29const char *errno_str(int errno);
862887d8 30#else
f279e1d9
HS
31static const char error_message[] = "";
32
862887d8
SG
33static inline const char *errno_str(int errno)
34{
f279e1d9 35 return error_message;
862887d8 36}
59345b1f 37#endif
65cd3fa8 38#endif /* _ERRNO_H */
This page took 0.538543 seconds and 4 git commands to generate.