ciao a tutti
come da oggetto vorrei sapere cosa servono i file .e nell' linguaggio C.
ciao a tutti
come da oggetto vorrei sapere cosa servono i file .e nell' linguaggio C.
Non mi risulta che si impieghino file .e in C.
Amaro C++, il gusto pieno dell'undefined behavior.
Neanch'io credo che i file con estensione (con la s) .e abbiano a che fare con il C ...
Facci vedere il contenuto ...
No MP tecnici (non rispondo nemmeno!), usa il forum.
mi serve per un progetto. Da quello che ho capito e mi sembra dal codice i file .e sono come delle interfaccie.
Allego il codice. Ditemi se è giusta la mia idea.
/* File: $Id: libmps.e,v 0.10 1997/10/28 08:40:02 morsiani Exp $ */
/************************************************** **************************
*
* External declarations for mps library module.
*
************************************************** **************************/
/* Functions valid in user mode
*/
/* This function cause a system call trap
*/
extern unsigned int SYSCALL(unsigned int number);
/* These functions return respectively the high and low part of system
* clock
*/
extern unsigned int getTODHI(void);
extern unsigned int getTODLO(void);
extern unsigned int getTIMESCALE(void);
/* All these functions access CP0 registers.
* Access to CP0 registers is always possible in kernel mode, or in user
* mode with CPU 0 bit _set_ in STATUS register
*/
extern unsigned int getINDEX(void);
extern unsigned int getRANDOM(void);
extern unsigned int getENTRYLO(void);
extern unsigned int getCONTEXT(void);
extern unsigned int getBADVADDR(void);
extern unsigned int getENTRYHI(void);
extern unsigned int getSTATUS(void);
extern unsigned int getCAUSE(void);
extern unsigned int getEPC(void);
extern unsigned int getPRID(void);
/* Only some of CP0 register are R/W: handling requires care.
* All functions return the value in register after write
*/
extern unsigned int setINDEX(unsigned int index);
extern unsigned int setENTRYLO(unsigned int entry);
extern unsigned int setCONTEXT(unsigned int context);
extern unsigned int setENTRYHI(unsigned int entry);
extern unsigned int setSTATUS(unsigned int entry);
extern unsigned int setCAUSE(unsigned int cause);
/* All TLB operations require BIOS intervention: these functions produce a
* program trap if executed in user mode without CPU0 bit _set_
*/
/* These functions return 1 if operation was successful, 0 if not
* (BIOS has its ways to protect itself from unwary programmers)
*/
extern unsigned int TLBWR(unsigned int entryHI, unsigned int entryLO);
extern unsigned int TLBWI(unsigned int entryHI, unsigned int entryLO, unsigned int index);
/* this function returns TLB index (0..63, in INDEX format) that match
* request: if entry searched for is not found, the Pbit will be on
*/
extern int TLBP(unsigned int entryHI, unsigned int entryLO);
/* these functions return the HI and LO parts of TLB entry at index
* (0..63, in INDEX format)
*/
extern int TLBRHI(unsigned int index);
extern int TLBRLO(unsigned int index);
/* This function requires BIOS intervention, and is valid _only_ in kernel
* mode: otherwise it causes a program trap. It may be used to start
* a new process
*/
/* This function load a processor state from memory: there is no valid
* return value. New process may use status, procid and pc as actual
* arguments if call is carefully built, since $4, $5, and $6 (a0, a1, a2)
* registers are not loaded from memory, but are passed as they are to
* new process. $7 (a3) is available for additional argument passing to
* new process.
* Keep in mind that $2 (v0) register is used by routine itself and it is
* not loaded from memory image nor have a meaningful starting value for the
* new process this routine starts.
*
* This is NOT an atomic operation: the processor state is loaded register
* by register from memory, and at the end a BIOS routine will be called to
* load the critical STATUS, ASID+CONTEXT and PC registers in one atomic
* operation: so, this call is interruptible (in a clean way) or cause a
* trap (for example, a memory access error if pointer is not correctly
* set).
* If called from user state, it will trap ONLY at BIOS call, loading the
* general registers with new/random values (if no other errors intervene);
* this will corrupt the calling process state, but it does not harm system
* security a bit (I thought I said you to use it only in kernel mode...)
*/
extern unsigned int LDST(unsigned int procid, unsigned int status, unsigned int pc, state_t * statep);
/* This function may be called from kernel or from user mode with CPU 0
* STATUS bit _on_: otherwise, it will cause a trap
*/
/* This function stores processor state to memory. It intentionally leaves
* the PC field set to 0; putting a meaningful value there is programmer's
* task.
* Return value is PC value for the instruction immediately following
* the call.
* This too is NOT an atomic operation: the processor state is saved
* register by register to memory. So, this call is interruptible (in a
* clean way) or cause a trap (for example, an memory access error if
* pointer is not correctly set).
* If called from user state, it will trap ONLY if CPU 0 bit of STATUS CP0
* register is NOT set, and only when access to CP0 register (STATUS, ENTRYHI
* and CONTEXT) is requested (if no other errors intervene).
* However, trying it does not harm system security a bit.
*/
extern unsigned int STST(state_t * statep);
/* These functions are used to restart an interrupted/blocked process,
* reloading it from a vector OLD area. They are available only in kernel
* mode, thru a BIOS routine (otherwise they cause a trap). They
* update processor status _completely_, in one atomic operation.
* They have no meaningful return value: $2 (v0) register is used for
* BIOS call, but it is reloaded too.
* Remember that it is programmer's task to increment OLD area PC where
* needed (e.g. syscall handling)
*/
extern unsigned int INTRESTART(void);
extern unsigned int TLBRESTART(void);
extern unsigned int PRGRESTART(void);
extern unsigned int SYSRESTART(void);
/* This function stops the system printing a warning message on terminal 0
*/
extern void PANIC(void);
/* This function halts the system printing a regular shutdown message on
* terminal 0
*/
extern void HALT(void);
Ha tutta l'aria di essere un file di header, ma non ho idea del motivo per cui ha estensione .e.
Amaro C++, il gusto pieno dell'undefined behavior.
Sì ... ma basterebbe chiederlo al docente (Mauro Morsiani) dell'uni di bologna ... e al suo progetto
http://sourceforge.net/project/membe...roup_id=102454
No MP tecnici (non rispondo nemmeno!), usa il forum.