vodozhaba / vv4os

VV4OS is an open-source non-commercial operating system. The target is an OS with the full abstraction of the internals of the computer, such as files and programs, from the user. The OS has been inspired by macOS.
MIT License
1 stars 0 forks source link

Incorrect operand sizes in PortWrite32() #8

Closed vodozhaba closed 7 years ago

vodozhaba commented 7 years ago

%w means 'word'.

    static inline void PortWrite32(uint16_t port, uint32_t value) {
        __asm volatile("outl %w0, %w1" : : "a" (value), "d" (port));
    }

    static inline uint32_t PortRead32(uint16_t port) {
        uint32_t ret;
        __asm volatile("inl %w1, %w0" : "=a" (ret) : "d" (port));
        return ret;
    }