cfe_api.h
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:3k
源码类别:

Linux/Unix编程

开发平台:

Unix_Linux

  1. /*
  2.  * Copyright (C) 2000, 2001 Broadcom Corporation
  3.  *
  4.  * This program is free software; you can redistribute it and/or
  5.  * modify it under the terms of the GNU General Public License
  6.  * as published by the Free Software Foundation; either version 2
  7.  * of the License, or (at your option) any later version.
  8.  *
  9.  * This program is distributed in the hope that it will be useful,
  10.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12.  * GNU General Public License for more details.
  13.  *
  14.  * You should have received a copy of the GNU General Public License
  15.  * along with this program; if not, write to the Free Software
  16.  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  17.  */
  18. /*  *********************************************************************
  19.     *  Broadcom Common Firmware Environment (CFE)
  20.     *
  21.     *  Device function prototypes File: cfe_api.h
  22.     *
  23.     *  This module contains prototypes for cfe_devfuncs.c, a set
  24.     *  of wrapper routines to the IOCB interface.  This file,
  25.     *  along with cfe_api.c, can be incorporated into programs
  26.     *  that need to call CFE.
  27.     *
  28.     *  Author:  Mitch Lichtenberg (mpl@broadcom.com)
  29.     *
  30.     ********************************************************************* */
  31. #include <linux/config.h>
  32. #define CFE_EPTSEAL 0x43464531
  33. #ifdef CONFIG_MIPS_UNCACHED
  34. #define CFE_APIENTRY    0xBFC00500
  35. #define CFE_APISEAL     0xBFC004E0
  36. #define CFE_APISEAL_RE  0xBFC004E8
  37. #define CFE_APISEAL_OLD 0xBFC00508
  38. #else
  39. #define CFE_APIENTRY    0x9FC00500
  40. #define CFE_APISEAL     0x9FC004E0
  41. #define CFE_APISEAL_RE  0x9FC004E8
  42. #define CFE_APISEAL_OLD 0x9FC00508
  43. #endif
  44. #ifndef __ASSEMBLER__
  45. int cfe_init(cfe_xuint_t handle);
  46. int cfe_open(char *name);
  47. int cfe_close(int handle);
  48. int cfe_readblk(int handle,cfe_xint_t offset,unsigned char *buffer,int length);
  49. int cfe_read(int handle,unsigned char *buffer,int length);
  50. int cfe_writeblk(int handle,cfe_xint_t offset,unsigned char *buffer,int length);
  51. int cfe_write(int handle,unsigned char *buffer,int length);
  52. int cfe_ioctl(int handle,unsigned int ioctlnum,unsigned char *buffer,int length,int *retlen);
  53. int cfe_inpstat(int handle);
  54. int cfe_enumenv(int idx,char *name,int namelen,char *val,int vallen);
  55. int cfe_enummem(long idx, unsigned long long *addr, unsigned long long *size, long *type);
  56. int cfe_setenv(char *name,char *val);
  57. int cfe_getenv(char *name,char *dest,int destlen);
  58. long long cfe_getticks(void);
  59. int cfe_exit(int warm, int status);
  60. int cfe_flushcache(int flg);
  61. int cfe_getstdhandle(int flg);
  62. int cfe_start_cpu(int cpu, void (*fn)(void), long sp, long gp, long a1);
  63. int cfe_stop_cpu(int cpu);
  64. void cfe_open_console(void);
  65. void cfe_console_print(const char *, int);
  66. #endif