/*
Copyright (C) 2008, 2009  GE Intelligent Platforms, Inc
 
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
 
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
 
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
*/

/* osIf - OS wrapper functions */

/*
   Copyright (c) 2001-2004 by Ample Communications
   All rights reserved.
*/

#ifndef __OSIF_H__
#define __OSIF_H__

#ifdef CONFIG_OCTEON_AT5810
#include <common.h>
#include <config.h>
#include <command.h>

#ifndef PRIVATE
#define PRIVATE
#endif

#ifndef OK
#define OK     0
#endif

#ifndef ERROR
#define ERROR  (-1)
#endif

#define BIT_0                   (1 << 0)
#define BIT_1                   (1 << 1)
#define BIT_2                   (1 << 2)
#define BIT_3                   (1 << 3)
#define BIT_4                   (1 << 4)
#define BIT_5                   (1 << 5)
#define BIT_6                   (1 << 6)
#define BIT_7                   (1 << 7)
#define BIT_8                   (1 << 8)
#define BIT_9                   (1 << 9)
#define BIT_10                  (1 << 10)
#define BIT_11                  (1 << 11)
#define BIT_12                  (1 << 12)
#define BIT_13                  (1 << 13)
#define BIT_14                  (1 << 14)
#define BIT_15                  (1 << 15)
#define BIT_16                  (1 << 16)
#define BIT_17                  (1 << 17)
#define BIT_18                  (1 << 18)
#define BIT_19                  (1 << 19)
#define BIT_20                  (1 << 20)
#define BIT_21                  (1 << 21)
#define BIT_22                  (1 << 22)
#define BIT_23                  (1 << 23)
#define BIT_24                  (1 << 24)
#define BIT_25                  (1 << 25)
#define BIT_26                  (1 << 26)
#define BIT_27                  (1 << 27)
#define BIT_28                  (1 << 28)
#define BIT_29                  (1 << 29)
#define BIT_30                  (1 << 30)
#define BIT_31                  (1 << 31)
#else
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include <assert.h>
#endif

/* #include "systypes.h" */

#ifdef LINUX
#define osDelay(x)                  /* define os delay here */
#define osPrintf(fmt, args...)      printf(fmt, ## args)
#define osErrmsg(fmt, args...)      printf("ERROR: "); printf(fmt, ## args)
#define osGetchar()                 getchar()
#else
#define osDelay(x)                  /* define os delay here */
#define osPrintf                    printf
#define osErrmsg                    printf
#define osGetchar()                 getchar()
#endif /* LINUX */

#endif /* __OSIF_H__ */
