Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork8.2k
Commit2923d54
committed
rp2: Support calling pendsv_suspend/resume from core 1.
Previously, this was subject to races incrementing/decrementingthe counter variable pendsv_lock.Technically, all that's needed here would be to make pendsv_lock an atomiccounter.This implementation fulfils a stronger guarantee: it also provides mutualexclusion for the core which calls pendsv_suspend(). This is because thecurrent use of pendsv_suspend/resume in MicroPython is to ensure exclusiveaccess to softtimer data structures, and this does require mutualexclusion.The conceptually cleaner implementation would split the mutual exclusionpart out into a softtimer-specific spinlock, but this increases thecomplexity and doesn't seem like it makes for a better implementation inthe long run.This work was funded through GitHub Sponsors.Signed-off-by: Angus Gratton <angus@redyak.com.au>1 parentfccab87 commit2923d54
3 files changed
+27
-7
lines changedLines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
76 | 76 |
| |
77 | 77 |
| |
78 | 78 |
| |
| 79 | + | |
79 | 80 |
| |
80 | 81 |
| |
81 | 82 |
| |
|
Lines changed: 25 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
25 | 25 |
| |
26 | 26 |
| |
27 | 27 |
| |
| 28 | + | |
28 | 29 |
| |
29 | 30 |
| |
30 | 31 |
| |
| |||
34 | 35 |
| |
35 | 36 |
| |
36 | 37 |
| |
37 |
| - | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
38 | 43 |
| |
39 | 44 |
| |
40 |
| - | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
41 | 49 |
| |
42 | 50 |
| |
43 | 51 |
| |
44 |
| - | |
45 |
| - | |
| 52 | + | |
46 | 53 |
| |
47 | 54 |
| |
48 | 55 |
| |
| |||
55 | 62 |
| |
56 | 63 |
| |
57 | 64 |
| |
58 |
| - | |
59 | 65 |
| |
60 |
| - | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
61 | 70 |
| |
62 | 71 |
| |
63 | 72 |
| |
| |||
68 | 77 |
| |
69 | 78 |
| |
70 | 79 |
| |
71 |
| - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
72 | 88 |
| |
73 | 89 |
| |
74 | 90 |
| |
| |||
81 | 97 |
| |
82 | 98 |
| |
83 | 99 |
| |
| 100 | + | |
| 101 | + | |
84 | 102 |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
47 | 47 |
| |
48 | 48 |
| |
49 | 49 |
| |
| 50 | + | |
50 | 51 |
| |
51 | 52 |
| |
52 | 53 |
| |
|
0 commit comments
Comments
(0)