1 |
/* CPU register definitions and inline functions. |
/* CPU register definitions and inline functions. |
2 |
Copyright 1999, 2000, 2001 Johan Rydberg, jrydberg@opencores.org. |
Copyright 1999, 2000, 2001, 2002 Johan Rydberg, jrydberg@opencores.org. |
3 |
|
|
4 |
This program is free software; you can redistribute it and/or modify |
This program is free software; you can redistribute it and/or modify |
5 |
it under the terms of the GNU General Public License as published by |
it under the terms of the GNU General Public License as published by |
44 |
return value; |
return value; |
45 |
} |
} |
46 |
|
|
47 |
|
static __inline__ void set_cr4 (void *cr4) |
48 |
|
{ |
49 |
|
register unsigned int value = (unsigned int) cr4; |
50 |
|
__asm__ __volatile__ ("mov %0, %%cr4" :: "r" (value)); |
51 |
|
} |
52 |
|
|
53 |
|
static __inline__ unsigned int get_cr4 (void) |
54 |
|
{ |
55 |
|
register unsigned int value; |
56 |
|
__asm__ __volatile__ ("mov %%cr4, %0" : "=r" (value)); |
57 |
|
return value; |
58 |
|
} |
59 |
|
|
60 |
static __inline__ unsigned int get_esp (void) |
static __inline__ unsigned int get_esp (void) |
61 |
{ |
{ |
62 |
register unsigned int value; |
register unsigned int value; |