⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 loader.h

📁 一个操作系统源代码 用于嵌入式设备 在Vc++环境下仿真 成功移植到多款处理器上
💻 H
字号:
/*
 * Copyright (c) 1998-2001 Sun Microsystems, Inc. All Rights Reserved.
 * 
 * This software is the confidential and proprietary information of Sun
 * Microsystems, Inc. ("Confidential Information").  You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into
 * with Sun.
 * 
 * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
 * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
 * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
 * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
 * THIS SOFTWARE OR ITS DERIVATIVES.
 * 
 */

/*=========================================================================
 * SYSTEM:    KVM
 * SUBSYSTEM: Class loader
 * FILE:      loader.h
 * OVERVIEW:  Internal definitions needed for loading 
 *            Java class files (class loader). 
 * AUTHOR:    Antero Taivalsaari, Sun Labs
 *            Sheng Liang, Frank Yellin, many others...
 *=======================================================================*/

/*=========================================================================
 * COMMENTS:
 * This file defines a JVM Specification compliant classfile reader.
 * It is capable of reading any standard Java classfile, and generating
 * the necessary corresponding VM runtime structures.
 *=======================================================================*/

/*=========================================================================
 * Include files
 *=======================================================================*/

/*=========================================================================
 * Definitions and declarations
 *=======================================================================*/

extern char* UserClassPath; /* set in main() or elsewhere */

#ifndef PATH_SEPARATOR
#   define PATH_SEPARATOR ':'
#endif

/*=========================================================================
 * Classfile loading data structures
 *=======================================================================*/

/*  This structure is used for referring to open "files" when  */
/*  loading Java classfiles from the storage system of the host */
/*  operating system. It replaces the standard FILE* structure */
/*  used in C program. We need our own structure, since many of */
/*  our target devices don't have a regular file system. */

/*  FILEPOINTER */
struct filePointerStruct;

#define SIZEOF_FILEPOINTER       StructSizeInCells(filePointerStruct)

/*=========================================================================
 * Class file verification operations (performed during class loading)
 *=======================================================================*/

enum verifyName_type {LegalMethod, LegalField, LegalClass};
bool_t verifyName(const char* name, enum verifyName_type, bool_t abortOnError);

/*=========================================================================
 * Class loading operations
 *=======================================================================*/

void loadClassfile(INSTANCE_CLASS CurrentClass, bool_t fatalErrorIfFail);
void loadArrayClass(ARRAY_CLASS);

/*=========================================================================
 * Generic class file reading operations
 *=======================================================================*/

/*
 * NOTE: The functions below define an abstract interface for
 * reading data from class files.  The actual implementations
 * of these functions are platform-dependent, and therefore are
 * not provided in VmCommon. An implementation of these functions
 * must be provided for each platform. A sample implementation 
 * can be found in VmExtra/src/loaderFile.c.
 */
int            loadByteNoEOFCheck(FILEPOINTER_HANDLE);
unsigned char  loadByte(FILEPOINTER_HANDLE);
unsigned short loadShort(FILEPOINTER_HANDLE);
unsigned long  loadCell(FILEPOINTER_HANDLE);
void           loadBytes(FILEPOINTER_HANDLE, char *buffer, int length);
void           skipBytes(FILEPOINTER_HANDLE, unsigned int i);

void           InitializeClassLoading(void);
void           FinalizeClassLoading();

FILEPOINTER    openClassfile(INSTANCE_CLASS clazz);
FILEPOINTER    openResourcefile(BYTES resourceName);
void           closeClassfile(FILEPOINTER_HANDLE);

/*=========================================================================
 * Helper functions
 *=======================================================================*/

char* replaceLetters(char* string, char c1, char c2);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -