[Linux-hls-cvs] hls/simul Makefile,1.10,1.11 hls_timers.c,1.5,1.6 misc.c,1.3,1.4 sim.c,1.8,1.9 sim_c
Status: Pre-Alpha
Brought to you by:
lucabe
Update of /cvsroot/linux-hls/hls/simul
In directory sc8-pr-cvs1:/tmp/cvs-serv25577/simul
Modified Files:
Makefile hls_timers.c misc.c sim.c sim_cpu.c sim_events.c
sim_list.c sim_os.c workload.c
Removed Files:
lists.c
Log Message:
Updated the license
Index: Makefile
===================================================================
RCS file: /cvsroot/linux-hls/hls/simul/Makefile,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** Makefile 10 Feb 2003 16:23:45 -0000 1.10
--- Makefile 25 Feb 2003 09:18:55 -0000 1.11
***************
*** 19,23 ****
hls_utils.o hls_sched_rr.o hls_debug.o \
hls_timers.o \
! sim_os.o sim.o sim_events.o sim_cpu.o misc.o lists.o sim_list.o \
workload.o
# \
--- 19,23 ----
hls_utils.o hls_sched_rr.o hls_debug.o \
hls_timers.o \
! sim_os.o sim.o sim_events.o sim_cpu.o misc.o sim_list.o \
workload.o
# \
Index: hls_timers.c
===================================================================
RCS file: /cvsroot/linux-hls/hls/simul/hls_timers.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** hls_timers.c 9 Sep 2002 07:41:46 -0000 1.5
--- hls_timers.c 25 Feb 2003 09:18:56 -0000 1.6
***************
*** 1,5 ****
#include <hls_common.h> /* For struct HLS_SCHED_INSTANCE */
- /* #include "sim.h"*/
#include "heap.h"
#include "event.h"
--- 1,14 ----
+ /*
+ * Copyright (c) 2002 Luca Abeni
+ *
+ * Module Name: hls_timers.c
+ * Abstract: Simulator-dependent part of the timers mechanism.
+ * Author: Luca Abeni 2-Feb-2002
+ *
+ * This is free software; see GPL.txt
+ */
+
#include <hls_common.h> /* For struct HLS_SCHED_INSTANCE */
#include "heap.h"
#include "event.h"
Index: misc.c
===================================================================
RCS file: /cvsroot/linux-hls/hls/simul/misc.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** misc.c 25 Nov 2002 11:33:32 -0000 1.3
--- misc.c 25 Feb 2003 09:18:56 -0000 1.4
***************
*** 1,2 ****
--- 1,13 ----
+ /*
+ * Copyright (c) 2002 Luca Abeni
+ *
+ * Module Name: misc.c
+ * Abstract: Miscellaneous functions, needed to compile the simulator.
+ * This will be eventually removed.
+ * Author: Luca Abeni 2-Feb-2002
+ *
+ * This is free software; see GPL.txt
+ */
+
unsigned char KiFindLeftNibbleBitTable[] = {0, 0, 1, 1, 2, 2, 2, 2,
3, 3, 3, 3, 3, 3, 3, 3};
Index: sim.c
===================================================================
RCS file: /cvsroot/linux-hls/hls/simul/sim.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** sim.c 10 Feb 2003 16:23:45 -0000 1.8
--- sim.c 25 Feb 2003 09:18:57 -0000 1.9
***************
*** 1,2 ****
--- 1,12 ----
+ /*
+ * Copyright (c) 2002 Luca Abeni
+ *
+ * Module Name: sim.c
+ * Abstract: Core of the simulator backend.
+ * Author: Luca Abeni 2-Feb-2002
+ *
+ * This is free software; see GPL.txt
+ */
+
#include <stdio.h>
#include <stdlib.h>
Index: sim_cpu.c
===================================================================
RCS file: /cvsroot/linux-hls/hls/simul/sim_cpu.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** sim_cpu.c 10 Feb 2003 16:23:45 -0000 1.10
--- sim_cpu.c 25 Feb 2003 09:18:57 -0000 1.11
***************
*** 1,2 ****
--- 1,12 ----
+ /*
+ * Copyright (c) 2002 Luca Abeni & John Regehr
+ *
+ * Module Name: sim_cpu.c
+ * Abstract: Simulator backend: CPU management.
+ * Author: Luca Abeni 2002, John Regehr 2000
+ *
+ * This is free software; see GPL.txt
+ */
+
#include <stdio.h>
Index: sim_events.c
===================================================================
RCS file: /cvsroot/linux-hls/hls/simul/sim_events.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** sim_events.c 10 Feb 2003 16:23:45 -0000 1.12
--- sim_events.c 25 Feb 2003 09:18:57 -0000 1.13
***************
*** 1,2 ****
--- 1,12 ----
+ /*
+ * Copyright (c) 2002 Luca Abeni & John Regehr
+ *
+ * Module Name: sim_cpu.c
+ * Abstract: Simulator backend: Event Handling.
+ * Author: Luca Abeni 2002, John Regehr 2000
+ *
+ * This is free software; see GPL.txt
+ */
+
#include <stdio.h>
#include <stdlib.h>
Index: sim_list.c
===================================================================
RCS file: /cvsroot/linux-hls/hls/simul/sim_list.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** sim_list.c 3 Oct 2002 09:19:54 -0000 1.1
--- sim_list.c 25 Feb 2003 09:18:57 -0000 1.2
***************
*** 1,9 ****
! #include <stdlib.h>
! #include <stdio.h>
! struct list_head {
! struct list_head *prev;
! struct list_head *next;
! };
struct eventq_elt {
--- 1,16 ----
! /*
! * Copyright (c) 2002 Luca Abeni
! *
! * Module Name: lists.c
! * Abstract: List management functions.
! * Author: Luca Abeni 2-Feb-2002
! *
! * Part of this file is based on the Linux include/linux/lists.h.
! *
! * This is free software; see GPL.txt
! */
! #include <interface-data.h>
! #include <funcs.h>
struct eventq_elt {
***************
*** 15,92 ****
unsigned long long int time;
void *ptr;
! struct list_head list;
};
! static struct list_head event_list;
!
#define INIT_LIST_HEAD(ptr) do { \
! (ptr)->next = (ptr); (ptr)->prev = (ptr); \
} while (0)
! /*
! * Insert a new entry between two known consecutive entries.
! *
! * This is only for internal list manipulation where we know
! * the prev/next entries already!
! */
! static __inline__ void __list_add(struct list_head * new,
! struct list_head * prev,
! struct list_head * next)
! {
! next->prev = new;
! new->next = next;
! new->prev = prev;
! prev->next = new;
! }
!
! /**
! * list_add - add a new entry
! * @new: new entry to be added
! * @head: list head to add it after
! *
! * Insert a new entry after the specified head.
! * This is good for implementing stacks.
! */
! static __inline__ void list_add(struct list_head *new, struct list_head *head)
! {
! __list_add(new, head, head->next);
! }
!
! /**
! * list_add_tail - add a new entry
! * @new: new entry to be added
! * @head: list head to add it before
! *
! * Insert a new entry before the specified head.
! * This is useful for implementing queues.
! */
! static __inline__ void list_add_tail(struct list_head *new, struct list_head *head)
! {
! __list_add(new, head->prev, head);
! }
!
! /*
! * Delete a list entry by making the prev/next entries
! * point to each other.
! *
! * This is only for internal list manipulation where we know
! * the prev/next entries already!
! */
! static __inline__ void __list_del(struct list_head * prev,
! struct list_head * next)
! {
! next->prev = prev;
! prev->next = next;
! }
!
! /**
! * list_del - deletes entry from list.
! * @entry: the element to delete from the list.
! * Note: list_empty on entry does not return true after this, the entry is in an undefined state.
! */
! static __inline__ void list_del(struct list_head *entry)
{
! __list_del(entry->prev, entry->next);
}
--- 22,37 ----
unsigned long long int time;
void *ptr;
! struct sim_list_head list;
};
! static struct sim_list_head event_list;
#define INIT_LIST_HEAD(ptr) do { \
! (ptr)->flink = (ptr); (ptr)->blink = (ptr); \
} while (0)
! void event_list_init(void)
{
! INIT_LIST_HEAD(&event_list);
}
***************
*** 97,102 ****
*/
#define list_for_each(pos, head) \
! for (pos = (head)->next; pos != (head); \
! pos = pos->next)
/**
--- 42,47 ----
*/
#define list_for_each(pos, head) \
! for (pos = (head)->flink; pos != (head); \
! pos = pos->flink)
/**
***************
*** 110,117 ****
!
! void event_list_init(void)
{
! INIT_LIST_HEAD(&event_list);
}
--- 55,103 ----
! void list_del(struct sim_list_head *entry)
{
! struct sim_list_head *prev, *next;
!
! prev = entry->blink;
! next = entry->flink;
! prev->flink = next;
! next->blink = prev;
! }
!
!
! void event_list_getfirst(struct eventq_elt *min)
! {
! struct eventq_elt tmp;
! struct list_elem *p;
!
! p = list_entry(event_list.flink, struct list_elem, list);
! list_del(event_list.flink);
! tmp.ptr = p->ptr;
! tmp.key = p->time;
! memcpy(min, &tmp, sizeof(struct eventq_elt));
! free(p);
! }
!
! void list_add_tail(struct sim_list_head *new, struct sim_list_head *head)
! {
! struct sim_list_head *prev;
!
! prev = head->blink;
! head->blink = new;
! new->flink = head;
! new->blink = prev;
! prev->flink = new;
! }
!
! void list_add(struct sim_list_head *new, struct sim_list_head *head)
! {
! struct sim_list_head *next;
!
! next = head->flink;
!
! head->flink = new;
! new->blink = head;
! new->flink = next;
! next->blink = new;
}
***************
*** 120,124 ****
{
struct list_elem *e;
! struct list_head *p;
int done;
--- 106,110 ----
{
struct list_elem *e;
! struct sim_list_head *p;
int done;
***************
*** 127,136 ****
e->time = t;
! if (event_list.next == &event_list) {
list_add(&e->list, &event_list);
return 1;
} else {
! p = event_list.next;
done = 0;
while (!done) {
--- 113,122 ----
e->time = t;
! if (event_list.flink == &event_list) {
list_add(&e->list, &event_list);
return 1;
} else {
! p = event_list.flink;
done = 0;
while (!done) {
***************
*** 141,145 ****
done = 1;
} else {
! p = p->next;
}
}
--- 127,131 ----
done = 1;
} else {
! p = p->flink;
}
}
***************
*** 148,152 ****
}
! if (p == event_list.next) {
return 1;
}
--- 134,138 ----
}
! if (p == event_list.flink) {
return 1;
}
***************
*** 155,174 ****
}
- void event_list_getfirst(struct eventq_elt *min)
- {
- struct eventq_elt tmp;
- struct list_elem *p;
-
- p = list_entry(event_list.next, struct list_elem, list);
- list_del(event_list.next);
- tmp.ptr = p->ptr;
- tmp.key = p->time;
- memcpy(min, &tmp, sizeof(struct eventq_elt));
- free(p);
- }
void event_list_remove(void *ptr)
{
! struct list_head *h, *h1;
struct list_elem *p, *p1;
--- 141,148 ----
}
void event_list_remove(void *ptr)
{
! struct sim_list_head *h, *h1;
struct list_elem *p, *p1;
***************
*** 190,192 ****
--- 164,171 ----
exit(-1);
}
+ }
+
+ int list_empty(struct sim_list_head *head)
+ {
+ return head->flink == head;
}
Index: sim_os.c
===================================================================
RCS file: /cvsroot/linux-hls/hls/simul/sim_os.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** sim_os.c 10 Feb 2003 16:23:46 -0000 1.7
--- sim_os.c 25 Feb 2003 09:18:57 -0000 1.8
***************
*** 1,2 ****
--- 1,13 ----
+ /*
+ * Copyright (c) 2002 Luca Abeni & John Regehr
+ *
+ * Module Name: sim_os.c
+ * Abstract: Simulator backend: Scheduler simulation code and thread
+ * management.
+ * Author: Luca Abeni 2002, John Regehr 2000
+ *
+ * This is free software; see GPL.txt
+ */
+
#include <stdio.h>
#include <stdlib.h>
Index: workload.c
===================================================================
RCS file: /cvsroot/linux-hls/hls/simul/workload.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** workload.c 10 Feb 2003 16:23:47 -0000 1.2
--- workload.c 25 Feb 2003 09:18:57 -0000 1.3
***************
*** 1,2 ****
--- 1,15 ----
+ /*
+ * Copyright (c) 2002 Luca Abeni
+ *
+ * Module Name: loads/periodic.c
+ * Abstract: Workload generator for the Simulator Backend.
+ * Task set composed of ``periodic tasks'', that
+ * execute for a fixed time C and then block until the
+ * beginning of the next period.
+ * Author: Luca Abeni 2-Feb-2002
+ *
+ * This is free software; see GPL.txt
+ */
+
#include <stdio.h>
#include <stdlib.h>
--- lists.c DELETED ---
|