diff options
author | Mole Shang <[email protected]> | 2024-02-17 11:55:33 +0800 |
---|---|---|
committer | Mole Shang <[email protected]> | 2024-02-17 12:22:07 +0800 |
commit | e8e0a7b4c97064eb5e9415726d7e38aaceccd3fd (patch) | |
tree | fb42ba5be7a8ae608b968266f62fd71fa889a89d /kernel/plic.c | |
parent | a6af72924b115c1177d18d9b1eaba56623e4248b (diff) | |
parent | d85aec2689c4250d0384904bdc11aa618c726bec (diff) | |
download | xv6-labs-e8e0a7b4c97064eb5e9415726d7e38aaceccd3fd.tar.gz xv6-labs-e8e0a7b4c97064eb5e9415726d7e38aaceccd3fd.tar.bz2 xv6-labs-e8e0a7b4c97064eb5e9415726d7e38aaceccd3fd.zip |
Merge branch 'thread' into fs
Conflicts:
.gitignore
Makefile
conf/lab.mk
kernel/param.h
Diffstat (limited to 'kernel/plic.c')
-rw-r--r-- | kernel/plic.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/kernel/plic.c b/kernel/plic.c index 4175db9..5c9d96a 100644 --- a/kernel/plic.c +++ b/kernel/plic.c @@ -14,6 +14,13 @@ plicinit(void) // set desired IRQ priorities non-zero (otherwise disabled). *(uint32*)(PLIC + UART0_IRQ*4) = 1; *(uint32*)(PLIC + VIRTIO0_IRQ*4) = 1; + +#ifdef LAB_NET + // PCIE IRQs are 32 to 35 + for(int irq = 1; irq < 0x35; irq++){ + *(uint32*)(PLIC + irq*4) = 1; + } +#endif } void @@ -25,6 +32,11 @@ plicinithart(void) // for the uart and virtio disk. *(uint32*)PLIC_SENABLE(hart) = (1 << UART0_IRQ) | (1 << VIRTIO0_IRQ); +#ifdef LAB_NET + // hack to get at next 32 IRQs for e1000 + *(uint32*)(PLIC_SENABLE(hart)+4) = 0xffffffff; +#endif + // set this hart's S-mode priority threshold to 0. *(uint32*)PLIC_SPRIORITY(hart) = 0; } |