summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlaforge <laforge@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2006-09-27 17:21:18 +0000
committerlaforge <laforge@6dc7ffe9-61d6-0310-9af1-9938baff3ed1>2006-09-27 17:21:18 +0000
commit2db7d2d9d9d5825fd200ebe29962cf42dd998015 (patch)
tree7aa035a749b266c7dfe346ccfd169ab2854d783b
parentcaa13ece6ef3f318fdc64bb7ff93413dfe54d889 (diff)
- increase number of large (2k) contextx to 8
- move req_ctx_find_get into ram, since this is frequently used within interrupt handlers and thus ought to be as fast as possible - correctly initialize req_ctx size (bugfix!) git-svn-id: https://svn.openpcd.org:2342/trunk@232 6dc7ffe9-61d6-0310-9af1-9938baff3ed1
-rw-r--r--firmware/src/os/req_ctx.c6
-rw-r--r--firmware/src/os/req_ctx.h3
2 files changed, 5 insertions, 4 deletions
diff --git a/firmware/src/os/req_ctx.c b/firmware/src/os/req_ctx.c
index 214cad5..4902488 100644
--- a/firmware/src/os/req_ctx.c
+++ b/firmware/src/os/req_ctx.c
@@ -29,7 +29,7 @@
/* FIXME: locking, FIFO order processing */
#define NUM_RCTX_SMALL 8
-#define NUM_RCTX_LARGE 3
+#define NUM_RCTX_LARGE 8
#define NUM_REQ_CTX (NUM_RCTX_SMALL+NUM_RCTX_LARGE)
@@ -38,7 +38,7 @@ static u_int8_t rctx_data_large[NUM_RCTX_LARGE][RCTX_SIZE_LARGE];
static struct req_ctx req_ctx[NUM_REQ_CTX];
-struct req_ctx *req_ctx_find_get(int large,
+struct req_ctx __ramfunc *req_ctx_find_get(int large,
unsigned long old_state,
unsigned long new_state)
{
@@ -93,7 +93,7 @@ void req_ctx_init(void)
}
for (i = 0; i < NUM_RCTX_LARGE; i++) {
- req_ctx[i].size = RCTX_SIZE_LARGE;
+ req_ctx[NUM_RCTX_SMALL+i].size = RCTX_SIZE_LARGE;
req_ctx[NUM_RCTX_SMALL+i].data = rctx_data_large[i];
}
}
diff --git a/firmware/src/os/req_ctx.h b/firmware/src/os/req_ctx.h
index 535267b..505e841 100644
--- a/firmware/src/os/req_ctx.h
+++ b/firmware/src/os/req_ctx.h
@@ -11,6 +11,7 @@
#define req_buf_hdr(x) (x->data[0])
#include <sys/types.h>
+#include <lib_AT91SAM7.h>
struct req_ctx {
volatile u_int32_t state;
@@ -37,7 +38,7 @@ struct req_ctx {
#define RCTX_STATE_INVALID 0xff
-extern struct req_ctx *req_ctx_find_get(int large, unsigned long old_state, unsigned long new_state);
+extern struct req_ctx __ramfunc *req_ctx_find_get(int large, unsigned long old_state, unsigned long new_state);
extern struct req_ctx *req_ctx_find_busy(void);
extern void req_ctx_set_state(struct req_ctx *ctx, unsigned long new_state);
extern void req_ctx_put(struct req_ctx *ctx);
personal git repositories of Harald Welte. Your mileage may vary