Subversion Repositories HelenOS-historic

Rev

Rev 309 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 309 Rev 326
Line 43... Line 43...
43
        );
43
        );
44
}
44
}
45
 
45
 
46
void fpu_context_restore(fpu_context_t *fctx)
46
void fpu_context_restore(fpu_context_t *fctx)
47
{
47
{
48
    /* TODO: We need malloc that allocates on 16-byte boundary !! */
48
    /* Align on 16-byte boundary */
49
    if (((__u64)fctx) & 0xf)
49
    if (((__u64)fctx) & 0xf)
50
        fctx = (fpu_context_t *)((((__u64)fctx) | 0xf) + 1);
50
        fctx = (fpu_context_t *)((((__u64)fctx) | 0xf) + 1);
51
    __asm__ volatile (
51
    __asm__ volatile (
52
        "fxrstor %0"
52
        "fxrstor %0"
53
        : "=m"(*fctx)
53
        : "=m"(*fctx)
54
        );
54
        );
55
}
55
}
56
 
56
 
57
void fpu_init(void)
57
void fpu_init(void)
58
{
58
{
-
 
59
    /* TODO: Zero all SSE, MMX etc. registers */
59
    __asm__ volatile (
60
    __asm__ volatile (
60
        "fninit;"
61
        "fninit;"
61
    );
62
    );
62
}
63
}