Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ioapic #1

Merged
merged 6 commits into from
Apr 21, 2018
Merged

Ioapic #1

merged 6 commits into from
Apr 21, 2018

Conversation

yzcode
Copy link

@yzcode yzcode commented Apr 21, 2018

Summary of this Pull Request (PR)

  1. Since xAPIC only support 8 bits logical destination bitmap, we will configure the the logical lapic ID of each cores to it's cpuid when cpuid is smaller then 8, to 0 when cpuid is larger or equal to 8.

  2. a core will be added to an irq's bitmap when we try to enable the irq on that core. and we will remove the core from an irq's bitmap when we try to disable the irq on that core. The irq will be masked if we remove all cores from its bitmap. IMPORTANT: the chal_irq_XXX is not thread-safe which means we should not try to disable or enable the same irq on different core concurrently.

  3. change hw_asnd_caps to 2d array.

Intent for your PR

Choose one (Mandatory):

  • This PR is for a code-review and is intended to get feedback, but not to be pulled yet.
  • This PR is mature, and ready to be integrated into the repo.

Reviewers (Mandatory):

@phanikishoreg

Code Quality

As part of this pull request, I've considered the following:

Style:

  • Comments adhere to the Style Guide (SG)
  • Spacing adhere's to the SG
  • Naming adhere's to the SG
  • All other aspects of the SG are adhered to, or exceptions are justified in this pull request
  • I have run the auto formatter on my code before submitting this PR (see doc/auto_formatter.md for instructions)

Code Craftsmanship:

  • I've made an attempt to remove all redundant code
  • I've considered ways in which my changes might impact existing code, and cleaned it up
  • I've formatted the code in an effort to make it easier to read (proper error handling, function use, etc...)
  • I've commented appropriately where code is tricky
  • I agree that there is no "throw-away" code, and that code in this PR is of high quality

Testing

I've tested the code using the following test programs (provide list here):

void ioapic_int_mask(int irq);
void ioapic_int_unmask(int irq);
// void ioapic_int_mask(int irq);
// void ioapic_int_unmask(int irq);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should remove this. And make the functions in ioapic.c "static inline".

@@ -163,6 +163,7 @@ kmain(struct multiboot *mboot, u32_t mboot_magic, u32_t esp)
kern_boot_comp(INIT_CORE);
lapic_init();
hpet_init();
chal_irq_enable(HW_SERIAL, 0);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should really be a function in serial.c. Like "serial_late_init()" or "serial_irq_init()" something like that.

* So we will configure the logical id of cores with id larger than 7
* to 0 which means we should find out a way(x2APIC) to fix this when we
* have more than 8 cores in ioapic.
*/
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See if you can create a ISSUE on mainline.

@phanikishoreg
Copy link
Owner

Thanks, I'll pull this. Just got a couple of minor comments, you can fix them when you get to it, no rush!
Great job on this!!

I'm so happy the original IOAPIC logic didn't have bugs!! :)

@phanikishoreg phanikishoreg merged commit 73b339a into phanikishoreg:ioapic Apr 21, 2018
phanikishoreg pushed a commit that referenced this pull request May 13, 2018
Implement read only filesystem and tar parsing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants