Commit 55a0190d authored by Scotty Bauer's avatar Scotty Bauer

Mwait numbers

Signed-off-by: Scotty Bauer's avatarScotty Bauer <sbauer@eng.utah.edu>
parent 01b7a15d
...@@ -3,8 +3,8 @@ obj-m := test.o ...@@ -3,8 +3,8 @@ obj-m := test.o
#CFLAGS_betaModule2.o = -DDEBUG -DDEBUG_MWAIT_RETRY -DTIMING -g -Wall #CFLAGS_betaModule2.o = -DDEBUG -DDEBUG_MWAIT_RETRY -DTIMING -g -Wall
#CFLAGS_ring-channel.o = -DDEBUG -DDEBUG_MWAIT_RETRY -DTIMING -g -Wall #CFLAGS_ring-channel.o = -DDEBUG -DDEBUG_MWAIT_RETRY -DTIMING -g -Wall
CFLAGS_test.o = -O2 -DPOLL -DUSE_FLOOD #-DDEBUG_MWAIT_RETRY #-DDEBUG CFLAGS_test.o = -O2 -DUSE_MWAIT -DUSE_FLOOD #-DDEBUG_MWAIT_RETRY #-DDEBUG
CFLAGS_betaModule2.o = -O2 -DPOLL -DUSE_FLOOD #-DDEBUG_MWAIT_RETRY #-DDEBUG CFLAGS_betaModule2.o = -O2 -DUSE_MWAIT -DUSE_FLOOD #-DDEBUG_MWAIT_RETRY #-DDEBUG
CFLAGS_ring-channel.o = -O2 CFLAGS_ring-channel.o = -O2
......
...@@ -177,6 +177,7 @@ static int wait_for_consumer_slot(struct ipc_message *imsg, unsigned int token) ...@@ -177,6 +177,7 @@ static int wait_for_consumer_slot(struct ipc_message *imsg, unsigned int token)
while (likely(check_cons_slot_available(imsg, token))) { while (likely(check_cons_slot_available(imsg, token))) {
#if defined(USE_MWAIT) #if defined(USE_MWAIT)
cpu_relax();
monitor_mwait(ecx, &imsg->monitor, cstate_wait); monitor_mwait(ecx, &imsg->monitor, cstate_wait);
#endif//usemwait #endif//usemwait
#if defined(POLL) #if defined(POLL)
......
...@@ -174,6 +174,7 @@ static int wait_for_producer_slot(struct ipc_message *imsg, unsigned int token) ...@@ -174,6 +174,7 @@ static int wait_for_producer_slot(struct ipc_message *imsg, unsigned int token)
while (check_prod_slot_available(imsg, token)) { while (check_prod_slot_available(imsg, token)) {
#if defined(USE_MWAIT) #if defined(USE_MWAIT)
cpu_relax();
monitor_mwait(ecx, &imsg->monitor, cstate_wait); monitor_mwait(ecx, &imsg->monitor, cstate_wait);
#endif//usemwait #endif//usemwait
#if defined(POLL) #if defined(POLL)
......
...@@ -2,13 +2,13 @@ ...@@ -2,13 +2,13 @@
int CHAN_NUM_PAGES = 16; int CHAN_NUM_PAGES = 16;
int BUF_SIZE = 124; int BUF_SIZE = 60;
int NUM_LOOPS = 10000; int NUM_LOOPS = 10000;
int FLOOD_SIZE = 1; int FLOOD_SIZE = 1;
#if defined(USE_MWAIT) #if defined(USE_MWAIT)
unsigned long ecx = 1; /*break of interrupt flag */ unsigned long ecx = 1; /*break of interrupt flag */
unsigned long cstate_wait = 0x0; /* 4 states, 0x0, 0x1 0x10 0x20 */ unsigned long cstate_wait = 0x20; /* 4 states, 0x0, 0x1 0x10 0x20 */
#endif #endif
...@@ -21,7 +21,7 @@ struct ipc_container{ ...@@ -21,7 +21,7 @@ struct ipc_container{
/*Don't let gcc do anything cute, we need this to be 128 bytes */ /*Don't let gcc do anything cute, we need this to be 128 bytes */
struct ipc_message{ struct ipc_message{
char message[124]; char message[60];
volatile uint32_t monitor; volatile uint32_t monitor;
}__attribute__((packed)); }__attribute__((packed));
......
#!/bin/bash #!/bin/bash
echo "UNLOADING DRIVERS" echo "UNLOADING DRIVERS"
rmmod betaModule rmmod betaModule1
rmmod betaModule2 rmmod test
cd /home/scotty/research/xcap/norepo/kernel; cd /users/sbauer/ipc/xcap/xcap/kernel
make clean; make clean;
make | grep "error" make | grep "error"
...@@ -13,7 +13,7 @@ if [ $? == 0 ]; then ...@@ -13,7 +13,7 @@ if [ $? == 0 ]; then
exit exit
fi fi
insmod betaModule.ko; insmod betaModule1.ko;
cd 2 cd 2
make clean make clean
...@@ -25,7 +25,9 @@ if [ $? == 0 ]; then ...@@ -25,7 +25,9 @@ if [ $? == 0 ]; then
exit exit
fi fi
insmod betaModule2.ko insmod test.ko
cd ../
ls /dev/ --color | grep beta ls /dev/ --color | grep beta
../userland/uland 1
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment