Changeset 145 for trunk/hal


Ignore:
Timestamp:
Jul 5, 2017, 11:05:11 AM (7 years ago)
Author:
max@…
Message:

style

Location:
trunk/hal/x86_64/core
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • trunk/hal/x86_64/core/hal_acpi.h

    r89 r145  
    11/*
    22 * hal_acpi.h - ACPI-specific values and structures
    3  * 
     3 *
    44 * Copyright (c) 2017 Maxime Villard
    55 * Inspired by ACPICA.
    6  * 
     6 *
    77 * This file is part of ALMOS-MKH.
    88 *
  • trunk/hal/x86_64/core/hal_apic.c

    r138 r145  
    227227
    228228        /* Initialize the LAPIC timer to the maximum value */
    229         hal_lapic_write(LAPIC_ICR_TIMER, 0xFFFFFFFF); 
     229        hal_lapic_write(LAPIC_ICR_TIMER, 0xFFFFFFFF);
    230230
    231231        /* Initialize the PIT */
  • trunk/hal/x86_64/core/hal_atomic.c

    r105 r145  
    2323#include <hal_internal.h>
    2424
    25 void hal_atomic_and( uint32_t * ptr,
    26                      int32_t    val )
     25void hal_atomic_and(uint32_t *ptr, int32_t val)
    2726{
    2827        atomic_and_32((volatile uint32_t *)ptr, val);
    2928}
    3029
    31 void hal_atomic_or( uint32_t * ptr,
    32                     int32_t    val )
     30void hal_atomic_or(uint32_t *ptr, int32_t val)
    3331{
    3432        atomic_or_32((volatile uint32_t *)ptr, val);
    3533}
    3634
    37 uint32_t hal_atomic_add( void    * ptr,
    38                          int32_t   val )
     35uint32_t hal_atomic_add(void *ptr, int32_t val)
    3936{
    4037        return atomic_add_32((volatile uint32_t *)ptr, val);
    4138}
    4239
    43 bool_t hal_atomic_cas( uint32_t * ptr,
    44                        uint32_t   old,
    45                        uint32_t   new )
     40bool_t hal_atomic_cas(uint32_t *ptr, uint32_t old, uint32_t new)
    4641{
    4742        return (atomic_cas_32((volatile uint32_t *)ptr, old, new) == old);
    4843}
    4944
    50 bool_t hal_atomic_test_set( uint32_t * ptr,
    51                             int32_t    val )
     45bool_t hal_atomic_test_set(uint32_t *ptr, int32_t val)
    5246{
    5347        x86_panic((char *)__func__);
  • trunk/hal/x86_64/core/hal_boot.S

    r51 r145  
    11/*
    22 * hal_boot.S - Kernel boot entry point
    3  * 
     3 *
    44 * Copyright (c) 2017 Maxime Villard
    55 * This code is inspired a lot from the NetBSD boot procedure, written by
  • trunk/hal/x86_64/core/hal_boot.h

    r111 r145  
    11/*
    22 * hal_boot.h - General values used by the boot procedure
    3  * 
     3 *
    44 * Copyright (c) 2017 Maxime Villard
    5  * 
     5 *
    66 * This file is part of ALMOS-MKH.
    77 *
  • trunk/hal/x86_64/core/hal_cpu.S

    r125 r145  
    11/*
    22 * hal_cpu.S - Miscellaneous CPU functions
    3  * 
     3 *
    44 * Copyright (c) 2017 Maxime Villard
    5  * 
     5 *
    66 * This file is part of ALMOS-MKH.
    77 *
  • trunk/hal/x86_64/core/hal_gpt.c

    r134 r145  
    257257uint32_t  GPT_SMALL;
    258258uint32_t  GPT_READABLE;
    259 uint32_t  GPT_WRITABLE; 
     259uint32_t  GPT_WRITABLE;
    260260uint32_t  GPT_EXECUTABLE;
    261 uint32_t  GPT_CACHABLE; 
    262 uint32_t  GPT_USER; 
     261uint32_t  GPT_CACHABLE;
     262uint32_t  GPT_USER;
    263263uint32_t  GPT_DIRTY;
    264264uint32_t  GPT_ACCESSED;
  • trunk/hal/x86_64/core/hal_internal.h

    r125 r145  
    11/*
    22 * hal_internal.h - x86-specific function definitions
    3  * 
     3 *
    44 * Copyright (c) 2017 Maxime Villard
    5  * 
     5 *
    66 * This file is part of ALMOS-MKH.
    77 *
  • trunk/hal/x86_64/core/hal_kentry.S

    r142 r145  
    11/*
    2  * hal_kentry.S - Entry points into the kernel (traps, interrupts, syscalls)
    3  * 
     2 * hal_kentry.S - Entry points into the kernel (exceptions/interrupts/syscalls)
     3 *
    44 * Copyright (c) 2017 Maxime Villard
    5  * 
     5 *
    66 * This file is part of ALMOS-MKH.
    77 *
  • trunk/hal/x86_64/core/hal_kentry.h

    r138 r145  
    11/*
    22 * hal_kentry.h - General values used in the different kernel entries
    3  * 
     3 *
    44 * Copyright (c) 2017 Maxime Villard
    5  * 
     5 *
    66 * This file is part of ALMOS-MKH.
    77 *
  • trunk/hal/x86_64/core/hal_multiboot.h

    r51 r145  
    11/*
    22 * hal_multiboot.h - Multiboot-specific values and structures
    3  * 
     3 *
    44 * Copyright (c) 2017 Maxime Villard
    5  * 
     5 *
    66 * This file is part of ALMOS-MKH.
    77 *
  • trunk/hal/x86_64/core/hal_register.h

    r82 r145  
    11/*
    22 * hal_register.h - Values available in some x86 registers
    3  * 
     3 *
    44 * Copyright (c) 2017 Maxime Villard
    5  * 
     5 *
    66 * This file is part of ALMOS-MKH.
    77 *
  • trunk/hal/x86_64/core/hal_remote.c

    r124 r145  
    2323#include <hal_internal.h>
    2424
    25 void hal_remote_sb( xptr_t   xp,
    26                     uint8_t  data )
     25void hal_remote_sb(xptr_t xp, uint8_t data)
    2726{
    2827        *(uint8_t *)xp = data;
    2928}
    3029
    31 void hal_remote_sw( xptr_t    xp,
    32                     uint32_t  data )
     30void hal_remote_sw(xptr_t xp, uint32_t data)
    3331{
    3432        *(uint32_t *)xp = data;
    3533}
    3634
    37 void hal_remote_swd( xptr_t    xp,
    38                      uint64_t  data )
     35void hal_remote_swd(xptr_t xp, uint64_t data)
    3936{
    4037        *(uint64_t *)xp = data;
    4138}
    4239
    43 void hal_remote_spt( xptr_t      xp,
    44                      void *      pt )
     40void hal_remote_spt(xptr_t xp, void *pt)
    4541{
    46         hal_remote_swd( xp , (uint64_t)pt );
     42        hal_remote_swd(xp, (uint64_t)pt);
    4743}
    4844
    49 uint8_t hal_remote_lb( xptr_t  xp )
     45uint8_t hal_remote_lb(xptr_t xp)
    5046{
    5147        return *(uint8_t *)xp;
    5248}
    5349
    54 uint32_t hal_remote_lw( xptr_t  xp )
     50uint32_t hal_remote_lw(xptr_t xp)
    5551{
    5652        return *(uint32_t *)xp;
    5753}
    5854
    59 uint64_t hal_remote_lwd( xptr_t  xp )
     55uint64_t hal_remote_lwd(xptr_t xp)
    6056{
    6157        return *(uint64_t *)xp;
    6258}
    6359
    64 void *hal_remote_lpt( xptr_t    xp )
     60void *hal_remote_lpt(xptr_t xp)
    6561{
    66         return (void *)hal_remote_lwd( xp );
     62        return (void *)hal_remote_lwd(xp);
    6763}
    6864
    69 bool_t hal_remote_atomic_cas( xptr_t    xp,
    70                               uint32_t  old,
    71                               uint32_t  new )
     65bool_t hal_remote_atomic_cas(xptr_t xp, uint32_t old, uint32_t new)
    7266{
    7367        return (atomic_cas_32((volatile uint32_t *)xp, old, new) == old);
    7468}
    7569
    76 uint32_t hal_remote_atomic_add( xptr_t   xp,
    77                                 uint32_t incr ) // XXX define as signed
     70uint32_t hal_remote_atomic_add(xptr_t xp, uint32_t incr)
    7871{
    7972        return atomic_add_32((volatile uint32_t *)xp, incr);
    8073}
    8174
    82 uint32_t hal_remote_atomic_and( xptr_t   xp,
    83                                 uint32_t mask )
     75uint32_t hal_remote_atomic_and(xptr_t xp, uint32_t mask)
    8476{
    8577        return atomic_and_32((volatile uint32_t *)xp, mask);
    8678}
    8779
    88 uint32_t hal_remote_atomic_or( xptr_t   xp,
    89                                uint32_t mask )
     80uint32_t hal_remote_atomic_or(xptr_t xp, uint32_t mask)
    9081{
    9182        return atomic_or_32((volatile uint32_t *)xp, mask);
    9283}
    9384
    94 error_t hal_remote_atomic_try_add( xptr_t     xp,
    95                                    uint32_t   incr,
    96                                    uint32_t * old )
     85error_t hal_remote_atomic_try_add(xptr_t xp, uint32_t incr, uint32_t *old)
    9786{
    9887        x86_panic((char *)__func__);
     
    10089}
    10190
    102 void hal_remote_memcpy( xptr_t   dst,
    103                         xptr_t   src,
    104                         uint32_t size )
     91void hal_remote_memcpy(xptr_t dst, xptr_t src, uint32_t size)
    10592{
    10693        memcpy((void *)dst, (void *)src, size);
  • trunk/hal/x86_64/core/hal_syscall.c

    r51 r145  
    11/*
    22 * hal_syscall.c - Implementation of syscall handler for TSAR-MIPS32.
    3  * 
     3 *
    44 * Author    Alain Greiner (2016,2017)
    55 *
  • trunk/hal/x86_64/core/hal_types.h

    r73 r145  
    3838
    3939/**************************************************************************
    40  *                      Exact-width integer types. 
     40 *                      Exact-width integer types.
    4141 **************************************************************************/
    4242
     
    5959
    6060/***************************************************************************
    61  * Pthread related types 
    62  **************************************************************************/
    63 
    64 typedef uint32_t      pthread_t;               
     61 * Pthread related types
     62 **************************************************************************/
     63
     64typedef uint32_t      pthread_t;
    6565typedef uint32_t      pthread_mutexattr_t;
    6666typedef uint32_t      pthread_barrier_t;
     
    9595
    9696/***************************************************************************
    97  * Global Process identifier type / fixed format 
     97 * Global Process identifier type / fixed format
    9898 * 16 MSB = cluster XY identifier
    9999 * 16 LSB = local process index
    100100 **************************************************************************/
    101101
    102 typedef uint32_t      pid_t; 
    103 
    104 /***************************************************************************
    105  * Local Process index 
     102typedef uint32_t      pid_t;
     103
     104/***************************************************************************
     105 * Local Process index
    106106 **************************************************************************/
    107107
     
    109109
    110110/***************************************************************************
    111  * Thread  identifier type / fixed format 
     111 * Thread  identifier type / fixed format
    112112 * 16 MSB = cluster XY identifier
    113113 * 16 LSB = local thread index
     
    117117
    118118/***************************************************************************
    119  * Local Thread index 
     119 * Local Thread index
    120120 **************************************************************************/
    121121
     
    142142
    143143/***************************************************************************
    144  * This structure defines a single 32 bits integer alone in a cache line. 
     144 * This structure defines a single 32 bits integer alone in a cache line.
    145145 **************************************************************************/
    146146
  • trunk/hal/x86_64/core/hal_uspace.c

    r51 r145  
    11/*
    22 * hal_uspace.c - implementation of Generic User Space Access API for MIPS32
    3  * 
     3 *
    44 * Author  Mohamed Karaoui (2015)
    55 *         Alain Greiner   (2016)
    66 *
    77 * Copyright (c) UPMC Sorbonne Universites
    8  * 
     8 *
    99 * This file is part of ALMOS-MKH..
    1010 *
  • trunk/hal/x86_64/core/x86_printf.c

    r94 r145  
    22 * x86_printf.c - A printf function for x86 (debug only).
    33 *
    4  * Copyright (c) [don't know exactly, found on the internet... anyway, this
    5  *                file will be removed soon...]
     4 * Copyright (c) 2017 Maxime Villard
    65 *
    76 * This file is part of ALMOS-MKH.
     
    255254                        } else if (c == 's') {
    256255                                x86_printf((char *) va_arg(ap, uint64_t));
    257                         } 
     256                        }
    258257                } else
    259258                        x86_putc(c);
Note: See TracChangeset for help on using the changeset viewer.