Changeset 7c5320c in mainline for kernel/arch


Ignore:
Timestamp:
2023-02-07T16:03:05Z (3 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1eaead4
Parents:
5110d0a
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2023-02-07 15:59:26)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2023-02-07 16:03:05)
Message:

Use the semaphore interface instead of waitq in some places

Since we already have an underused semaphore API in the kernel,
it would be worthwhile to use it in places where the baseline
semaphore semantics are needed. It makes the function of the
calls obvious even to people unfamiliar with the details of
waitq API.

Location:
kernel/arch
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/ia32/src/smp/smp.c

    r5110d0a r7c5320c  
    178178                         * supposed to wake us up.
    179179                         */
    180                         if (waitq_sleep_timeout(&ap_completion_wq, 1000000,
    181                             SYNCH_FLAGS_NONE, NULL) == ETIMEOUT) {
     180                        if (semaphore_down_timeout(&ap_completion_semaphore, 1000000) != EOK) {
    182181                                log(LF_ARCH, LVL_NOTE, "%s: waiting for cpu%u "
    183182                                    "(APIC ID = %d) timed out", __FUNCTION__,
  • kernel/arch/sparc64/src/smp/sun4u/smp.c

    r5110d0a r7c5320c  
    106106        waking_up_mid = mid;
    107107
    108         if (waitq_sleep_timeout(&ap_completion_wq, 1000000,
    109             SYNCH_FLAGS_NONE, NULL) == ETIMEOUT)
     108        if (semaphore_down_timeout(&ap_completion_semaphore, 1000000) != EOK)
    110109                log(LF_ARCH, LVL_NOTE, "%s: waiting for processor (mid = %" PRIu32
    111110                    ") timed out", __func__, mid);
  • kernel/arch/sparc64/src/smp/sun4v/smp.c

    r5110d0a r7c5320c  
    373373#endif
    374374
    375         if (waitq_sleep_timeout(&ap_completion_wq, 10000000,
    376             SYNCH_FLAGS_NONE, NULL) == ETIMEOUT)
     375        if (semaphore_down_timeout(&ap_completion_semaphore, 10000000) != EOK)
    377376                printf("%s: waiting for processor (cpuid = %" PRIu64 ") timed out\n",
    378377                    __func__, cpuid);
Note: See TracChangeset for help on using the changeset viewer.