Changes between 16 March 2010 - 6 April 2010

Mutex system call fixed for multiple contenders
Userspace irq support extended to keyboard/mouse.
Scheduler modified for real-time irq tasks
This commit is contained in:
Bahadir Balban
2010-04-06 19:47:12 +03:00
parent 1a62b92a8d
commit 403a038845
75 changed files with 1137 additions and 579 deletions

View File

@@ -32,6 +32,16 @@ struct pager {
unsigned long stack_address;
unsigned long memsize;
struct cap_list cap_list;
/*
* Section markings,
* We dont care for other types of sections,
* RO will be included inside RX.
*/
unsigned long rw_sections_start;
unsigned long rw_sections_end;
unsigned long rx_sections_start;
unsigned long rx_sections_end;
};
@@ -72,6 +82,16 @@ struct pager_info {
unsigned long start_address;
unsigned long stack_address;
/*
* Section markings,
* We dont care for other types of sections,
* RO will be included inside RX.
*/
unsigned long rw_sections_start;
unsigned long rw_sections_end;
unsigned long rx_sections_start;
unsigned long rx_sections_end;
/* Number of capabilities defined */
int ncaps;

View File

@@ -1,18 +1,20 @@
/*
* Generic irq handling definitions.
*
* Copyright (C) 2007 Bahadir Balban
* Copyright (C) 2010 B Labs Ltd.
*/
#ifndef __GENERIC_IRQ_H__
#define __GENERIC_IRQ_H__
#include <l4/lib/string.h>
#include <l4/lib/wait.h>
#include <l4/lib/printk.h>
#include INC_PLAT(irq.h)
#include INC_ARCH(types.h)
/* Represents none or spurious irq */
#define IRQ_NIL 0xFFFFFFFF
#define IRQ_NIL 0xFFFFFFFF /* -1 */
#define IRQ_SPURIOUS 0xFFFFFFFE /* -2 */
/* Successful irq handling state */
#define IRQ_HANDLED 0
@@ -23,6 +25,7 @@ struct irq_chip_ops {
l4id_t (*read_irq)(void *data);
irq_op_t ack_and_mask;
irq_op_t unmask;
void (*set_cpu)(l4id_t irq, unsigned int cpumask);
};
struct irq_chip {
@@ -47,9 +50,6 @@ struct irq_desc {
/* Notification slot for this irq */
int task_notify_slot;
/* If user will ack this irq */
int user_ack;
/* Waitqueue head for this irq */
struct waitqueue_head wqh_irq;
@@ -72,10 +72,17 @@ static inline void irq_disable(int irq_index)
{
struct irq_desc *this_irq = irq_desc_array + irq_index;
struct irq_chip *this_chip = this_irq->chip;
this_chip->ops.ack_and_mask(irq_index - this_chip->start);
}
static inline void irq_set_cpu(int irq_index, unsigned int cpumask)
{
struct irq_desc *this_irq = irq_desc_array + irq_index;
struct irq_chip *this_chip = this_irq->chip;
this_chip->ops.set_cpu(irq_index - this_chip->start, cpumask);
}
int irq_register(struct ktcb *task, int notify_slot, l4id_t irq_index);
int irq_thread_notify(struct irq_desc *desc);

View File

@@ -42,7 +42,7 @@ static inline struct ktcb *current_task(void)
#define current current_task()
#define need_resched (current->ts_need_resched)
#define SCHED_RQ_TOTAL 2
#define SCHED_RQ_TOTAL 4
/* A basic runqueue */
struct runqueue {
@@ -52,11 +52,28 @@ struct runqueue {
unsigned int total; /* Total tasks */
};
/*
* Hints and flags to scheduler
*/
enum sched_flags {
/* Schedule idle at a convenient time */
SCHED_RUN_IDLE = (1 << 0),
};
/* Contains per-container scheduling structures */
struct scheduler {
unsigned int flags;
unsigned int task_select_ctr;
struct runqueue sched_rq[SCHED_RQ_TOTAL];
/* Regular runqueues */
struct runqueue *rq_runnable;
struct runqueue *rq_expired;
/* Real-time runqueues */
struct runqueue *rq_rt_runnable;
struct runqueue *rq_rt_expired;
struct ktcb *idle_task;
/* Total priority of all tasks in container */

View File

@@ -20,4 +20,31 @@
#define smp_get_cpuid() 0
#endif
/* All cpus in the SMP system */
static inline unsigned int cpu_mask_all(void)
{
unsigned int mask = 0;
for (int i = 0; i < CONFIG_NCPU; i++)
mask |= (1 << i);
return mask;
}
/* All but not self */
static inline unsigned int cpu_mask_others(void)
{
unsigned int mask = 0;
for (int i = 0; i < CONFIG_NCPU; i++)
if (i != smp_get_cpuid())
mask |= (1 << i);
return mask;
}
/* Only self */
static inline unsigned int cpu_mask_self(void)
{
return 1 << smp_get_cpuid();
}
#endif /* __GENERIC_SMP_H__ */

View File

@@ -29,6 +29,7 @@
#define TASK_SUSPENDING (1 << 1)
#define TASK_RESUMING (1 << 2)
#define TASK_PENDING_SIGNAL (TASK_SUSPENDING)
#define TASK_REALTIME (1 << 5)
/*
* This is to indicate a task (either current or one of
@@ -109,7 +110,6 @@ struct ktcb {
enum task_state state;
struct link task_list; /* Global task list. */
struct ktcb_list child_exit_list;
/* UTCB related, see utcb.txt in docs */
unsigned long utcb_address; /* Virtual ref to task's utcb area */

View File

@@ -16,5 +16,6 @@ struct timeval {
extern volatile u32 jiffies;
int do_timer_irq(void);
int secondary_timer_irq(void);
#endif /* __GENERIC_TIME_H__ */