Changeset 76cec1e in mainline for arch/ia32


Ignore:
Timestamp:
2005-07-15T21:57:30Z (20 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b4a4c5e3
Parents:
e41c47e
Message:

Huge indentation fix.

Location:
arch/ia32
Files:
22 edited

Legend:

Unmodified
Added
Removed
  • arch/ia32/boot/boot.S

    re41c47e r76cec1e  
    5151        xorw %ax,%ax            # reset, %al will be used below
    5252        movw %ax,%dx            # fd0, %dh and %dl will be used below
    53         movw %dx,%ds
     53        movw %dx,%ds
    5454
    5555        movw %dx,%ss            # initialize stack
     
    5959        jc stop_trying
    6060
    61         movw %dx,%ds
     61        movw %dx,%ds
    6262        movw %dx,%ss
    6363        movw $0x7c00,%sp
     
    9393        movw logical_sector,%ax
    9494        divb sectors
    95    
     95
    9696        movb %ah,%cl
    97         incb %cl                        # sector
    98    
     97        incb %cl                        # sector
     98
    9999        movb %al,%ch
    100100        shrb $1,%ch                     # track
    101    
     101
    102102        movb %al,%dh
    103103        andb $1,%dh                     # head
     
    127127        movw %sp,%bp
    128128        pusha
    129    
     129
    130130        movb $0xe,%ah
    131131        movb $7,%bl
    132132        int $0x10
    133    
     133
    134134        popa
    135135        pop %bp
  • arch/ia32/boot/boot.ld

    re41c47e r76cec1e  
    11OUTPUT_FORMAT(binary)
    22SECTIONS {
    3     .text 0x7c00 : AT (0x0) { *(.text) }
     3        .text 0x7c00 : AT (0x0) { *(.text) }
    44}
  • arch/ia32/include/cpu.h

    re41c47e r76cec1e  
    4343
    4444struct cpu_arch {
    45         int vendor;
    46         int family;
    47         int model;
    48         int stepping;
     45        int vendor;
     46        int family;
     47        int model;
     48        int stepping;
    4949        struct tss *tss;
    5050};
  • arch/ia32/src/acpi/acpi.c

    re41c47e r76cec1e  
    8585void acpi_init(void)
    8686{
    87         __u8 *addr[2] = { NULL, (__u8 *) 0xe0000 };
    88         int i, j, length[2] = { 1024, 128*1024 };
     87        __u8 *addr[2] = { NULL, (__u8 *) 0xe0000 };
     88        int i, j, length[2] = { 1024, 128*1024 };
    8989        __u64 *sig = (__u64 *) RSDP_SIGNATURE;
    9090
    91         /*
     91        /*
    9292         * Find Root System Description Pointer
    93         * 1. search first 1K of EBDA
    94         * 2. search 128K starting at 0xe0000
    95         */
     93        * 1. search first 1K of EBDA
     94        * 2. search 128K starting at 0xe0000
     95        */
    9696
    9797        addr[0] = (__u8 *) ebda;
    9898        for (i = (ebda ? 0 : 1); i < 2; i++) {
    99                 for (j = 0; j < length[i]; j += 16) {
    100                         if (*((__u64 *) &addr[i][j]) == *sig && rsdp_check(&addr[i][j])) {
    101                                 acpi_rsdp = (struct acpi_rsdp *) &addr[i][j];
    102                                 goto rsdp_found;
    103                         }
    104                 }
    105         }
     99                for (j = 0; j < length[i]; j += 16) {
     100                        if (*((__u64 *) &addr[i][j]) == *sig && rsdp_check(&addr[i][j])) {
     101                                acpi_rsdp = (struct acpi_rsdp *) &addr[i][j];
     102                                goto rsdp_found;
     103                        }
     104                }
     105        }
    106106
    107         return;
     107        return;
    108108
    109109rsdp_found:
    110         printf("%L: ACPI Root System Description Pointer\n", acpi_rsdp);
    111        
     110        printf("%L: ACPI Root System Description Pointer\n", acpi_rsdp);
     111
    112112        acpi_rsdt = (struct acpi_rsdt *) acpi_rsdp->rsdt_address;
    113113        if (acpi_rsdp->revision) acpi_xsdt = (struct acpi_xsdt *) ((__address) acpi_rsdp->xsdt_address);
     
    138138                        struct acpi_sdt_header *h = (struct acpi_sdt_header *) acpi_rsdt->entry[i];
    139139               
    140                         map_sdt(h);     
     140                        map_sdt(h);     
    141141                        if (*((__u32 *) &h->signature[0])==*((__u32 *) &signature_map[j].signature[0])) {
    142142                                if (!acpi_sdt_check((__u8 *) h))
  • arch/ia32/src/asm.s

    re41c47e r76cec1e  
    9696        push %ds
    9797        push %es
    98    
     98
    9999        # we must fill the data segment registers
    100100        movw $16,%ax
    101101        movw %ax,%ds
    102102        movw %ax,%es
    103    
     103
    104104        movl $(\i),%edi
    105105        pushl %ebp
     
    114114        popa
    115115        pop %ebp
    116    
    117         iret
    118    
     116
     117        iret
     118
    119119        .if (\n-\i)-1
    120120        handler "(\i+1)",\n
     
    180180        movl %esp,%ebp
    181181        pusha
    182    
     182
    183183        movl 8(%ebp),%edx
    184184        movl 12(%ebp),%eax
    185185        outb %al,%dx
    186    
     186
    187187        popa
    188188        pop %ebp
     
    198198        movl %esp,%ebp
    199199        pusha
    200    
     200
    201201        movl 8(%ebp),%edx
    202202        movl 12(%ebp),%eax
    203203        outw %ax,%dx
    204    
     204
    205205        popa
    206206        pop %ebp
     
    216216        movl %esp,%ebp
    217217        pusha
    218    
     218
    219219        movl 8(%ebp),%edx
    220220        movl 12(%ebp),%eax
    221221        outl %eax,%dx
    222    
     222
    223223        popa
    224224        pop %ebp
     
    240240        movl %esp,%ebp
    241241        pusha
    242    
     242
    243243        cld
    244244        movl CNT(%ebp),%ecx
    245245        movl DST(%ebp),%edi
    246         movl SRC(%ebp),%esi   
    247    
     246        movl SRC(%ebp),%esi
     247
    248248        rep movsb %ds:(%esi),%es:(%edi)
    249    
     249
    250250        popa
    251251        pop %ebp
     
    266266        movl %esp,%ebp
    267267        pusha
    268    
     268
    269269        cld
    270270        movl CNT(%ebp),%ecx
    271271        movl DST(%ebp),%edi
    272272        movl X(%ebp),%eax
    273    
     273
    274274        rep stosb %al,%es:(%edi)
    275    
    276         popa
     275
     276        popa
    277277        pop %ebp
    278278        ret
     
    292292        movl %esp,%ebp
    293293        pusha
    294    
     294
    295295        cld
    296296        movl CNT(%ebp),%ecx
    297297        movl DST(%ebp),%edi
    298298        movl X(%ebp),%eax
    299    
     299
    300300        rep stosw %ax,%es:(%edi)
    301    
    302         popa
     301
     302        popa
    303303        pop %ebp
    304304        ret
     
    321321
    322322        pusha
    323    
     323
    324324        cld
    325325        movl CNT(%ebp),%ecx
    326326        movl DST(%ebp),%edi
    327         movl SRC(%ebp),%esi   
    328    
     327        movl SRC(%ebp),%esi
     328
    329329        repe cmpsb %es:(%edi),%ds:(%esi)
    330330        movl %ecx,(%ebp)
  • arch/ia32/src/boot/boot.S

    re41c47e r76cec1e  
    5757        movw %ax,%fs
    5858        movw %ax,%ds                    # kernel data + stack
    59         movw %ax,%ss
     59        movw %ax,%ss
    6060        movl $0x7c00,%esp
    6161
  • arch/ia32/src/context.s

    re41c47e r76cec1e  
    4343        movl 4(%esp),%eax       # the caller's return %eip
    4444        movl 8(%esp),%ebx       # address of the kernel_context variable to save context to
    45         movl %eax,4(%ebx)       # %eip -> ctx->pc
     45        movl %eax,4(%ebx)       # %eip -> ctx->pc
    4646        movl %esp,(%ebx)        # %esp -> ctx->sp
    4747
     
    5454        movl %esi,20(%eax)
    5555        movl %edi,24(%eax)
    56         movl %ebp,28(%eax)   
    57    
     56        movl %ebp,28(%eax)
     57
    5858        xorl %eax,%eax          # context_save returns 1
    5959        incl %eax
     
    6565# Restore CPU context from the kernel_context variable
    6666# pointed by the 1st argument. Returns 0 in EAX.
    67 #   
     67#
    6868context_restore:
    6969        movl 4(%esp),%eax       # address of the kernel_context variable to restore context from
     
    8080        movl 4(%eax),%eax
    8181        movl %eax,(%esp)        # ctx->pc -> saver's return %eip
    82         xorl %eax,%eax          # context_restore returns 0
     82        xorl %eax,%eax          # context_restore returns 0
    8383        ret
  • arch/ia32/src/cpu/cpu.c

    re41c47e r76cec1e  
    109109                 * Check for AMD processor.
    110110                 */
    111                 if (info.cpuid_ebx==AMD_CPUID_EBX &&
    112                     info.cpuid_ecx==AMD_CPUID_ECX &&
    113                     info.cpuid_edx==AMD_CPUID_EDX) {
    114                        
     111                if (info.cpuid_ebx==AMD_CPUID_EBX && info.cpuid_ecx==AMD_CPUID_ECX && info.cpuid_edx==AMD_CPUID_EDX) {
    115112                        CPU->arch.vendor = VendorAMD;
    116113                }
     
    119116                 * Check for Intel processor.
    120117                 */             
    121                 if (info.cpuid_ebx==INTEL_CPUID_EBX &&
    122                     info.cpuid_ecx==INTEL_CPUID_ECX &&
    123                     info.cpuid_edx==INTEL_CPUID_EDX) {
    124 
     118                if (info.cpuid_ebx==INTEL_CPUID_EBX && info.cpuid_ecx==INTEL_CPUID_ECX && info.cpuid_edx==INTEL_CPUID_EDX) {
    125119                        CPU->arch.vendor = VendorIntel;
    126 
    127120                }
    128121                               
  • arch/ia32/src/cpuid.s

    re41c47e r76cec1e  
    8484        movl %ecx,8(%esi)
    8585        movl %edx,12(%esi)
    86    
     86
    8787        popa
    8888        popl %ebp
  • arch/ia32/src/drivers/ega.c

    re41c47e r76cec1e  
    7070{
    7171        if (ega_cursor < SCREEN)
    72             return;
     72                return;
    7373
    7474        memcopy(PA2KA(VIDEORAM) + ROW*2, PA2KA(VIDEORAM), (SCREEN - ROW)*2);
     
    8686        switch (ch) {
    8787            case '\n':
    88                     ega_cursor = (ega_cursor + ROW) - ega_cursor % ROW;
    89                     break;
     88                ega_cursor = (ega_cursor + ROW) - ega_cursor % ROW;
     89                break;
    9090            case '\t':
    91                     ega_cursor = (ega_cursor + 8) - ega_cursor % 8;
    92                     break;
     91                ega_cursor = (ega_cursor + 8) - ega_cursor % 8;
     92                break;
    9393            default:
    94                     ega_display_char(ch);
    95                     ega_cursor++;
    96                     break;
     94                ega_display_char(ch);
     95                ega_cursor++;
     96                break;
    9797        }
    9898        ega_check_cursor();
    9999        ega_move_cursor();
    100        
     100
    101101        spinlock_unlock(&egalock);
    102102        cpu_priority_restore(pri);
  • arch/ia32/src/drivers/i8254.c

    re41c47e r76cec1e  
    8484
    8585        do {
    86                 /* will read both status and count */
     86                /* will read both status and count */
    8787                outb(CLK_PORT4, 0xc2);
    8888                not_ok = (inb(CLK_PORT1)>>6)&1;
     
    110110        o2 |= inb(CLK_PORT1) << 8;
    111111
    112 
    113         CPU->delay_loop_const = ((MAGIC_NUMBER*LOOPS)/1000) / ((t1-t2)-(o1-o2)) +
    114                                     (((MAGIC_NUMBER*LOOPS)/1000) % ((t1-t2)-(o1-o2)) ? 1 : 0);
    115        
     112        CPU->delay_loop_const = ((MAGIC_NUMBER*LOOPS)/1000) / ((t1-t2)-(o1-o2)) + (((MAGIC_NUMBER*LOOPS)/1000) % ((t1-t2)-(o1-o2)) ? 1 : 0);
    116113
    117114        clk1 = rdtsc();
  • arch/ia32/src/drivers/i8259.c

    re41c47e r76cec1e  
    4545        /* ICW2: IRQ 0 maps to INT IRQBASE */
    4646        outb(PIC_PIC0PORT2, IVT_IRQBASE);
    47    
     47
    4848        /* ICW3: pic1 using IRQ IRQ_PIC1 */
    4949        outb(PIC_PIC0PORT2, 1 << IRQ_PIC1);
    50    
    51         /* ICW4: i8086 mode */   
     50
     51        /* ICW4: i8086 mode */
    5252        outb(PIC_PIC0PORT2, 1);
    5353
     
    5555        outb(PIC_PIC1PORT1, PIC_ICW1 | PIC_NEEDICW4);
    5656
    57         /* ICW2: IRQ 8 maps to INT (IVT_IRQBASE + 8) */   
     57        /* ICW2: IRQ 8 maps to INT (IVT_IRQBASE + 8) */
    5858        outb(PIC_PIC1PORT2, IVT_IRQBASE + 8);
    5959
     
    6161        outb(PIC_PIC1PORT2, PIC_PIC1ID);
    6262
    63         /* ICW4: i8086 mode */   
     63        /* ICW4: i8086 mode */
    6464        outb(PIC_PIC1PORT2, 1);
    6565
     
    7676        disable_irqs_function = pic_disable_irqs;
    7777        eoi_function = pic_eoi;
    78    
     78
    7979        pic_disable_irqs(0xffff);               /* disable all irq's */
    8080        pic_enable_irqs(1<<IRQ_PIC1);           /* but enable pic1 */
     
    8484{
    8585        __u8 x;
    86    
     86
    8787        if (irqmask & 0xff) {
    88                 x = inb(PIC_PIC0PORT2);
     88                x = inb(PIC_PIC0PORT2);
    8989                outb(PIC_PIC0PORT2, x & (~(irqmask & 0xff)));
    9090        }
    9191        if (irqmask >> 8) {
    92                 x = inb(PIC_PIC1PORT2);
     92                x = inb(PIC_PIC1PORT2);
    9393                outb(PIC_PIC1PORT2, x & (~(irqmask >> 8)));
    9494        }
     
    9898{
    9999        __u8 x;
    100    
     100
    101101        if (irqmask & 0xff) {
    102                 x = inb(PIC_PIC0PORT2);
     102                x = inb(PIC_PIC0PORT2);
    103103                outb(PIC_PIC0PORT2, x | (irqmask & 0xff));
    104104        }
    105105        if (irqmask >> 8) {
    106                 x = inb(PIC_PIC1PORT2);
     106                x = inb(PIC_PIC1PORT2);
    107107                outb(PIC_PIC1PORT2, x | (irqmask >> 8));
    108108        }
     
    112112{
    113113        outb(0x20,0x20);
    114         outb(0xa0,0x20);
     114        outb(0xa0,0x20);
    115115}
    116116
  • arch/ia32/src/fpu_context.c

    re41c47e r76cec1e  
    7979{
    8080        asm(
    81                 "fninit;"
     81                "fninit;"
    8282        );
    8383}
  • arch/ia32/src/ia32.c

    re41c47e r76cec1e  
    5656                bios_init();
    5757                i8042_init();   /* a20 bit */
    58                 i8259_init();   /* PIC */
     58                i8259_init();   /* PIC */
    5959                i8254_init();   /* hard clock */
    6060
  • arch/ia32/src/interrupt.c

    re41c47e r76cec1e  
    9898{
    9999        reset_TS_flag();
    100         if ((CPU->fpu_owner)!=NULL)
    101         { 
    102                 fpu_lazy_context_save(&((CPU->fpu_owner)->saved_fpu_context));
     100        if ((CPU->fpu_owner)!=NULL) { 
     101                fpu_lazy_context_save(&((CPU->fpu_owner)->saved_fpu_context));
    103102                (CPU->fpu_owner)->fpu_context_engaged=0; /* don't prevent migration */
    104103        }
    105104        if(THREAD->fpu_context_exists) fpu_lazy_context_restore(&(THREAD->saved_fpu_context));
    106         else {fpu_init();THREAD->fpu_context_exists=1;}
     105        else {fpu_init();THREAD->fpu_context_exists=1;}
    107106        CPU->fpu_owner=THREAD;
    108107}
  • arch/ia32/src/mm/frame.c

    re41c47e r76cec1e  
    4040                frame_not_free(0x0);
    4141
    42                 frame_region_not_free(0xa0000,0xff000);
    43                 frame_region_not_free(0xfec00000,0xffffffff);
     42                frame_region_not_free(0xa0000,0xff000);
     43                frame_region_not_free(0xfec00000,0xffffffff);
    4444        }
    4545}
  • arch/ia32/src/mm/page.c

    re41c47e r76cec1e  
    5757                dba = frame_alloc(FRAME_KA | FRAME_PANIC);
    5858                memsetb(dba, PAGE_SIZE, 0);
    59            
     59
    6060                bootstrap_dba = dba;
    6161
  • arch/ia32/src/pm.c

    re41c47e r76cec1e  
    4646 */
    4747struct descriptor gdt[GDT_ITEMS] = {
    48     /* NULL descriptor */
    49     { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
    50     /* KTEXT descriptor */
    51     { 0xffff, 0, 0, AR_PRESENT | AR_CODE | DPL_KERNEL, 0xf, 0, 0, 1, 1, 0 },
    52     /* KDATA descriptor */
    53     { 0xffff, 0, 0, AR_PRESENT | AR_DATA | AR_WRITABLE | DPL_KERNEL, 0xf, 0, 0, 1, 1, 0 },
    54     /* UTEXT descriptor */
    55     { 0xffff, 0, 0, AR_PRESENT | AR_CODE | DPL_USER, 0xf, 0, 0, 1, 1, 0 },
    56     /* UDATA descriptor */
    57     { 0xffff, 0, 0, AR_PRESENT | AR_DATA | AR_WRITABLE | DPL_USER, 0xf, 0, 0, 1, 1, 0 },
    58     /* TSS descriptor - set up will be completed later */
    59     { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
     48        /* NULL descriptor */
     49        { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
     50        /* KTEXT descriptor */
     51        { 0xffff, 0, 0, AR_PRESENT | AR_CODE | DPL_KERNEL, 0xf, 0, 0, 1, 1, 0 },
     52        /* KDATA descriptor */
     53        { 0xffff, 0, 0, AR_PRESENT | AR_DATA | AR_WRITABLE | DPL_KERNEL, 0xf, 0, 0, 1, 1, 0 },
     54        /* UTEXT descriptor */
     55        { 0xffff, 0, 0, AR_PRESENT | AR_CODE | DPL_USER, 0xf, 0, 0, 1, 1, 0 },
     56        /* UDATA descriptor */
     57        { 0xffff, 0, 0, AR_PRESENT | AR_DATA | AR_WRITABLE | DPL_USER, 0xf, 0, 0, 1, 1, 0 },
     58        /* TSS descriptor - set up will be completed later */
     59        { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
    6060};
    6161
     
    7272void gdt_setbase(struct descriptor *d, __address base)
    7373{
    74         d->base_0_15 = base & 0xffff;
    75         d->base_16_23 = ((base) >> 16) & 0xff;
    76         d->base_24_31 = ((base) >> 24) & 0xff;
    77 
     74        d->base_0_15 = base & 0xffff;
     75        d->base_16_23 = ((base) >> 16) & 0xff;
     76        d->base_24_31 = ((base) >> 24) & 0xff;
    7877}
    7978
    8079void gdt_setlimit(struct descriptor *d, __u32 limit)
    8180{
    82         d->limit_0_15 = limit & 0xffff;
    83         d->limit_16_19 = (limit >> 16) & 0xf;
     81        d->limit_0_15 = limit & 0xffff;
     82        d->limit_16_19 = (limit >> 16) & 0xf;
    8483}
    8584
     
    105104        struct idescriptor *d;
    106105        int i;
    107    
     106
    108107        for (i = 0; i < IDT_ITEMS; i++) {
    109108                d = &idt[i];
  • arch/ia32/src/proc/scheduler.c

    re41c47e r76cec1e  
    3535{
    3636        CPU->arch.tss->esp0 = (__address) &THREAD->kstack[THREAD_STACK_SIZE-8];
    37         CPU->arch.tss->ss0 = selector(KDATA_DES);       
     37        CPU->arch.tss->ss0 = selector(KDATA_DES);       
    3838}
  • arch/ia32/src/smp/apic.c

    re41c47e r76cec1e  
    8585       
    8686                if ((pin = mps_irq_to_pin(i)) != -1)
    87                         io_apic_change_ioredtbl(pin,0xf,IVT_IRQBASE+i,LOPRI);
     87                io_apic_change_ioredtbl(pin,0xf,IVT_IRQBASE+i,LOPRI);
    8888        }
    8989       
     
    137137        if ((esr>>7) & 1)
    138138                printf("Illegal Register Address\n");
    139    
     139
    140140        return !esr;
    141141}
  • arch/ia32/src/smp/mps.c

    re41c47e r76cec1e  
    244244                                l_intr_entry_cnt++;
    245245                                ct_l_intr_entry((struct __l_intr_entry *) cur);
    246                                 cur += 8;
     246                                cur += 8;
    247247                                break;
    248            
     248
    249249                        default:
    250250                                /*
  • arch/ia32/src/userspace.c

    re41c47e r76cec1e  
    4747
    4848        __asm__ volatile (""
    49             "pushl %0\n"
    50             "pushl %1\n"
    51             "pushl %2\n"
    52             "pushl %3\n"
    53             "pushl %4\n"
    54             "iret"
    55             : : "i" (selector(UDATA_DES) | PL_USER), "i" (USTACK_ADDRESS+(THREAD_STACK_SIZE-1)), "r" (pri), "i" (selector(UTEXT_DES) | PL_USER), "i" (UTEXT_ADDRESS));
     49                "pushl %0\n"
     50                "pushl %1\n"
     51                "pushl %2\n"
     52                "pushl %3\n"
     53                "pushl %4\n"
     54                "iret"
     55                : : "i" (selector(UDATA_DES) | PL_USER), "i" (USTACK_ADDRESS+(THREAD_STACK_SIZE-1)), "r" (pri), "i" (selector(UTEXT_DES) | PL_USER), "i" (UTEXT_ADDRESS));
    5656       
    5757        /* Unreachable */
Note: See TracChangeset for help on using the changeset viewer.