Changeset b169619 in mainline for common/stdc/cc.h


Ignore:
Timestamp:
2023-10-27T17:38:32Z (7 months ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
master, topic/msim-upgrade, topic/simplify-dev-export
Children:
44e8541
Parents:
c89ae25
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2023-10-27 13:19:20)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2023-10-27 17:38:32)
Message:

Deduplicate mem functions

There are a number of functions which are copied between
kernel, libc, and potentially boot too. mem*() functions
are first such offenders. All this duplicate code will
be moved to directory 'common'.

File:
1 moved

Legend:

Unmodified
Added
Removed
  • common/stdc/cc.h

    rc89ae25 rb169619  
    11/*
    2  * Copyright (c) 2001-2004 Jakub Jermar
     2 * Copyright (c) 2013 Vojtech Horky
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
     29/** @addtogroup libc
     30 * @{
     31 */
    2932/** @file
     33 * Macros related to used compiler (such as GCC-specific attributes).
    3034 */
    3135
    32 #ifndef BOOT_MEMSTR_H_
    33 #define BOOT_MEMSTR_H_
     36#ifndef _LIBC_CC_H_
     37#define _LIBC_CC_H_
    3438
    35 #include <stddef.h>
     39#ifndef __clang__
     40#define ATTRIBUTE_OPTIMIZE(opt) \
     41    __attribute__ ((optimize(opt)))
     42#else
     43#define ATTRIBUTE_OPTIMIZE(opt)
     44#endif
    3645
    37 extern void *memcpy(void *, const void *, size_t)
    38     __attribute__((nonnull(1, 2)))
    39     __attribute__((optimize("-fno-tree-loop-distribute-patterns")));
    40 extern void *memset(void *, int, size_t)
    41     __attribute__((nonnull(1)))
    42     __attribute__((optimize("-fno-tree-loop-distribute-patterns")));
    43 extern void *memmove(void *, const void *, size_t)
    44     __attribute__((nonnull(1, 2)));
     46#define ATTRIBUTE_OPTIMIZE_NO_TLDP \
     47    ATTRIBUTE_OPTIMIZE("-fno-tree-loop-distribute-patterns")
     48
     49#ifdef CONFIG_LTO
     50#define DO_NOT_DISCARD __attribute__ ((used))
     51#else
     52#define DO_NOT_DISCARD
     53#endif
    4554
    4655#endif
Note: See TracChangeset for help on using the changeset viewer.