# SFBHWMisc.h

Go to the documentation of this file.

    00001 /*
    00002   SFBHWMisc.h Miscellaneous hardware-specific routines
    00003   Copyright (C) 2009 The Regents of the University of New Mexico
    00004
    00005   This library is free software; you can redistribute it and/or
    00006   modify it under the terms of the GNU Lesser General Public
    00007   License as published by the Free Software Foundation; either
    00008   version 2.1 of the License, or (at your option) any later version.
    00009
    00010   This library is distributed in the hope that it will be useful,
    00011   but WITHOUT ANY WARRANTY; without even the implied warranty of
    00012   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    00013   Lesser General Public License for more details.
    00014
    00015   You should have received a copy of the GNU General Public License
    00016   along with this library; if not, write to the Free Software
    00017   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
    00018   USA
    00019
    00020   $Id$
    00021  */
    00029 #ifndef SFBHWMISC_H
    00030 #define SFBHWMISC_H
    00031
    00032 #include "SFBTypes.h"
    00033
    00041 extern void facePrintTimestamp(u8 face) ;
    00042
    00056 extern u32 getCurrentStackSpace();
    00057
    00110 extern u32 getMinimumStackSpace();
    00111
    00112 #define STACK_CANARY_VALUE 0x2c50904e
    00113
    00114 extern volatile u32 stackCanary;
    00115
    00116 static inline void init_stack_canary() { stackCanary = STACK_CANARY_VALUE; }
    00117
    00118 #define API_ASSERT_STACK_OK() API_ASSERT(stackCanary==STACK_CANARY_VALUE,E_BUG_STACK_CORRUPT)
    00119
    00120 #ifdef HOST_MODE
    00121
    00122 #define disableInterrupts() /* empty */
    00123 #define enableInterrupts() /* empty */
    00124
    00125 #define suspendInterrupts(u32var) /* empty */
    00126 #define restoreInterrupts(u32var) ((u32var) = 0)   /* note that suspend w/o restore will warn! */
    00127
    00128 #else
    00129
    00130 #include "lpc/irq.h"
    00131
    00132 #endif /* HOST_MODE */
    00133
    00134 #endif /* HW_MISC_H */