Skip to content

Commit

Permalink
finish
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouliang-yu committed Dec 5, 2021
1 parent 071ab44 commit 7e21c2c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
10 changes: 3 additions & 7 deletions Assignment_5_120040077/bonus/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ void *dma_buf;
#define DEV_NAME "mydev" // name for alloc_chrdev_region
#define DEV_BASEMINOR 0 // baseminor for alloc_chrdev_region
#define DEV_COUNT 1 // count for alloc_chrdev_region
#define INTERRUPT_DEV_NAME "interrupt"
#define INTERRUPT_DEV_NAME "myinterrupt"
#define IRQ_NUM 1

static int dev_major;
Expand Down Expand Up @@ -347,12 +347,8 @@ int prime(int base, short nth)

static irqreturn_t handler(int irq, void *dev_id)
{
if (irq == IRQ_NUM)
{
interrupt_t += 1;
return IRQ_HANDLED;
}
return IRQ_NONE;
interrupt_t += 1;
return IRQ_HANDLED;
}

static int __init init_modules(void)
Expand Down
10 changes: 5 additions & 5 deletions Assignment_5_120040077/bonus/test.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,12 @@ int main()
return -1;
}

//arithmetic(fd, '+', 100, 10);
//arithmetic(fd, '-', 100, 10);
//arithmetic(fd, '*', 100, 10);
//arithmetic(fd, '/', 100, 10);
arithmetic(fd, '+', 100, 10);
arithmetic(fd, '-', 100, 10);
arithmetic(fd, '*', 100, 10);
arithmetic(fd, '/', 100, 10);
arithmetic(fd, 'p', 100, 10000);
//arithmetic(fd, 'p', 100, 20000);
arithmetic(fd, 'p', 100, 20000);


printf("...............End...............\n");
Expand Down

0 comments on commit 7e21c2c

Please sign in to comment.