X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Kernel%2Finclude%2Fbinary.h;h=fe80f5b0c60b6e559e846c217d5842afe352fce3;hb=1c2a87ec67d332b6a165c79398693eac1eb1166e;hp=ed163bd00e6087c8f019b3f2495f82179ed9ce20;hpb=1e7db40300bc594cf708bb6082a6e05a268da946;p=tpg%2Facess2.git diff --git a/Kernel/include/binary.h b/Kernel/include/binary.h index ed163bd0..fe80f5b0 100644 --- a/Kernel/include/binary.h +++ b/Kernel/include/binary.h @@ -7,6 +7,33 @@ #define _BINARY_H // === TYPES === +typedef struct sBinaryPage +{ + /** + * \brief Physical address, or file offset + * + * Physical address of this page or, when the file is not yet + * loaded, this is a file offset (or -1 for uninitialised data) + */ + tPAddr Physical; + tVAddr Virtual; //!< Virtual load address + Uint16 Size; //!< Number of bytes to load from the file + Uint16 Flags; //!< Load Flags +} __attribute__ ((packed)) tBinaryPage; + +/** + * \brief Flags for ::tBinaryPage.Flags + * \name Binary Page Flags + * \{ + */ +//! \brief Read-only +#define BIN_PAGEFLAG_RO 0x0001 +//! \brief Executable +#define BIN_PAGEFLAG_EXEC 0x0002 +/** + * \} + */ + /** * \brief Defines a binary file * @@ -57,18 +84,7 @@ typedef struct sBinary * \brief Array of pages defined by this binary * \note Contains \a NumPages entries */ - struct { - /** - * \brief Physical address, or file offset - * - * Physical address of this page or, when the file is not yet - * loaded, this is a file offset (or -1 for uninitialised data) - */ - tPAddr Physical; - tVAddr Virtual; //!< Virtual load address - Uint16 Size; //!< Number of bytes to load from the file - Uint16 Flags; //!< Load Flags - } Pages[]; + tBinaryPage Pages[]; } tBinary; /** @@ -141,4 +157,6 @@ typedef struct sBinaryType */ extern char *Binary_RegInterp(char *Path); +extern int Binary_RegisterType(tBinaryType *Type); + #endif