Changeset 7df54df in mainline for arch/amd64/src


Ignore:
Timestamp:
2005-09-02T14:00:48Z (20 years ago)
Author:
Ondrej Palkovsky <ondrap@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
32f6e1bd
Parents:
73838ed
Message:

Fixed stack settings in boot.S in real mode.
Added ia32 memmap support.
Added cpuid support.

Location:
arch/amd64/src
Files:
1 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • arch/amd64/src/amd64.c

    r73838ed r7df54df  
    3939
    4040#include <arch/bios/bios.h>
     41#include <arch/mm/memory_init.h>
    4142
    4243void arch_pre_mm_init(void)
     
    6566        }
    6667}
     68
     69void arch_late_init(void)
     70{
     71        if (config.cpu_active == 1) {
     72                memory_print_map();
     73               
     74                #ifdef __SMP__
     75                acpi_init();
     76                #endif /* __SMP__ */
     77        }
     78}
     79
     80void calibrate_delay_loop(void)
     81{
     82        return;
     83        i8254_calibrate_delay_loop();
     84        i8254_normal_operation();
     85}
  • arch/amd64/src/asm_utils.S

    r73838ed r7df54df  
    4444        movq $halt, (%rsp)
    4545        jmp printf
     46
     47.global has_cpuid
     48.global rdtsc
     49
     50
     51## Determine CPUID support
     52#
     53# Return 0 in EAX if CPUID is not support, 1 if supported.
     54#
     55has_cpuid:
     56        pushq %rbx
     57       
     58        pushfq                  # store flags
     59        popq %rax               # read flags
     60        movq %rax,%rbx          # copy flags
     61        btcl $21,%ebx           # swap the ID bit
     62        pushq %rbx
     63        popfq                   # propagate the change into flags
     64        pushfq
     65        popq %rbx               # read flags   
     66        andl $(1<<21),%eax      # interested only in ID bit
     67        andl $(1<<21),%ebx
     68        xorl %ebx,%eax          # 0 if not supported, 1 if supported
     69       
     70        popq %rbx
     71        ret
     72
     73
     74rdtsc:
     75        xorq %rax,%rax
     76        rdtsc
     77        ret
     78       
    4679
    4780# Push all general purpose registers on stack except %rbp, %rsp
  • arch/amd64/src/boot/boot.S

    r73838ed r7df54df  
    3434
    3535#define START_STACK     0x7c00 
    36 #define START_STACK_64  $0xffffffff80007c00
     36#define START_STACK_64  0xffffffff80007c00
    3737                                       
    3838#
     
    5252        movw %ax,%ds
    5353        movw %ax,%ss            # initialize stack segment register
    54         movl START_STACK,%esp   # initialize stack pointer
     54        movl $(START_STACK),%esp        # initialize stack pointer
    5555       
    56 #       call memmap_arch_init
     56        call memmap_arch_init
    5757       
    5858        movl $0x80000000, %eax 
     
    117117.code64
    118118start64:
    119         movq START_STACK_64, %rsp
     119        movq $(START_STACK_64), %rsp
    120120       
    121121        call main_bsp   # never returns
  • arch/amd64/src/dummy.s

    r73838ed r7df54df  
    3535.global cpu_sleep
    3636.global cpu_print_report
    37 .global arch_late_init
    38 .global calibrate_delay_loop
    3937.global dummy
    40 .global rdtsc
    4138.global reset_TS_flag
    4239.global fpu_init
    4340       
    44 .global memory_print_map
    45 .global get_memory_size
    46 
    47 get_memory_size:
    48         movq $4*1024*1024, %rax
    49         ret
    50 
    51 rdtsc:
    5241before_thread_runs_arch:
    5342userspace:
    54 calibrate_delay_loop:
    5543cpu_identify:
    5644cpu_arch_init:
    5745cpu_sleep:
    5846cpu_print_report:
    59 arch_late_init:
    60 calibrate_delay_loop:
    6147reset_TS_flag:
    6248fpu_init:
    63 memory_print_map:       
    6449       
    6550dummy:
Note: See TracChangeset for help on using the changeset viewer.