forked from SerenityOS/serenity
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Kernel: Get rid of Kernel/types.h, separate LinearAddress/PhysicalAdd…
…ress.
- Loading branch information
1 parent
6306cf5
commit a58d7fd
Showing
27 changed files
with
119 additions
and
121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#pragma once | ||
|
||
#include "types.h" | ||
#include <AK/Types.h> | ||
|
||
namespace CMOS { | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#include "types.h" | ||
#include <AK/Types.h> | ||
#include "i386.h" | ||
#include "IO.h" | ||
#include "PIC.h" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#pragma once | ||
|
||
#include "types.h" | ||
#include <AK/Types.h> | ||
|
||
namespace IO { | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#pragma once | ||
|
||
#include <AK/Types.h> | ||
|
||
class LinearAddress { | ||
public: | ||
LinearAddress() { } | ||
explicit LinearAddress(dword address) : m_address(address) { } | ||
|
||
bool is_null() const { return m_address == 0; } | ||
|
||
LinearAddress offset(dword o) const { return LinearAddress(m_address + o); } | ||
dword get() const { return m_address; } | ||
void set(dword address) { m_address = address; } | ||
void mask(dword m) { m_address &= m; } | ||
|
||
bool operator<=(const LinearAddress& other) const { return m_address <= other.m_address; } | ||
bool operator>=(const LinearAddress& other) const { return m_address >= other.m_address; } | ||
bool operator>(const LinearAddress& other) const { return m_address > other.m_address; } | ||
bool operator<(const LinearAddress& other) const { return m_address < other.m_address; } | ||
bool operator==(const LinearAddress& other) const { return m_address == other.m_address; } | ||
bool operator!=(const LinearAddress& other) const { return m_address != other.m_address; } | ||
|
||
byte* as_ptr() { return reinterpret_cast<byte*>(m_address); } | ||
const byte* as_ptr() const { return reinterpret_cast<const byte*>(m_address); } | ||
|
||
dword page_base() const { return m_address & 0xfffff000; } | ||
|
||
private: | ||
dword m_address { 0 }; | ||
}; | ||
|
||
inline LinearAddress operator-(const LinearAddress& a, const LinearAddress& b) | ||
{ | ||
return LinearAddress(a.get() - b.get()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#include "types.h" | ||
#include <AK/Types.h> | ||
#include "i386.h" | ||
#include "IO.h" | ||
#include "PIC.h" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#pragma once | ||
|
||
class PhysicalAddress { | ||
public: | ||
PhysicalAddress() { } | ||
explicit PhysicalAddress(dword address) : m_address(address) { } | ||
|
||
PhysicalAddress offset(dword o) const { return PhysicalAddress(m_address + o); } | ||
dword get() const { return m_address; } | ||
void set(dword address) { m_address = address; } | ||
void mask(dword m) { m_address &= m; } | ||
|
||
bool is_null() const { return m_address == 0; } | ||
|
||
byte* as_ptr() { return reinterpret_cast<byte*>(m_address); } | ||
const byte* as_ptr() const { return reinterpret_cast<const byte*>(m_address); } | ||
|
||
dword page_base() const { return m_address & 0xfffff000; } | ||
|
||
bool operator==(const PhysicalAddress& other) const { return m_address == other.m_address; } | ||
|
||
private: | ||
dword m_address { 0 }; | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#include "types.h" | ||
#include <AK/Types.h> | ||
#include "Process.h" | ||
#include "kmalloc.h" | ||
#include "StdLib.h" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#pragma once | ||
|
||
#include "types.h" | ||
#include <Kernel/UnixTypes.h> | ||
|
||
namespace RTC { | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#pragma once | ||
|
||
#include <Kernel/types.h> | ||
#include <AK/Types.h> | ||
|
||
extern "C" { | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#include "types.h" | ||
#include <AK/Types.h> | ||
#include "kmalloc.h" | ||
#include "i386.h" | ||
#include "Assertions.h" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#include "types.h" | ||
#include <AK/Types.h> | ||
#include "kmalloc.h" | ||
#include "i386.h" | ||
#include "i8253.h" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#pragma once | ||
|
||
#include "types.h" | ||
#include <AK/Types.h> | ||
|
||
struct system_t | ||
{ | ||
|
Oops, something went wrong.