Changeset 8fc0d455 in mainline


Ignore:
Timestamp:
2005-08-30T17:50:07Z (19 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
9c0a9b3
Parents:
b45aa23
Message:

Code cleanup.

Location:
arch/amd64
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • arch/amd64/_link.ld

    rb45aa23 r8fc0d455  
    4141        _hardcoded_kdata_size = kdata_end - kdata_start + (unmapped_kdata_end - unmapped_kdata_start);
    4242        _hardcoded_load_address = 0xffffffff80008000;
    43         _ka_start = 0xffffffff80000000;
    4443}
  • arch/amd64/include/barrier.h

    rb45aa23 r8fc0d455  
    2727 */
    2828
    29 #ifndef __ppc_BARRIER_H__
    30 #define __ppc_BARRIER_H__
     29#ifndef __amd64_BARRIER_H__
     30#define __amd64_BARRIER_H__
    3131
    3232#define CS_ENTER_BARRIER()      __asm__ volatile ("" ::: "memory")
  • arch/amd64/include/boot/memmap.h

    rb45aa23 r8fc0d455  
    2727 */
    2828
    29 #ifndef __ia32_MEMMAP_H__
    30 #define __ia32_MEMMAP_H__
     29#ifndef __amd64_MEMMAP_H__
     30#define __amd64_MEMMAP_H__
    3131
    3232
  • arch/amd64/include/boot/memmapasm.h

    rb45aa23 r8fc0d455  
    2727 */
    2828
    29 #ifndef __ia32_MEMMAPASM_H__
    30 #define __ia32_MEMMAPASM_H__
     29#ifndef __amd64_MEMMAPASM_H__
     30#define __amd64_MEMMAPASM_H__
    3131
    3232
  • arch/amd64/include/interrupt.h

    rb45aa23 r8fc0d455  
    2727 */
    2828
    29 #ifndef __INTERRUPT_H__
    30 #define __INTERRUPT_H__
     29#ifndef __amd64_INTERRUPT_H__
     30#define __amd64_INTERRUPT_H__
    3131
    3232extern void interrupt(void);
  • arch/amd64/include/mm/frame.h

    rb45aa23 r8fc0d455  
    3232#define FRAME_SIZE              4096
    3333
     34#ifndef __ASM__
    3435extern void frame_arch_init(void);
     36#endif
    3537
    3638#endif
  • arch/amd64/include/mm/page.h

    rb45aa23 r8fc0d455  
    3030#define __amd64_PAGE_H__
    3131
    32 #include <mm/page.h>
    33 #include <arch/mm/frame.h>
    34 #include <arch/types.h>
    35 #include <arch/mm/ptl.h>
     32#ifndef __ASM__
     33#  include <mm/page.h>
     34#  include <arch/mm/frame.h>
     35#  include <arch/types.h>
     36#endif
    3637
    3738#define PAGE_SIZE       FRAME_SIZE
     39
     40#ifndef __ASM__
     41# define KA2PA(x)       (((__address) (x)) + 0x80000000)
     42# define PA2KA(x)       (((__address) (x)) - 0x80000000)
     43#else
     44# define KA2PA(x)       ((x) + 0x80000000)
     45# define PA2KA(x)       ((x)) - 0x80000000)
     46#endif
    3847
    3948#define PTL0_INDEX_ARCH(vaddr)          0
     
    6574#define SET_FRAME_FLAGS_ARCH(ptl3, i, x)
    6675
     76#ifndef __ASM__
    6777extern void page_arch_init(void);
    6878
    69 typedef __u32 pte_t;
     79typedef __u64 pte_t;
     80#endif
    7081
    7182#endif
  • arch/amd64/include/mm/ptl.h

    rb45aa23 r8fc0d455  
    4040#define PTL_2MB_PAGE      (1<<7)
    4141
    42 #define KA2PA(x)        (((__address) (x)) + 0x80000000)
    43 #define PA2KA(x)        (((__address) (x)) - 0x80000000)
    44 
    4542
    4643#endif
  • arch/amd64/include/pm.h

    rb45aa23 r8fc0d455  
    2727 */
    2828
    29 #ifndef __PM_H__
    30 #define __PM_H__
     29#ifndef __amd64_PM_H__
     30#define __amd64_PM_H__
    3131
    32 #include <arch/types.h>
    33 #include <typedefs.h>
    34 #include <arch/context.h>
     32#ifndef __ASM__
     33# include <arch/types.h>
     34# include <typedefs.h>
     35# include <arch/context.h>
     36#endif
    3537
    3638#define IDT_ITEMS 64
     
    4244#define UTEXT_DES       3
    4345#define UDATA_DES       4
    44 #define TSS_DES         5
     46#define KTEXT32_DES     5
     47#define TSS_DES         6
    4548
    4649#define selector(des)   ((des)<<3)
     
    6164
    6265#define IO_MAP_BASE     (104)
     66
     67#ifndef __ASM__
    6368
    6469struct ptr_16_32 {
     
    146151extern void tss_initialize(struct tss *t);
    147152
     153#endif /* __ASM__ */
     154
    148155#endif
  • arch/amd64/src/boot/boot.S

    rb45aa23 r8fc0d455  
    11#
    2 # Copyright (C) 2001-2004 Jakub Jermar
     2# Copyright (C) 2001-2004 Ondrej Palkovsky
    33# All rights reserved.
    44#
     
    2727#
    2828
     29#define __ASM__
     30
     31#include <arch/mm/page.h>       
    2932#include <arch/mm/ptl.h>
     33#include <arch/pm.h>
    3034
    3135#define START_STACK     0x7c00 
     
    5256#       call memmap_arch_init
    5357       
    54         mov $0x80000000, %eax 
     58        movl $0x80000000, %eax 
    5559        cpuid
    5660        cmp $0x80000000, %eax   # any function > 80000000h?
    5761        jbe no_long_mode
    58         mov $0x80000001, %eax   # Extended function code 80000001
     62        movl $0x80000001, %eax  # Extended function code 80000001
    5963        cpuid
    6064        bt $29, %edx            # Test if long mode is supported.
     
    6973        movl %eax,%cr0                  # switch to protected mode
    7074
    71         jmpl $40, $now_in_prot
     75        jmpl $selector(KTEXT32_DES), $now_in_prot
    7276
    7377no_long_mode:
     
    7983now_in_prot: 
    8084        # Set up stack & data descriptors
    81         movw $16, %ax
     85        movw $selector(KDATA_DES), %ax
    8286        movw %ax, %ds
    8387        movw %ax, %fs
     
    107111       
    108112        # At this point we are in compatibility mode
    109         jmpl $8, $start64
     113        jmpl $selector(KTEXT_DES), $start64
    110114
    111115.code64
     
    150154.global gdtr_inst                               
    151155gdtr_inst:
    152         .word 7*8  # GDT_ITEMS * 8
    153         .long gdt + 0x80000000
     156        .word selector(GDT_ITEMS)
     157        .long KA2PA(gdt)
    154158
    155159.global idtr_inst
    156160idtr_inst:
    157161        .word 0
    158         .long idt + 0x80000000
     162        .long KA2PA(idt)
Note: See TracChangeset for help on using the changeset viewer.