Changeset 38428aa3 in mainline


Ignore:
Timestamp:
2009-08-27T12:23:46Z (15 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ff211d2
Parents:
c4d11c5
Message:

workaround strict-aliasing rules

Location:
kernel/arch/ia64
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/ia64/include/faddr.h

    rc4d11c5 r38428aa3  
    2727 */
    2828
    29 /** @addtogroup ia64   
     29/** @addtogroup ia64
    3030 * @{
    3131 */
     
    3838#include <arch/types.h>
    3939
    40 /** 
     40/**
    4141 *
    4242 * Calculate absolute address of function
    4343 * referenced by fptr pointer.
    4444 *
    45  * @param f Function pointer.
     45 * @param fptr Function pointer.
    4646 *
    4747 */
    48 #define FADDR(f)         (*((uintptr_t *)(f)));
     48#define FADDR(fptr)  (((fncptr_t *) (fptr))->fnc)
    4949
    5050#endif
  • kernel/arch/ia64/include/types.h

    rc4d11c5 r38428aa3  
    6767        unative_t fnc;
    6868        unative_t gp;
    69 } fncptr_t;
     69} __attribute__((may_alias)) fncptr_t;
    7070
    7171#define PRIp "lx"       /**< Format for uintptr_t. */
  • kernel/arch/ia64/src/cpu/cpu.c

    rc4d11c5 r38428aa3  
    5454        char vendor[2 * sizeof(uint64_t) + 1];
    5555       
    56         *((uint64_t *) &vendor[0 * sizeof(uint64_t)]) = CPU->arch.cpuid0;
    57         *((uint64_t *) &vendor[1 * sizeof(uint64_t)]) = CPU->arch.cpuid1;
     56        memcpy(vendor, &CPU->arch.cpuid0, 8);
     57        memcpy(vendor + 8, &CPU->arch.cpuid1, 8);
    5858        vendor[sizeof(vendor) - 1] = 0;
    5959       
    60         switch(m->arch.cpuid3.family) {
     60        switch (m->arch.cpuid3.family) {
    6161        case FAMILY_ITANIUM:
    6262                family_str = "Itanium";
Note: See TracChangeset for help on using the changeset viewer.