Support static_cast on FixedWidthPointer.
This commit is contained in:
parent
f124497815
commit
3a2a3367dc
@ -22,17 +22,28 @@ class FixedWidthPointer {
|
||||
public:
|
||||
operator Type*() const
|
||||
{
|
||||
return (Type *)(addr_t)fValue;
|
||||
return (Type*)(addr_t)fValue;
|
||||
}
|
||||
|
||||
template<typename OtherType>
|
||||
operator OtherType*() const
|
||||
{
|
||||
return static_cast<OtherType*>((Type*)(addr_t)fValue);
|
||||
}
|
||||
|
||||
Type& operator*() const
|
||||
{
|
||||
return *(Type *)*this;
|
||||
return *((Type*)(addr_t)fValue);
|
||||
}
|
||||
|
||||
Type* operator->() const
|
||||
{
|
||||
return *this;
|
||||
return (Type*)(addr_t)fValue;
|
||||
}
|
||||
|
||||
Type& operator[](size_t i) const
|
||||
{
|
||||
return ((Type*)(addr_t)fValue)[i];
|
||||
}
|
||||
|
||||
FixedWidthPointer& operator=(const FixedWidthPointer& p)
|
||||
|
@ -75,7 +75,7 @@ platform_start_kernel(void)
|
||||
= gKernelArgs.cpu_kstack[0].start + gKernelArgs.cpu_kstack[0].size;
|
||||
|
||||
preloaded_elf32_image *image = static_cast<preloaded_elf32_image *>(
|
||||
(void *)gKernelArgs.kernel_image);
|
||||
gKernelArgs.kernel_image);
|
||||
|
||||
//smp_init_other_cpus();
|
||||
//serial_cleanup();
|
||||
|
@ -75,7 +75,7 @@ platform_start_kernel(void)
|
||||
= gKernelArgs.cpu_kstack[0].start + gKernelArgs.cpu_kstack[0].size;
|
||||
|
||||
preloaded_elf32_image *image = static_cast<preloaded_elf32_image *>(
|
||||
(void *)gKernelArgs.kernel_image);
|
||||
gKernelArgs.kernel_image);
|
||||
|
||||
//smp_init_other_cpus();
|
||||
//serial_cleanup();
|
||||
|
@ -357,7 +357,7 @@ smp_cpu_ready(void)
|
||||
//TRACE(("smp_cpu_ready: entry cpu %ld\n", curr_cpu));
|
||||
|
||||
preloaded_elf32_image *image = static_cast<preloaded_elf32_image *>(
|
||||
(void *)gKernelArgs.kernel_image);
|
||||
gKernelArgs.kernel_image);
|
||||
|
||||
// Important. Make sure supervisor threads can fault on read only pages...
|
||||
asm("movl %%eax, %%cr0" : : "a" ((1 << 31) | (1 << 16) | (1 << 5) | 1));
|
||||
|
@ -83,7 +83,7 @@ platform_start_kernel(void)
|
||||
= gKernelArgs.cpu_kstack[0].start + gKernelArgs.cpu_kstack[0].size;
|
||||
|
||||
preloaded_elf32_image *image = static_cast<preloaded_elf32_image *>(
|
||||
(void *)gKernelArgs.kernel_image);
|
||||
gKernelArgs.kernel_image);
|
||||
|
||||
smp_init_other_cpus();
|
||||
debug_cleanup();
|
||||
|
@ -61,7 +61,7 @@ extern "C" void
|
||||
platform_start_kernel(void)
|
||||
{
|
||||
preloaded_elf32_image* image = static_cast<preloaded_elf32_image*>(
|
||||
(void*)gKernelArgs.kernel_image);
|
||||
gKernelArgs.kernel_image);
|
||||
|
||||
addr_t kernelEntry = image->elf_header.e_entry;
|
||||
addr_t stackTop = gKernelArgs.cpu_kstack[0].start
|
||||
|
@ -96,7 +96,7 @@ extern "C" void
|
||||
platform_start_kernel(void)
|
||||
{
|
||||
preloaded_elf32_image* image = static_cast<preloaded_elf32_image*>(
|
||||
(void*)gKernelArgs.kernel_image);
|
||||
gKernelArgs.kernel_image);
|
||||
|
||||
addr_t kernelEntry = image->elf_header.e_entry;
|
||||
addr_t stackTop = gKernelArgs.cpu_kstack[0].start
|
||||
|
@ -91,7 +91,7 @@ extern "C" void
|
||||
platform_start_kernel(void)
|
||||
{
|
||||
preloaded_elf32_image *image = static_cast<preloaded_elf32_image *>(
|
||||
(void *)gKernelArgs.kernel_image);
|
||||
gKernelArgs.kernel_image);
|
||||
|
||||
addr_t kernelEntry = image->elf_header.e_entry;
|
||||
addr_t stackTop
|
||||
|
Loading…
Reference in New Issue
Block a user