|
| 1 | +/* |
| 2 | + * Copyright (C) 2024 Philippe Aubertin. |
| 3 | + * All rights reserved. |
| 4 | +
|
| 5 | + * Redistribution and use in source and binary forms, with or without |
| 6 | + * modification, are permitted provided that the following conditions |
| 7 | + * are met: |
| 8 | + * |
| 9 | + * 1. Redistributions of source code must retain the above copyright |
| 10 | + * notice, this list of conditions and the following disclaimer. |
| 11 | + * |
| 12 | + * 2. Redistributions in binary form must reproduce the above copyright |
| 13 | + * notice, this list of conditions and the following disclaimer in the |
| 14 | + * documentation and/or other materials provided with the distribution. |
| 15 | + * |
| 16 | + * 3. Neither the name of the author nor the names of other contributors |
| 17 | + * may be used to endorse or promote products derived from this software |
| 18 | + * without specific prior written permission. |
| 19 | + * |
| 20 | + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND |
| 21 | + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| 22 | + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 23 | + * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY |
| 24 | + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
| 25 | + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
| 26 | + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
| 27 | + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 28 | + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
| 29 | + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 30 | + */ |
| 31 | + |
| 32 | +#ifndef JINUE_KERNEL_INFRASTRUCTURE_I686_ASM_PERCPU_H |
| 33 | +#define JINUE_KERNEL_INFRASTRUCTURE_I686_ASM_PERCPU_H |
| 34 | + |
| 35 | +#include <kernel/infrastructure/i686/asm/descriptors.h> |
| 36 | + |
| 37 | +/* The PERCPU_OFFSET_... definitions here must match the offsets in the |
| 38 | + * percpu_t struct. They are used by assembly language code that can't use the |
| 39 | + * struct definition. */ |
| 40 | + |
| 41 | +#define PERCPU_OFFSET_GDT 8 |
| 42 | + |
| 43 | +#define PERCPU_OFFSET_TSS (PERCPU_OFFSET_GDT + 8 * GDT_NUM_ENTRIES) |
| 44 | + |
| 45 | +#endif |
0 commit comments