4 * Open Hack'Ware BIOS errno management
6 * Copyright (c) 2004-2005 Jocelyn Mayer
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License V2
10 * as published by the Free Software Foundation
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #if !defined (__OHW_ERRNO_H__)
22 #define __OHW_ERRNO_H__
28 extern struct task cur_task
;
30 void *get_current_stack (void);
32 static inline int *errno_location (void)
38 taskp
= get_current_stack();
42 return &cur_task
.errno
;
46 static inline void set_errno (int errnum
)
48 *(errno_location()) = errnum
;
51 static inline int get_errno (void)
53 return *(errno_location());
56 #define errno get_errno()
62 #endif /* !defined (__OHW_ERRNO_H__) */