Changeset dc0b964 in mainline for kernel/arch/ia32/src


Ignore:
Timestamp:
2010-11-24T14:23:14Z (15 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
85369b1, b89e1d3
Parents:
8b3bff5
Message:
  • do not hardwire PRI??? formatting macros in the sources, use autotool to detect the correct values
  • use autotool to detect correct values for integer literal macros (UINT32_C, etc.)
  • start using portable UINT??_C style macros for integer constants
Location:
kernel/arch/ia32/src
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/ia32/src/bios/bios.c

    r8b3bff5 rdc0b964  
    3636#include <typedefs.h>
    3737
    38 #define BIOS_EBDA_PTR  0x40e
     38#define BIOS_EBDA_PTR  0x40eU
    3939
    4040uintptr_t ebda = 0;
     
    4343{
    4444        /* Copy the EBDA address out from BIOS Data Area */
    45         ebda = *((uint16_t *) BIOS_EBDA_PTR) * 0x10;
     45        ebda = *((uint16_t *) BIOS_EBDA_PTR) * 0x10U;
    4646}
    4747
  • kernel/arch/ia32/src/boot/memmap.c

    r8b3bff5 rdc0b964  
    3535#include <arch/boot/memmap.h>
    3636
    37 uint8_t e820counter = 0xff;
     37uint8_t e820counter = 0xffU;
    3838e820memmap_t e820table[MEMMAP_E820_MAX_RECORDS];
    3939
  • kernel/arch/ia32/src/cpu/cpu.c

    r8b3bff5 rdc0b964  
    4949 * Contains only non-MP-Specification specific SMP code.
    5050 */
    51 #define AMD_CPUID_EBX  0x68747541
    52 #define AMD_CPUID_ECX  0x444d4163
    53 #define AMD_CPUID_EDX  0x69746e65
     51#define AMD_CPUID_EBX  UINT32_C(0x68747541)
     52#define AMD_CPUID_ECX  UINT32_C(0x444d4163)
     53#define AMD_CPUID_EDX  UINT32_C(0x69746e65)
    5454
    55 #define INTEL_CPUID_EBX  0x756e6547
    56 #define INTEL_CPUID_ECX  0x6c65746e
    57 #define INTEL_CPUID_EDX  0x49656e69
     55#define INTEL_CPUID_EBX  UINT32_C(0x756e6547)
     56#define INTEL_CPUID_ECX  UINT32_C(0x6c65746e)
     57#define INTEL_CPUID_EDX  UINT32_C(0x49656e69)
    5858
    5959
     
    140140                if ((info.cpuid_ebx == AMD_CPUID_EBX)
    141141                    && (info.cpuid_ecx == AMD_CPUID_ECX)
    142                         && (info.cpuid_edx == AMD_CPUID_EDX))
     142                    && (info.cpuid_edx == AMD_CPUID_EDX))
    143143                        CPU->arch.vendor = VendorAMD;
    144144               
    145145                /*
    146146                 * Check for Intel processor.
    147                  */             
     147                 */
    148148                if ((info.cpuid_ebx == INTEL_CPUID_EBX)
    149149                    && (info.cpuid_ecx == INTEL_CPUID_ECX)
    150                         && (info.cpuid_edx == INTEL_CPUID_EDX))
     150                    && (info.cpuid_edx == INTEL_CPUID_EDX))
    151151                        CPU->arch.vendor = VendorIntel;
    152152               
    153153                cpuid(INTEL_CPUID_STANDARD, &info);
    154                 CPU->arch.family = (info.cpuid_eax >> 8) & 0x0f;
    155                 CPU->arch.model = (info.cpuid_eax >> 4) & 0x0f;
    156                 CPU->arch.stepping = (info.cpuid_eax >> 0) & 0x0f;                                             
     154                CPU->arch.family = (info.cpuid_eax >> 8) & 0x0fU;
     155                CPU->arch.model = (info.cpuid_eax >> 4) & 0x0fU;
     156                CPU->arch.stepping = (info.cpuid_eax >> 0) & 0x0fU;
    157157        }
    158158}
  • kernel/arch/ia32/src/debug/stacktrace.c

    r8b3bff5 rdc0b964  
    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_stack_trace_context_validate(stack_trace_context_t *ctx)
  • kernel/arch/ia32/src/drivers/i8254.c

    r8b3bff5 rdc0b964  
    5454#include <ddi/device.h>
    5555
    56 #define CLK_PORT1  ((ioport8_t *) 0x40)
    57 #define CLK_PORT4  ((ioport8_t *) 0x43)
     56#define CLK_PORT1  ((ioport8_t *) 0x40U)
     57#define CLK_PORT4  ((ioport8_t *) 0x43U)
    5858
    5959#define CLK_CONST     1193180
  • kernel/arch/ia32/src/drivers/i8259.c

    r8b3bff5 rdc0b964  
    121121void pic_eoi(void)
    122122{
    123         pio_write_8((ioport8_t *)0x20, 0x20);
    124         pio_write_8((ioport8_t *)0xa0, 0x20);
     123        pio_write_8((ioport8_t *) 0x20, 0x20);
     124        pio_write_8((ioport8_t *) 0xa0, 0x20);
    125125}
    126126
  • kernel/arch/ia32/src/drivers/vesa.c

    r8b3bff5 rdc0b964  
    7070bool vesa_init(void)
    7171{
    72         if ((vesa_width == 0xffff) || (vesa_height == 0xffff))
     72        if ((vesa_width == 0xffffU) || (vesa_height == 0xffffU))
    7373                return false;
    7474       
  • kernel/arch/ia32/src/mm/frame.c

    r8b3bff5 rdc0b964  
    4444#include <align.h>
    4545#include <macros.h>
    46 
    4746#include <print.h>
    4847
    49 #define PHYSMEM_LIMIT32  0x07c000000ull
    50 #define PHYSMEM_LIMIT64  0x200000000ull
     48#define PHYSMEM_LIMIT32  UINT64_C(0x07c000000)
     49#define PHYSMEM_LIMIT64  UINT64_C(0x200000000)
    5150
    5251size_t hardcoded_unmapped_ktext_size = 0;
  • kernel/arch/ia32/src/smp/apic.c

    r8b3bff5 rdc0b964  
    7272 *
    7373 */
    74 volatile uint32_t *l_apic = (uint32_t *) 0xfee00000;
    75 volatile uint32_t *io_apic = (uint32_t *) 0xfec00000;
     74volatile uint32_t *l_apic = (uint32_t *) UINT32_C(0xfee00000);
     75volatile uint32_t *io_apic = (uint32_t *) UINT32_C(0xfec00000);
    7676
    7777uint32_t apic_id_mask = 0;
     
    184184         * Other interrupts will be forwarded to the lowest priority CPU.
    185185         */
    186         io_apic_disable_irqs(0xffff);
     186        io_apic_disable_irqs(0xffffU);
    187187       
    188188        irq_initialize(&l_apic_timer_irq);
  • kernel/arch/ia32/src/smp/mps.c

    r8b3bff5 rdc0b964  
    5252 */
    5353
    54 #define FS_SIGNATURE  0x5f504d5f
    55 #define CT_SIGNATURE  0x504d4350
     54#define FS_SIGNATURE  UINT32_C(0x5f504d5f)
     55#define CT_SIGNATURE  UINT32_C(0x504d4350)
    5656
    5757static struct mps_fs *fs;
Note: See TracChangeset for help on using the changeset viewer.