mirror of
https://github.com/drasko/codezero.git
synced 2026-02-04 22:13:16 +01:00
Made changes to map devices dynamically upon irq registration.
All will be reverted since mapping devices statically is much simpler.
This commit is contained in:
24
include/l4/lib/addr.h
Normal file
24
include/l4/lib/addr.h
Normal file
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Address allocation pool
|
||||
*
|
||||
* Copyright (C) 2007 - 2009 Bahadir Balban
|
||||
*/
|
||||
#ifndef __KERNEL_ADDR_H__
|
||||
#define __KERNEL_ADDR_H__
|
||||
|
||||
#include <lib/idpool.h>
|
||||
|
||||
/* Address pool to allocate from a range of addresses */
|
||||
struct address_pool {
|
||||
struct id_pool idpool;
|
||||
unsigned long start;
|
||||
unsigned long end;
|
||||
};
|
||||
|
||||
void *kernel_new_address(int npages);
|
||||
int kernel_delete_address(void *addr, int npages);
|
||||
|
||||
void *address_new(struct address_pool *pool, int npages);
|
||||
int address_del(struct address_pool *, void *addr, int npages);
|
||||
|
||||
#endif /* __KERNEL_ADDR_H__ */
|
||||
@@ -40,9 +40,9 @@ static inline void spin_unlock(struct spinlock *s)
|
||||
* on other cpus.
|
||||
*/
|
||||
static inline void spin_lock_irq(struct spinlock *s,
|
||||
unsigned long state)
|
||||
unsigned long *state)
|
||||
{
|
||||
irq_local_disable_save(&state);
|
||||
irq_local_disable_save(state);
|
||||
#if defined(CONFIG_SMP)
|
||||
__spin_lock(&s->lock);
|
||||
#endif
|
||||
|
||||
@@ -13,8 +13,9 @@ struct waitqueue {
|
||||
#define WAKEUP_ASYNC 0
|
||||
|
||||
enum wakeup_flags {
|
||||
WAKEUP_INTERRUPT = (1 << 0),
|
||||
WAKEUP_SYNC = (1 << 1)
|
||||
WAKEUP_INTERRUPT = (1 << 0), /* Set interrupt flag for task */
|
||||
WAKEUP_SYNC = (1 << 1), /* Wake it up synchronously */
|
||||
WAKEUP_IRQ = (1 << 2) /* Disable irqs on spinlocks */
|
||||
};
|
||||
|
||||
#define CREATE_WAITQUEUE_ON_STACK(wq, tsk) \
|
||||
|
||||
Reference in New Issue
Block a user