Ignore:
Timestamp:
Jun 26, 2017, 6:45:41 PM (7 years ago)
Author:
ertl-honda
Message:

3.0.0のリリース版に追従

File:
1 edited

Legend:

Unmodified
Added
Removed
  • asp3_wo_tecs/trunk/test/bit_kernel.c

    r302 r305  
    44 *      Advanced Standard Profile Kernel
    55 *
    6  *  Copyright (C) 2005-2015 by Embedded and Real-Time Systems Laboratory
     6 *  Copyright (C) 2005-2016 by Embedded and Real-Time Systems Laboratory
    77 *              Graduate School of Information Science, Nagoya Univ., JAPAN
    88 *
     
    5151 *  の責任を負わない.
    5252 *
    53  *  $Id: bit_kernel.c 456 2015-08-16 06:11:51Z ertl-hiro $
     53 *  $Id: bit_kernel.c 554 2016-01-17 13:21:59Z ertl-hiro $
    5454 */
    5555
     
    167167#endif /* PRIMAP_BIT */
    168168
     169Inline bool_t
     170primap_empty(void)
     171{
     172#ifndef PRIMAP_LEVEL_2
     173        return(ready_primap == 0U);
     174#else /* PRIMAP_LEVEL_2 */
     175        return(ready_primap1 == 0U);
     176#endif /* PRIMAP_LEVEL_2 */
     177}
     178
     179Inline uint16_t
     180primap_extract_bit(uint_t pri)
     181{
     182#ifndef PRIMAP_LEVEL_2
     183        return(ready_primap & PRIMAP_BIT(pri));
     184#else /* PRIMAP_LEVEL_2 */
     185        return(ready_primap2[pri / TBIT_PRIMAP] & PRIMAP_BIT(pri % TBIT_PRIMAP));
     186#endif /* PRIMAP_LEVEL_2 */
     187}
     188
    169189static ER
    170190bit_schedcb(void)
     
    178198         */
    179199        if (enadsp) {
    180                 if (ready_primap == 0U) {
     200                if (primap_empty()) {
    181201                        if (p_schedtsk != NULL) {
    182202                                return(E_SYS_LINENO);
     
    189209                }
    190210        }
     211
     212#ifdef PRIMAP_LEVEL_2
     213        /*
     214         *  ready_primap1とready_primap2の整合性の検査
     215         */
     216        for (pri = 0; pri < TNUM_TPRI; pri += TBIT_PRIMAP) {
     217                if (ready_primap2[pri / TBIT_PRIMAP] == 0U) {
     218                        if ((ready_primap1 & PRIMAP_BIT(pri / TBIT_PRIMAP)) != 0U) {
     219                                return(E_SYS_LINENO);
     220                        }
     221                }
     222                else {
     223                        if ((ready_primap1 & PRIMAP_BIT(pri / TBIT_PRIMAP)) == 0U) {
     224                                return(E_SYS_LINENO);
     225                        }
     226                }
     227        }
     228#endif /* PRIMAP_LEVEL_2 */
    191229
    192230        /*
     
    196234                p_queue = ready_queue[pri].p_next;
    197235                if (p_queue == &ready_queue[pri]) {
    198                         if ((ready_primap & PRIMAP_BIT(pri)) != 0U) {
     236                        if (primap_extract_bit(pri) != 0U) {
    199237                                return(E_SYS_LINENO);
    200238                        }
    201239                }
    202240                else {
    203                         if ((ready_primap & PRIMAP_BIT(pri)) == 0U) {
     241                        if (primap_extract_bit(pri) == 0U) {
    204242                                return(E_SYS_LINENO);
    205243                        }
Note: See TracChangeset for help on using the changeset viewer.