Changeset 2ddcc7b in mainline for kernel/arch/amd64/src


Ignore:
Timestamp:
2010-06-27T23:02:55Z (15 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
33dac7d
Parents:
74c5a1ca
Message:

cstyle cleanup (no change in functionality)

Location:
kernel/arch/amd64/src
Files:
7 edited

Legend:

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

    r74c5a1ca r2ddcc7b  
    122122        /* Enable FPU */
    123123        cpu_setup_fpu();
    124 
     124       
    125125        /* Initialize segmentation */
    126126        pm_init();
     
    132132        /* Disable alignment check */
    133133        clean_AM_flag();
    134 
     134       
    135135        if (config.cpu_active == 1) {
    136136                interrupt_init();
     
    260260        THREAD->arch.tls = addr;
    261261        write_msr(AMD_MSR_FS, addr);
     262       
    262263        return 0;
    263264}
  • kernel/arch/amd64/src/cpu/cpu.c

    r74c5a1ca r2ddcc7b  
    4747 * Contains only non-MP-Specification specific SMP code.
    4848 */
    49 #define AMD_CPUID_EBX   0x68747541
    50 #define AMD_CPUID_ECX   0x444d4163
    51 #define AMD_CPUID_EDX   0x69746e65
     49#define AMD_CPUID_EBX  0x68747541
     50#define AMD_CPUID_ECX  0x444d4163
     51#define AMD_CPUID_EDX  0x69746e65
    5252
    53 #define INTEL_CPUID_EBX 0x756e6547
    54 #define INTEL_CPUID_ECX 0x6c65746e
    55 #define INTEL_CPUID_EDX 0x49656e69
     53#define INTEL_CPUID_EBX  0x756e6547
     54#define INTEL_CPUID_ECX  0x6c65746e
     55#define INTEL_CPUID_EDX  0x49656e69
    5656
    5757
     
    127127{
    128128        cpu_info_t info;
    129 
     129       
    130130        CPU->arch.vendor = VendorUnknown;
    131131        if (has_cpuid()) {
    132132                cpuid(INTEL_CPUID_LEVEL, &info);
    133 
     133               
    134134                /*
    135135                 * Check for AMD processor.
    136136                 */
    137                 if (info.cpuid_ebx == AMD_CPUID_EBX &&
    138                     info.cpuid_ecx == AMD_CPUID_ECX &&
    139                     info.cpuid_edx == AMD_CPUID_EDX) {
     137                if ((info.cpuid_ebx == AMD_CPUID_EBX) &&
     138                    (info.cpuid_ecx == AMD_CPUID_ECX) &&
     139                    (info.cpuid_edx == AMD_CPUID_EDX)) {
    140140                        CPU->arch.vendor = VendorAMD;
    141141                }
    142 
     142               
    143143                /*
    144144                 * Check for Intel processor.
    145                  */             
    146                 if (info.cpuid_ebx == INTEL_CPUID_EBX &&
    147                     info.cpuid_ecx == INTEL_CPUID_ECX &&
    148                     info.cpuid_edx == INTEL_CPUID_EDX) {
     145                 */
     146                if ((info.cpuid_ebx == INTEL_CPUID_EBX) &&
     147                    (info.cpuid_ecx == INTEL_CPUID_ECX) &&
     148                    (info.cpuid_edx == INTEL_CPUID_EDX)) {
    149149                        CPU->arch.vendor = VendorIntel;
    150150                }
    151                                
     151               
    152152                cpuid(INTEL_CPUID_STANDARD, &info);
    153153                CPU->arch.family = (info.cpuid_eax >> 8) & 0xf;
    154154                CPU->arch.model = (info.cpuid_eax >> 4) & 0xf;
    155                 CPU->arch.stepping = (info.cpuid_eax >> 0) & 0xf;                                               
     155                CPU->arch.stepping = (info.cpuid_eax >> 0) & 0xf;
    156156        }
    157157}
  • kernel/arch/amd64/src/debug/stacktrace.c

    r74c5a1ca r2ddcc7b  
    3737#include <typedefs.h>
    3838
    39 #define FRAME_OFFSET_FP_PREV    0
    40 #define FRAME_OFFSET_RA         1
     39#define FRAME_OFFSET_FP_PREV  0
     40#define FRAME_OFFSET_RA       1
    4141
    4242bool kernel_frame_pointer_validate(uintptr_t fp)
     
    4949        uint64_t *stack = (void *) fp;
    5050        *prev = stack[FRAME_OFFSET_FP_PREV];
     51       
    5152        return true;
    5253}
     
    5657        uint64_t *stack = (void *) fp;
    5758        *ra = stack[FRAME_OFFSET_RA];
     59       
    5860        return true;
    5961}
  • kernel/arch/amd64/src/delay.S

    r74c5a1ca r2ddcc7b  
    3737
    3838asm_delay_loop:
    39 0:      dec %rdi
    40         jnz 0b
     39        0:
     40                dec %rdi
     41                jnz 0b
     42       
    4143        ret
    4244
    4345asm_fake_loop:
    44 0:      dec %rdi
    45         jz 0b
     46        0:
     47                dec %rdi
     48                jz 0b
     49       
    4650        ret
  • kernel/arch/amd64/src/proc/scheduler.c

    r74c5a1ca r2ddcc7b  
    3838#include <proc/thread.h>
    3939#include <arch.h>
    40 #include <arch/context.h>       /* SP_DELTA */
     40#include <arch/context.h>
    4141#include <arch/asm.h>
    4242#include <print.h>
     
    5858        CPU->arch.tss->rsp0 =
    5959            (uintptr_t) &THREAD->kstack[THREAD_STACK_SIZE - SP_DELTA];
    60 
     60       
    6161        /*
    6262         * Syscall support.
    6363         */
    6464        swapgs();
    65         write_msr(AMD_MSR_GS, (uintptr_t)THREAD->arch.syscall_rsp);
     65        write_msr(AMD_MSR_GS, (uintptr_t) THREAD->arch.syscall_rsp);
    6666        swapgs();
    67 
     67       
    6868        /* TLS support - set FS to thread local storage */
    6969        write_msr(AMD_MSR_FS, THREAD->arch.tls);
  • kernel/arch/amd64/src/proc/task.c

    r74c5a1ca r2ddcc7b  
    3939/** Perform amd64 specific task initialization.
    4040 *
    41  * @param t Task to be initialized.
     41 * @param task Task to be initialized.
     42 *
    4243 */
    43 void task_create_arch(task_t *t)
     44void task_create_arch(task_t *task)
    4445{
    45         t->arch.iomapver = 0;
    46         bitmap_initialize(&t->arch.iomap, NULL, 0);
     46        task->arch.iomapver = 0;
     47        bitmap_initialize(&task->arch.iomap, NULL, 0);
    4748}
    4849
    4950/** Perform amd64 specific task destruction.
    5051 *
    51  * @param t Task to be initialized.
     52 * @param task Task to be initialized.
     53 *
    5254 */
    53 void task_destroy_arch(task_t *t)
     55void task_destroy_arch(task_t *task)
    5456{
    55         if (t->arch.iomap.map)
    56                 free(t->arch.iomap.map);
     57        if (task->arch.iomap.map)
     58                free(task->arch.iomap.map);
    5759}
    5860
  • kernel/arch/amd64/src/proc/thread.c

    r74c5a1ca r2ddcc7b  
    3737/** Perform amd64 specific thread initialization.
    3838 *
    39  * @param t Thread to be initialized.
     39 * @param thread Thread to be initialized.
     40 *
    4041 */
    41 void thread_create_arch(thread_t *t)
     42void thread_create_arch(thread_t *thread)
    4243{
    43         t->arch.tls = 0;
    44         t->arch.syscall_rsp[SYSCALL_USTACK_RSP] = 0;
     44        thread->arch.tls = 0;
     45        thread->arch.syscall_rsp[SYSCALL_USTACK_RSP] = 0;
     46       
    4547        /*
    4648         * Kernel RSP can be precalculated at thread creation time.
    4749         */
    48         t->arch.syscall_rsp[SYSCALL_KSTACK_RSP] =
    49             (uintptr_t) &t->kstack[PAGE_SIZE - sizeof(uint64_t)];
     50        thread->arch.syscall_rsp[SYSCALL_KSTACK_RSP] =
     51            (uintptr_t) &thread->kstack[PAGE_SIZE - sizeof(uint64_t)];
    5052}
    5153
Note: See TracChangeset for help on using the changeset viewer.