Ejemplo n.º 1
0
/* do_tell for stdio xfiles */
static afs_uint32
xf_FILE_do_tell(XFILE * X, dt_uint64 * offset)
{
    FILE *F = X->refcon;
    off_t where;

    where = ftell(F);
    if (where == -1)
	return errno;
    set64(*offset, where);
    return 0;
}
Ejemplo n.º 2
0
Archivo: gdt.cpp Proyecto: B-Rich/NOVA
void Gdt::build()
{
#ifdef __i386__
    Size s = BIT_32;
    bool l = false;
#else
    Size s = BIT_16;
    bool l = true;
#endif
    gdt[SEL_KERN_CODE   >> 3].set32 (CODE_XRA, PAGES, s, l, 0, 0, ~0ul);
    gdt[SEL_KERN_DATA   >> 3].set32 (DATA_RWA, PAGES, s, l, 0, 0, ~0ul);

    gdt[SEL_USER_CODE   >> 3].set32 (CODE_XRA, PAGES, s, l, 3, 0, ~0ul);
    gdt[SEL_USER_DATA   >> 3].set32 (DATA_RWA, PAGES, s, l, 3, 0, ~0ul);
    gdt[SEL_USER_CODE_L >> 3].set32 (CODE_XRA, PAGES, s, l, 3, 0, ~0ul);

#ifdef __i386__
    gdt[SEL_TSS_RUN >> 3].set32 (SYS_TSS, BYTES, BIT_16, false, 0, reinterpret_cast<mword>(&Tss::run), SPC_LOCAL_IOP_E - reinterpret_cast<mword>(&Tss::run));
    gdt[SEL_TSS_DBF >> 3].set32 (SYS_TSS, BYTES, BIT_16, false, 0, reinterpret_cast<mword>(&Tss::dbf), sizeof (Tss) - 1);
#else
    gdt[SEL_TSS_RUN >> 3].set64 (SYS_TSS, BYTES, BIT_16, false, 0, reinterpret_cast<mword>(&Tss::run), SPC_LOCAL_IOP_E - reinterpret_cast<mword>(&Tss::run));
    gdt[SEL_TSS_DBF >> 3].set64 (SYS_TSS, BYTES, BIT_16, false, 0, reinterpret_cast<mword>(&Tss::dbf), sizeof (Tss) - 1);
#endif
}
Ejemplo n.º 3
0
 void setLong(uint8_t index, int64_t value){
   set64(index, (uint8_t*)&value);
 }
Ejemplo n.º 4
0
 void setDouble(uint8_t index, double value){
   set64(index, (uint8_t*)&value);
 }