Subversion Repositories shark

Rev

Rev 3 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 pj 1
/* Project:     OSLib
2
 * Description: The OS Construction Kit
3
 * Date:                1.6.2000
4
 * Idea by:             Luca Abeni & Gerardo Lamastra
5
 *
6
 * OSLib is an SO project aimed at developing a common, easy-to-use
7
 * low-level infrastructure for developing OS kernels and Embedded
8
 * Applications; it partially derives from the HARTIK project but it
9
 * currently is independently developed.
10
 *
11
 * OSLib is distributed under GPL License, and some of its code has
12
 * been derived from the Linux kernel source; also some important
13
 * ideas come from studying the DJGPP go32 extender.
14
 *
15
 * We acknowledge the Linux Community, Free Software Foundation,
16
 * D.J. Delorie and all the other developers who believe in the
17
 * freedom of software and ideas.
18
 *
19
 * For legalese, check out the included GPL license.
20
 */
21
 
22
/*      Context switch code     */
23
 
24
#include <ll/i386/hw-data.h>
25
#include <ll/i386/hw-func.h>
26
#include <ll/i386/tss-ctx.h>
27
 
40 pj 28
FILE(Context-Switch);
2 pj 29
 
30
extern unsigned short int currCtx;
31
#ifdef __VIRCSW__
32
extern int activeInt;
33
#endif
34
 
35
extern void context_load(CONTEXT c);
36
 
37
void ll_context_to(CONTEXT c)
38
{
39
#ifdef __VIRCSW__
40 pj 40
        currCtx = c;
41
        if (activeInt == 0) {
42
                context_load(c);
43
        }
44
#else
45
        currCtx = c;
2 pj 46
        context_load(c);
47
#endif
48
}
49
CONTEXT ll_context_from(void)
50
{
51
#ifdef __VIRCSW__
40 pj 52
        return currCtx;
2 pj 53
#else
40 pj 54
        return context_save();
2 pj 55
#endif
56
}
57
 
58
CONTEXT ll_context_save(void)
59
{
40 pj 60
        return currCtx;
2 pj 61
}
62
 
63
void ll_context_load(CONTEXT c)
64
{
40 pj 65
        currCtx = c;
66
        context_load(c);
2 pj 67
}