GithubHelp home page GithubHelp logo

apic-rs's Introduction

apic-rs

APIC (Advanced Programmable Interrupt Controller) for x86 kernel.

CI

apic-rs's People

Contributors

heheda12345 avatar hiroki-chen avatar rzswh avatar wangrunji0408 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

apic-rs's Issues

The implementation for IPI on X2Apic available platforms seems to be wrong

Thank you for making this crate that makes OS development easier!

However, I recently used this crate to implement IPI on X2Apic available platforms and noticed that lib.rs gives a default implementation of the LocalApic trait:

/// Send an IPI to a remote CPU
    fn send_ipi(&mut self, apic_id: u8, int_id: u8) {
        self.set_icr((apic_id as u64) << 56 | int_id as u64);
    }

Although it works for XApic, the mechanism for X2Apic differs, but the authors do not provide an implementation for that, which should be

    fn send_ipi(&mut self, apic_id: u8, int_id: u8) {
        // should be 32 instead of 56 :)
        self.set_icr((apic_id as u64) << 32 | int_id as u64 | 1 << 14);
    }

FYI, Intel's manual says, "The lower 32 bits of ICR in x2APIC mode are identical to the lower half of the ICR in xAPIC mode, except bit 12 (Delivery Status) is not used since it is not needed in X2APIC mode. The destination ID field is expanded to 32 bits in x2APIC mode."

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.