Changeset a35b458 in mainline for kernel/arch/amd64/src/pm.c


Ignore:
Timestamp:
2018-03-02T20:10:49Z (7 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f1380b7
Parents:
3061bc1
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:38:31)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-02 20:10:49)
Message:

style: Remove trailing whitespace on _all_ lines, including empty ones, for particular file types.

Command used: tools/srepl '\s\+$' '' -- *.c *.h *.py *.sh *.s *.S *.ag

Currently, whitespace on empty lines is very inconsistent.
There are two basic choices: Either remove the whitespace, or keep empty lines
indented to the level of surrounding code. The former is AFAICT more common,
and also much easier to do automatically.

Alternatively, we could write script for automatic indentation, and use that
instead. However, if such a script exists, it's possible to use the indented
style locally, by having the editor apply relevant conversions on load/save,
without affecting remote repository. IMO, it makes more sense to adopt
the simpler rule.

File:
1 edited

Legend:

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

    r3061bc1 ra35b458  
    130130{
    131131        tss_descriptor_t *td = (tss_descriptor_t *) d;
    132        
     132
    133133        td->base_0_15 = base & 0xffffU;
    134134        td->base_16_23 = ((base) >> 16) & 0xffU;
     
    140140{
    141141        tss_descriptor_t *td = (tss_descriptor_t *) d;
    142        
     142
    143143        td->limit_0_15 = limit & 0xffffU;
    144144        td->limit_16_19 = (limit >> 16) & 0x0fU;
     
    167167        idescriptor_t *d;
    168168        unsigned int i;
    169        
     169
    170170        for (i = 0; i < IDT_ITEMS; i++) {
    171171                d = &idt[i];
    172                
     172
    173173                d->unused = 0;
    174174                d->selector = GDT_SELECTOR(KTEXT_DES);
    175                
     175
    176176                d->present = 1;
    177177                d->type = AR_INTERRUPT;  /* masking interrupt */
    178178        }
    179        
     179
    180180        d = &idt[0];
    181181        idt_setoffset(d++, (uintptr_t) &int_0);
     
    252252        descriptor_t *gdt_p = (descriptor_t *) gdtr.base;
    253253        tss_descriptor_t *tss_desc;
    254        
     254
    255255        /*
    256256         * Each CPU has its private GDT and TSS.
    257257         * All CPUs share one IDT.
    258258         */
    259        
     259
    260260        if (config.cpu_active == 1) {
    261261                idt_init();
     
    270270                 * ahead of page_init */
    271271                write_cr3((uintptr_t) AS_KERNEL->genarch.page_table);
    272                
     272
    273273                tss_p = (tss_t *) malloc(sizeof(tss_t), FRAME_ATOMIC);
    274274                if (!tss_p)
    275275                        panic("Cannot allocate TSS.");
    276276        }
    277        
     277
    278278        tss_initialize(tss_p);
    279        
     279
    280280        tss_desc = (tss_descriptor_t *) (&gdt_p[TSS_DES]);
    281281        tss_desc->present = 1;
    282282        tss_desc->type = AR_TSS;
    283283        tss_desc->dpl = PL_KERNEL;
    284        
     284
    285285        gdt_tss_setbase(&gdt_p[TSS_DES], (uintptr_t) tss_p);
    286286        gdt_tss_setlimit(&gdt_p[TSS_DES], TSS_BASIC_SIZE - 1);
    287        
     287
    288288        gdtr_load(&gdtr);
    289289        idtr_load(&idtr);
Note: See TracChangeset for help on using the changeset viewer.