[coreboot] I want submit some code, but there are some problem

王翔 merle at tya.email
Tue Jul 3 10:25:46 CEST 2018


I want submit some code to support temporarily block multiple-threads.
But this code can't pass check by `checkpatch`.
This code look like this:


```

#define barrier() {asm volatile ("fence" ::: "memory"); }

/*
 * If your code needs to temporarily block multiple-threads, do this:
 *     SMP_PAUSE(active)    // `active` is hartid of working thread
 *     ... single-threaded work ...
 *     SMP_RESUME()
 *     ... multi-threaded work ...
 */

#define SMP_PAUSE(active) do \
{ \
    __label__ l_entry, l_exit; \
    static int _flag_; \
    if (active == read_csr(mhartid)) \
        goto l_entry; \
    do {barrier(); } while (!_flag_); \
    goto l_exit; \
l_entry:


#define SMP_RESUME() \
    _flag_ = 1; \
l_exit: \
    barrier(); \
} while (0)

```



Xiang Wang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot/attachments/20180703/ae50d3a8/attachment.html>


More information about the coreboot mailing list