Changeset 2815cdb in rtems-libbsd


Ignore:
Timestamp:
12/02/13 14:36:31 (10 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, 5, 5-freebsd-12, 6-freebsd-12, freebsd-9.3, master
Children:
57bfdf7
Parents:
3e101be
git-author:
Sebastian Huber <sebastian.huber@…> (12/02/13 14:36:31)
git-committer:
Sebastian Huber <sebastian.huber@…> (12/04/13 12:44:04)
Message:

Changes due to <sys/cpuset.h> from latest Newlib

Files:
7 edited
1 moved

Legend:

Unmodified
Added
Removed
  • freebsd-to-rtems.py

    r3e101be r2815cdb  
    176176        data = re.sub('#include <sys/lock.h>', '#include <rtems/bsd/sys/lock.h>', data)
    177177        data = re.sub('#include <sys/time.h>', '#include <rtems/bsd/sys/time.h>', data)
     178        data = re.sub('#include <sys/cpuset.h>', '#include <rtems/bsd/sys/cpuset.h>', data)
    178179        data = re.sub('#include <sys/errno.h>', '#include <rtems/bsd/sys/errno.h>', data)
    179180        data = re.sub('#include <sys/param.h>', '#include <rtems/bsd/sys/param.h>', data)
  • freebsd/lib/libmemstat/memstat_uma.c

    r3e101be r2815cdb  
    3030
    3131#include <rtems/bsd/sys/param.h>
    32 #include <sys/cpuset.h>
     32#include <rtems/bsd/sys/cpuset.h>
    3333#include <sys/sysctl.h>
    3434
  • freebsd/sys/kern/init_main.c

    r3e101be r2815cdb  
    7878#include <sys/malloc.h>
    7979#include <sys/conf.h>
    80 #include <sys/cpuset.h>
     80#include <rtems/bsd/sys/cpuset.h>
    8181
    8282#include <machine/cpu.h>
  • freebsd/sys/kern/kern_intr.c

    r3e101be r2815cdb  
    3535#include <sys/bus.h>
    3636#include <sys/conf.h>
    37 #include <sys/cpuset.h>
     37#include <rtems/bsd/sys/cpuset.h>
    3838#include <sys/rtprio.h>
    3939#include <sys/systm.h>
  • freebsd/sys/sys/_cpuset.h

    r3e101be r2815cdb  
    3434
    3535#ifdef _KERNEL
     36#ifndef __rtems__
    3637#define CPU_SETSIZE     MAXCPU
     38#endif /* __rtems__ */
    3739#endif
    3840
     
    4345#endif
    4446
     47#ifndef __rtems__
    4548#define _NCPUBITS       (sizeof(long) * NBBY)   /* bits per mask */
    4649#define _NCPUWORDS      howmany(CPU_SETSIZE, _NCPUBITS)
     
    4952        long    __bits[howmany(CPU_SETSIZE, _NCPUBITS)];
    5053} cpuset_t;
     54#else /* __rtems__ */
     55#include <sys/cpuset.h>
     56
     57typedef cpu_set_t cpuset_t;
     58#endif /* __rtems__ */
    5159
    5260#endif /* !_SYS__CPUSET_H_ */
  • freebsd/sys/sys/smp.h

    r3e101be r2815cdb  
    1717#ifndef LOCORE
    1818
    19 #include <sys/cpuset.h>
     19#include <rtems/bsd/sys/cpuset.h>
    2020
    2121/*
  • freebsd/sys/sys/sysproto.h

    r3e101be r2815cdb  
    1212#include <sys/signal.h>
    1313#include <sys/acl.h>
    14 #include <sys/cpuset.h>
     14#include <rtems/bsd/sys/cpuset.h>
    1515#include <sys/_semaphore.h>
    1616#include <sys/ucontext.h>
  • rtemsbsd/include/rtems/bsd/sys/cpuset.h

    r3e101be r2815cdb  
    3030 */
    3131
    32 #ifndef _SYS_CPUSET_H_
    33 #define _SYS_CPUSET_H_
     32#ifndef _RTEMS_BSD_SYS_CPUSET_H_
     33#define _RTEMS_BSD_SYS_CPUSET_H_
    3434
    3535#include <sys/_cpuset.h>
     
    3737#define CPUSETBUFSIZ    ((2 + sizeof(long) * 2) * _NCPUWORDS)
    3838
    39 /*
    40  * Macros addressing word and bit within it, tuned to make compiler
    41  * optimize cases when CPU_SETSIZE fits into single machine word.
    42  */
    43 #define __cpuset_mask(n)                                \
    44         ((long)1 << ((_NCPUWORDS == 1) ? (__size_t)(n) : ((n) % _NCPUBITS)))
    45 #define __cpuset_word(n)        ((_NCPUWORDS == 1) ? 0 : ((n) / _NCPUBITS))
    46 
    47 #define CPU_CLR(n, p)   ((p)->__bits[__cpuset_word(n)] &= ~__cpuset_mask(n))
    48 #define CPU_COPY(f, t)  (void)(*(t) = *(f))
    49 #define CPU_ISSET(n, p) (((p)->__bits[__cpuset_word(n)] & __cpuset_mask(n)) != 0)
    50 #define CPU_SET(n, p)   ((p)->__bits[__cpuset_word(n)] |= __cpuset_mask(n))
    51 #define CPU_ZERO(p) do {                                \
    52         __size_t __i;                                   \
    53         for (__i = 0; __i < _NCPUWORDS; __i++)          \
    54                 (p)->__bits[__i] = 0;                   \
    55 } while (0)
    56 
    57 #define CPU_FILL(p) do {                                \
    58         __size_t __i;                                   \
    59         for (__i = 0; __i < _NCPUWORDS; __i++)          \
    60                 (p)->__bits[__i] = -1;                  \
    61 } while (0)
    62 
    6339#define CPU_SETOF(n, p) do {                                    \
    6440        CPU_ZERO(p);                                            \
    6541        ((p)->__bits[__cpuset_word(n)] = __cpuset_mask(n));     \
    6642} while (0)
    67 
    68 /* Is p empty. */
    69 #define CPU_EMPTY(p) __extension__ ({                   \
    70         __size_t __i;                                   \
    71         for (__i = 0; __i < _NCPUWORDS; __i++)          \
    72                 if ((p)->__bits[__i])                   \
    73                         break;                          \
    74         __i == _NCPUWORDS;                              \
    75 })
    7643
    7744/* Is p full set. */
     
    10471        __i != _NCPUWORDS;                              \
    10572})
    106 
    107 /* Compare two sets, returns 0 if equal 1 otherwise. */
    108 #define CPU_CMP(p, c) __extension__ ({                  \
    109         __size_t __i;                                   \
    110         for (__i = 0; __i < _NCPUWORDS; __i++)          \
    111                 if (((c)->__bits[__i] !=                \
    112                     (p)->__bits[__i]))                  \
    113                         break;                          \
    114         __i != _NCPUWORDS;                              \
    115 })
    116 
    117 #define CPU_OR(d, s) do {                               \
    118         __size_t __i;                                   \
    119         for (__i = 0; __i < _NCPUWORDS; __i++)          \
    120                 (d)->__bits[__i] |= (s)->__bits[__i];   \
    121 } while (0)
    122 
    123 #define CPU_AND(d, s) do {                              \
    124         __size_t __i;                                   \
    125         for (__i = 0; __i < _NCPUWORDS; __i++)          \
    126                 (d)->__bits[__i] &= (s)->__bits[__i];   \
    127 } while (0)
    128 
    129 #define CPU_NAND(d, s) do {                             \
    130         __size_t __i;                                   \
    131         for (__i = 0; __i < _NCPUWORDS; __i++)          \
    132                 (d)->__bits[__i] &= ~(s)->__bits[__i];  \
    133 } while (0)
    13473
    13574#define CPU_CLR_ATOMIC(n, p)                                            \
     
    227166__END_DECLS
    228167#endif
    229 #endif /* !_SYS_CPUSET_H_ */
     168#endif /* !_RTEMS_BSD_SYS_CPUSET_H_ */
Note: See TracChangeset for help on using the changeset viewer.