mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-18 12:52:44 +01:00
Merge pull request #1882 from LudwigOrtmann/disableIRQ-type
core,sys: fix storage types for irq API usage
This commit is contained in:
commit
41e1305517
@ -201,7 +201,7 @@ int hwtimer_remove(int n)
|
|||||||
{
|
{
|
||||||
DEBUG("hwtimer_remove n=%d\n", n);
|
DEBUG("hwtimer_remove n=%d\n", n);
|
||||||
|
|
||||||
int state = disableIRQ();
|
unsigned state = disableIRQ();
|
||||||
hwtimer_arch_unset(n);
|
hwtimer_arch_unset(n);
|
||||||
|
|
||||||
lifo_insert(lifo, n);
|
lifo_insert(lifo, n);
|
||||||
|
@ -151,7 +151,7 @@ static int _msg_send(msg_t *m, kernel_pid_t target_pid, bool block)
|
|||||||
|
|
||||||
int msg_send_to_self(msg_t *m)
|
int msg_send_to_self(msg_t *m)
|
||||||
{
|
{
|
||||||
unsigned int state = disableIRQ();
|
unsigned state = disableIRQ();
|
||||||
|
|
||||||
m->sender_pid = sched_active_pid;
|
m->sender_pid = sched_active_pid;
|
||||||
int res = queue_msg((tcb_t *) sched_active_thread, m);
|
int res = queue_msg((tcb_t *) sched_active_thread, m);
|
||||||
@ -208,7 +208,7 @@ int msg_send_receive(msg_t *m, msg_t *reply, kernel_pid_t target_pid)
|
|||||||
|
|
||||||
int msg_reply(msg_t *m, msg_t *reply)
|
int msg_reply(msg_t *m, msg_t *reply)
|
||||||
{
|
{
|
||||||
int state = disableIRQ();
|
unsigned state = disableIRQ();
|
||||||
|
|
||||||
tcb_t *target = (tcb_t*) sched_threads[m->sender_pid];
|
tcb_t *target = (tcb_t*) sched_threads[m->sender_pid];
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@ void mutex_lock(struct mutex_t *mutex)
|
|||||||
|
|
||||||
static void mutex_wait(struct mutex_t *mutex)
|
static void mutex_wait(struct mutex_t *mutex)
|
||||||
{
|
{
|
||||||
int irqstate = disableIRQ();
|
unsigned irqstate = disableIRQ();
|
||||||
DEBUG("%s: Mutex in use. %u\n", sched_active_thread->name, mutex->val);
|
DEBUG("%s: Mutex in use. %u\n", sched_active_thread->name, mutex->val);
|
||||||
|
|
||||||
if (mutex->val == 0) {
|
if (mutex->val == 0) {
|
||||||
@ -85,7 +85,7 @@ static void mutex_wait(struct mutex_t *mutex)
|
|||||||
void mutex_unlock(struct mutex_t *mutex)
|
void mutex_unlock(struct mutex_t *mutex)
|
||||||
{
|
{
|
||||||
DEBUG("%s: unlocking mutex. val: %u pid: %" PRIkernel_pid "\n", sched_active_thread->name, mutex->val, sched_active_pid);
|
DEBUG("%s: unlocking mutex. val: %u pid: %" PRIkernel_pid "\n", sched_active_thread->name, mutex->val, sched_active_pid);
|
||||||
int irqstate = disableIRQ();
|
unsigned irqstate = disableIRQ();
|
||||||
|
|
||||||
if (mutex->val != 0) {
|
if (mutex->val != 0) {
|
||||||
priority_queue_node_t *next = priority_queue_remove_head(&(mutex->queue));
|
priority_queue_node_t *next = priority_queue_remove_head(&(mutex->queue));
|
||||||
@ -107,7 +107,7 @@ void mutex_unlock(struct mutex_t *mutex)
|
|||||||
void mutex_unlock_and_sleep(struct mutex_t *mutex)
|
void mutex_unlock_and_sleep(struct mutex_t *mutex)
|
||||||
{
|
{
|
||||||
DEBUG("%s: unlocking mutex. val: %u pid: %" PRIkernel_pid ", and taking a nap\n", sched_active_thread->name, mutex->val, sched_active_pid);
|
DEBUG("%s: unlocking mutex. val: %u pid: %" PRIkernel_pid ", and taking a nap\n", sched_active_thread->name, mutex->val, sched_active_pid);
|
||||||
int irqstate = disableIRQ();
|
unsigned irqstate = disableIRQ();
|
||||||
|
|
||||||
if (mutex->val != 0) {
|
if (mutex->val != 0) {
|
||||||
priority_queue_node_t *next = priority_queue_remove_head(&(mutex->queue));
|
priority_queue_node_t *next = priority_queue_remove_head(&(mutex->queue));
|
||||||
|
@ -68,7 +68,7 @@ int thread_wakeup(kernel_pid_t pid)
|
|||||||
{
|
{
|
||||||
DEBUG("thread_wakeup: Trying to wakeup PID %" PRIkernel_pid "...\n", pid);
|
DEBUG("thread_wakeup: Trying to wakeup PID %" PRIkernel_pid "...\n", pid);
|
||||||
|
|
||||||
int old_state = disableIRQ();
|
unsigned old_state = disableIRQ();
|
||||||
|
|
||||||
tcb_t *other_thread = (tcb_t *) sched_threads[pid];
|
tcb_t *other_thread = (tcb_t *) sched_threads[pid];
|
||||||
if (other_thread && other_thread->status == STATUS_SLEEPING) {
|
if (other_thread && other_thread->status == STATUS_SLEEPING) {
|
||||||
|
@ -110,7 +110,7 @@ void chardev_loop(ringbuffer_t *rb)
|
|||||||
|
|
||||||
if (rb->avail && (r != NULL)) {
|
if (rb->avail && (r != NULL)) {
|
||||||
DEBUG("Data is available\n");
|
DEBUG("Data is available\n");
|
||||||
int state = disableIRQ();
|
unsigned state = disableIRQ();
|
||||||
int nbytes = min(r->nbytes, rb->avail);
|
int nbytes = min(r->nbytes, rb->avail);
|
||||||
DEBUG("uart0_thread [%i]: sending %i bytes received from %" PRIkernel_pid " to pid %" PRIkernel_pid "\n", pid, nbytes, m.sender_pid, reader_pid);
|
DEBUG("uart0_thread [%i]: sending %i bytes received from %" PRIkernel_pid " to pid %" PRIkernel_pid "\n", pid, nbytes, m.sender_pid, reader_pid);
|
||||||
ringbuffer_get(rb, r->buffer, nbytes);
|
ringbuffer_get(rb, r->buffer, nbytes);
|
||||||
|
@ -96,7 +96,7 @@ static void sem_thread_blocked(sem_t *sem)
|
|||||||
|
|
||||||
int sem_wait(sem_t *sem)
|
int sem_wait(sem_t *sem)
|
||||||
{
|
{
|
||||||
int old_state = disableIRQ();
|
unsigned old_state = disableIRQ();
|
||||||
while (1) {
|
while (1) {
|
||||||
unsigned value = sem->value;
|
unsigned value = sem->value;
|
||||||
if (value == 0) {
|
if (value == 0) {
|
||||||
@ -121,7 +121,7 @@ int sem_timedwait(sem_t *sem, const struct timespec *abstime)
|
|||||||
|
|
||||||
int sem_trywait(sem_t *sem)
|
int sem_trywait(sem_t *sem)
|
||||||
{
|
{
|
||||||
int old_state = disableIRQ();
|
unsigned old_state = disableIRQ();
|
||||||
int result;
|
int result;
|
||||||
|
|
||||||
unsigned value = sem->value;
|
unsigned value = sem->value;
|
||||||
@ -139,7 +139,7 @@ int sem_trywait(sem_t *sem)
|
|||||||
|
|
||||||
int sem_post(sem_t *sem)
|
int sem_post(sem_t *sem)
|
||||||
{
|
{
|
||||||
int old_state = disableIRQ();
|
unsigned old_state = disableIRQ();
|
||||||
++sem->value;
|
++sem->value;
|
||||||
|
|
||||||
priority_queue_node_t *next = priority_queue_remove_head(&sem->queue);
|
priority_queue_node_t *next = priority_queue_remove_head(&sem->queue);
|
||||||
|
@ -237,7 +237,7 @@ kernel_pid_t transceiver_start(void)
|
|||||||
uint8_t transceiver_register(transceiver_type_t t, kernel_pid_t pid)
|
uint8_t transceiver_register(transceiver_type_t t, kernel_pid_t pid)
|
||||||
{
|
{
|
||||||
int result = 0;
|
int result = 0;
|
||||||
int state = disableIRQ();
|
unsigned state = disableIRQ();
|
||||||
for (size_t i = 0; i < TRANSCEIVER_MAX_REGISTERED; i++) {
|
for (size_t i = 0; i < TRANSCEIVER_MAX_REGISTERED; i++) {
|
||||||
if ((reg[i].pid == pid) || (reg[i].transceivers == TRANSCEIVER_NONE)) {
|
if ((reg[i].pid == pid) || (reg[i].transceivers == TRANSCEIVER_NONE)) {
|
||||||
reg[i].transceivers |= t;
|
reg[i].transceivers |= t;
|
||||||
@ -256,7 +256,7 @@ uint8_t transceiver_register(transceiver_type_t t, kernel_pid_t pid)
|
|||||||
uint8_t transceiver_unregister(transceiver_type_t t, kernel_pid_t pid)
|
uint8_t transceiver_unregister(transceiver_type_t t, kernel_pid_t pid)
|
||||||
{
|
{
|
||||||
int result = 0;
|
int result = 0;
|
||||||
int state = disableIRQ();
|
unsigned state = disableIRQ();
|
||||||
for (size_t i = 0; i < TRANSCEIVER_MAX_REGISTERED; ++i) {
|
for (size_t i = 0; i < TRANSCEIVER_MAX_REGISTERED; ++i) {
|
||||||
if (reg[i].pid == pid) {
|
if (reg[i].pid == pid) {
|
||||||
reg[i].transceivers &= ~t;
|
reg[i].transceivers &= ~t;
|
||||||
|
@ -307,7 +307,7 @@ void vtimer_get_localtime(struct tm *localt)
|
|||||||
int vtimer_init(void)
|
int vtimer_init(void)
|
||||||
{
|
{
|
||||||
DEBUG("vtimer_init().\n");
|
DEBUG("vtimer_init().\n");
|
||||||
int state = disableIRQ();
|
unsigned state = disableIRQ();
|
||||||
seconds = 0;
|
seconds = 0;
|
||||||
|
|
||||||
longterm_tick_start = 0;
|
longterm_tick_start = 0;
|
||||||
@ -372,7 +372,7 @@ int vtimer_sleep(timex_t time)
|
|||||||
|
|
||||||
int vtimer_remove(vtimer_t *t)
|
int vtimer_remove(vtimer_t *t)
|
||||||
{
|
{
|
||||||
unsigned int irq_state = disableIRQ();
|
unsigned irq_state = disableIRQ();
|
||||||
|
|
||||||
priority_queue_remove(&shortterm_priority_queue_root, timer_get_node(t));
|
priority_queue_remove(&shortterm_priority_queue_root, timer_get_node(t));
|
||||||
priority_queue_remove(&longterm_priority_queue_root, timer_get_node(t));
|
priority_queue_remove(&longterm_priority_queue_root, timer_get_node(t));
|
||||||
|
Loading…
Reference in New Issue
Block a user