Commit Graph

124 Commits

Author SHA1 Message Date
Axel Dörfler afd6dfc8b4 Implemented first basic APM driver. Only tested with QEMU so far, that's why
it's currently disabled.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16120 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-01-28 18:11:20 +00:00
Axel Dörfler ba61df6d0b Beginnings of APM support: we now connect to the APM BIOS in 32 bit protected mode.
We don't do anything with it yet, though, so the BIOS will probably ignore us since
we are supposed to poll for events.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15900 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-01-10 22:54:36 +00:00
Ingo Weinhold 09bb4e9ac5 The real_time_data structure contains an architecture specific
substructure now (that's the only member actually). The system time
offset is therefore accessed via architecture specific accessor
functions.
Note, that this commit breaks the PPC build. Since I want to rename at
least one file I've already changed, I can't avoid that.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15835 a95241bf-73f2-0310-859d-f6bbb57e9c96
2006-01-04 02:17:59 +00:00
Axel Dörfler 79f73dbc56 * vm_page::offset is now called cache_offset and is now an uint32 instead of off_t;
this saves 4 bytes per page. To compensate the loss of bytes, the offset is now
  stored in page size units, that's enough to address 2^44 or 16 TB (which is now
  the maximal supported file size!).
* Renamed vm_page::ppn to physical_page_number.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15637 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-21 12:38:31 +00:00
Axel Dörfler 35cf51550c Replaced arch/thread_struct.h with arch/thread_types.h, and renamed
arch/*/thread_struct.h to arch_thread_types.h, so that it can directly
be included without having to specify the architecure.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15616 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-20 16:07:27 +00:00
Axel Dörfler 7d7f4675bb * Added some cpuid eax == 1 feature definitions to arch_cpu.h
* Renamed IA32_MTR_WRITE_COMBINED to IA32_MTR_WRITE_COMBINING.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15559 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-16 12:25:49 +00:00
Axel Dörfler e0e9a3e69f * We now support the global page feature of x86 processors that prevents
kernel TLBs from being flushed on context switch.
* new arch_cpu_user_TLB_invalidate() that now does what arch_cpu_global_TLB_invalidate()
  did before.
* arch_cpu_global_TLB_invalidate() will now flush all TLBs, even those from the
  kernel.
* some cleanups.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15535 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-14 17:07:37 +00:00
Axel Dörfler 484c80abd0 * Added missing prototypes for get_eflags() and set_eflags() to arch_system_info.h
* The boot loader now checks the CPU for the cpuid and rdtsc features, which we
  currently both rely on.
* Removed old and no longer used stage2_priv.h header


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15534 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-14 10:43:28 +00:00
Axel Dörfler 51a3c450be The short story: we now have MTRR support on Intel and AMD CPUs (the latter
has not yet been tested, though - I'll do this after this commit):
* Removed the arch_memory_type stuff from vm_area; since there are only 8 memory
  ranges on x86, it's simply overkill. The MTRR code now remembers the area ID
  and finds the MTRR that way (it could also iterate over the existing MTRRs).
* Introduced some post_modules() init functions.
* If the other x86 CPUs out there don't differ a lot, MTRR functionality might
  be put back into the kernel.
* x86_write_msr() was broken, it wrote the 64 bit number with the 32 bit words
  switched - it took me some time (and lots of #GPs) to figure that one out.
* Removed the macro read_ebp() and introduced a function x86_read_ebp()
  (it's not really a time critical call).
* Followed the Intel docs on how to change MTRRs (symmetrically on all CPUs
  with caches turned off).
* Asking for memory types will automatically change the requested length to
  a power of two - note that BeOS seems to behave in the same, although that's
  not really very clean.
* fixed MTRRs are ignored for now - we should make sure at least, though,
  that they are identical on all CPUs (or turn them off, even though I'd
  prefer the BIOS stuff to be uncacheable, which we don't enforce yet, though).



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15528 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-13 16:34:29 +00:00
Axel Dörfler d49423aea3 Added a wbinvd() macro.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15526 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-13 01:49:44 +00:00
Axel Dörfler 2ed21b8525 Some work in progress of the MTRR support. Shouldn't do any harm yet :-)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15525 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-13 00:06:52 +00:00
Axel Dörfler 7c0a93573b Preparation for MTRR support, code is completely untested, though.
The CPU specific MTRR code will be in modules.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15520 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-12-12 17:04:36 +00:00
Axel Dörfler 7b7c38a2a7 The "where" or "sc" command now switches the page directory to the specified thread
to be able to follow the stack trace into userland.
No symbols there, yet, though.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14697 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-11-04 15:58:04 +00:00
Axel Dörfler 90ce9e8305 Added calls to read and write the MSR, the machine state register.
Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14537 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-10-26 23:39:38 +00:00
Axel Dörfler 8fcd6b8e61 * renamed smp_boot.c to smp.cpp
* there is now a "Disable Hyper-Threading" safemode in the boot loader
* the SMP & HT menu items are now added in smp.cpp - and are only added
  if the system supports one of them.
* more cleanup to smp_apic.h
* removed cpuid() from the boot loader's support.S - instead, it will now
  use the one from the kernel.
* added a very weak HT detection: if the MP config only listed one CPU,
  and this CPU supports HT, we enable the other logic processor manually -
  as this currently doesn't work, it's disabled, though.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14536 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-10-26 22:57:13 +00:00
Axel Dörfler fde12d6407 Some cleanup: renamed the mp_ext_* structures to mp_base_* as they are
part of the base table, not the extended table.
Renamed some structure fields, variables to be clearer and nicer to read.
Removed some unused stuff.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14502 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-10-24 21:37:40 +00:00
Axel Dörfler 0c67510ae1 Enabled SMP detection again - since it's very likely that it doesn't work on
your system, I've also added a "Disable SMP" safemode option. The NO_SMP
define is still there, and will be removed once SMP works flawlessly.
Prints out infos about the interrupt entries in the MP config.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14499 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-10-24 19:43:50 +00:00
Axel Dörfler 3d5ecf962c Minor cleanup, no functional change.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14472 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-10-22 16:53:49 +00:00
Ingo Weinhold d08379a80b * Now we deal with all x86 exceptions, i.e. we no longer panic() when a
user application performs a division by zero or causes a general
  protection fault. For some exceptions (e.g. machine check) I wasn't
  quite sure whether they can be caused by user apps at all, so we panic()
  in those cases. Wouldn't harm, if someone more knowledgable would check
  this, though.
* Removed the unused fault handling stuff, respectively moved the little
  that was used into x86/arch_int.c.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13795 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-07-21 23:47:08 +00:00
Axel Dörfler eca3ada99b Removed some unused old headers.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12890 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-05-29 13:29:55 +00:00
Axel Dörfler b20667b35b {install|remove}_io_interrupt_handler() now correctly handle the B_NO_ENABLE_COUNTER flag.
Lots of cleanup:
- moved B_NO_ENABLE_COUNTER flag definition out of int.h to KernelExport.h, as it's
  described in the BeBook (although it's probably not really used that often :))
- int.c no longer has any platform dependent code (+ 0x20 on interrupt numbers is gone);
  it's now entirely handled in the arch/x86/ section.
- the io_vectors[] is now statically initialized, instead of allocated from the heap
- removed {install|remove}_interrupt_handler(); they weren't that useful, arch_smp_init()
  is now calling install_io_interrupt_handler() correctly instead
- introduced a new arch_int.h header file that currently contains NUM_IO_VECTORS only
  (though on x86, it also has ARCH_INTERRUPT_BASE == 0x20).
- changed the return type from {install|remove}_io_interrupt_handler() from "long" to
  "status_t"
- rearranged and cleaned the PIC initialization code, made the PIC code more prominent
- changed comments that talk about a non existing 8239 (the PIC chip is actually 8259)
- moved arch/x86/interrupts.h to the source directory, as it's not used outside
- added BeOS compatible interrupts_enabled() function, that should replace our
  equivalent (and private) are_interrupts_enabled()


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12477 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-04-27 01:08:35 +00:00
Ingo Weinhold 8e26b085e5 Fixed double fault handler. Personally I disclaim all responsiblity
for these changes. I was mostly just staring in amazement at the screen
while Axel and Thomas were discussing IA32 internals. A particularly
fascinating moment was when Thomas produced the cause of a bug we had
been trying to track down for hours off the top of his head (of course
iret behaves specially when the NT bit is set :-). His slowness must be
excused though, since he hadn't slept for more then 30 hours. ;-)

The code doesn't wholeheartedly deal with multi-processor machines yet.
Axel will certainly do some cleanup...


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12239 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-04-04 21:43:47 +00:00
Axel Dörfler e5b0e0b5e3 Changed the set_segment_descriptor()'s usage of the limit/granularity
flag. Now, it will choose how to set the granularity by evaluating the
limit.
This call was actually already used this way in the kernel, so that
the TLS and TSS segments were much too large (harmless but incorrect).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12231 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-04-04 14:34:18 +00:00
Axel Dörfler 9d06770cdc The iframe stack is now in a special structure iframe_stack.
Introduced a gBootFrameStack that is used until the first thread structure
is available - this allows stack crawls and useful register dumps during
early startup. Could also be solved differently by making sure there is
always a thread structure installed in %dr3 (ie. the boot thread would
get a static thread structure instead of a static iframe stack only).
This might be a better solution as i386_handle_trap() would no longer
need to check for an existing thread structure.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12230 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-04-04 14:13:25 +00:00
Axel Dörfler edb5566393 Fixed struct tss; there is no ss3/sp3.
Moved ptentry/pdentry to arch_vm_translation_map.c and renamed them to
page_table_entry and page_directory_entry.
Fixed a race condition that happened when memory was remapped (which
can currently happen because lock_memory() does not work correctly, and
there might be other conditions as well, like certain vm_store fault
handlers). Now, page table and directory entries are updated atomically.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12229 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-04-04 14:07:24 +00:00
Ingo Weinhold 85001a7cc6 * Fixed checking for DR6 bits after a debug exception (we were and'ing
with the bit number, not the respective mask).
* Added a small hack to allow single stepping to work in qemu.
  Apparently the BS bit in DR6 is not set when the debug exception
  is handled. So we always assume that a single step event occurred,
  when we couldn't recognize any other event, if the hack is enabled.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@11998 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-03-25 18:48:51 +00:00
Axel Dörfler 74b043d98d Removed execute property that was set accidently (since CVS days).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@11896 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-03-18 01:50:45 +00:00
Ingo Weinhold 935486a09f Added some more EFLAGS bits.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11533 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-03-02 14:51:48 +00:00
Ingo Weinhold 86cc722477 * DR3 is used for holding the pointer to the current struct thread*, so
we only have 3 debug registers available for break-/watchpoints.
* Added definitions for debug status register DR6. Reordered DR7 defs to
  ascending order. Added definitions for the EFLAGS flags we need.
* Added arch_thread_debug_info structure and related definitions.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11525 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-03-02 00:05:02 +00:00
Ingo Weinhold 98b14f8a6a * Made i386_get_current_iframe() static again, since it wasn't what was
needed to get the topmost user iframe. Added i386_get_user_iframe() for
  exactly that purpose.
* Added reinitialization of user debugging for the new thread when
  switching the context.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11523 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-03-01 23:56:52 +00:00
Ingo Weinhold c8d7534e5d * Made C++ save.
* Made the parameter for restoring the FPU state const.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11522 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-03-01 23:52:09 +00:00
Ingo Weinhold 8ae64a82eb x86 specific user debugging support definitions.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11508 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-02-28 00:44:41 +00:00
Ingo Weinhold 05916979f9 Export i386_get_current_iframe() so it can be used in arch_user_debugger.cpp.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11472 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-02-24 15:49:41 +00:00
Ingo Weinhold 98dbeb36df Added note to keep struct iframe in sync with the struct cpu_state.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11471 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-02-24 15:47:54 +00:00
Ingo Weinhold f19279abda Danger! The size of empty structures differs between C and C++, so we have to put something in, if we want to use them from both.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11314 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-02-10 02:59:37 +00:00
Axel Dörfler c2c20b7848 Incorporated some code from NewOS to set up a double fault handler.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10444 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-12-14 01:46:46 +00:00
Axel Dörfler c44645aa42 vm.h was not used anywhere.
Introduced new arch_vm.h ("public" arch headers have the arch_ prefix).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10384 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-12-10 18:43:26 +00:00
Axel Dörfler b385f97e3e Added our first x86-only syscall for get_cpuid().
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10323 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-12-01 03:54:23 +00:00
Axel Dörfler a3129fbc3b Added cpu_clock_speed field for now - might either be moved to the main
kernel_args; depending on how it'll be done on PPC.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10311 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-11-30 20:57:36 +00:00
Axel Dörfler 86a48e24ad Got inspired by mmu_man's dmidecode release and added a simple identification
of BIOS32, SMBIOS, and DMI services.
Also implemented a get_bios32_service() function which you can use to get
access to that service (ie. for use by the PCI bus manager).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10286 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-11-29 20:42:04 +00:00
Axel Dörfler 6a689590ce Removed unneeded includes of ktypes.h.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10036 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-11-19 19:40:05 +00:00
Axel Dörfler 99daf65959 Added definitions that describe the stack direction.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10007 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-11-18 14:43:28 +00:00
Axel Dörfler afad65ded7 Replaced all remaining PAGE_SIZE with B_PAGE_SIZE, addr with addr_t.
Removed the definition of PAGE_SIZE and addr.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9433 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-20 00:33:06 +00:00
Axel Dörfler a8673f45bf Added prototypes for arch_{store|restore}_fork_frame().
Removed broken arch_thread::current_iframe field.
Introduced new arch_fork_arg structure.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9295 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-12 03:57:31 +00:00
Axel Dörfler 3490a4becc No longer needs the arch_thread.h header.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9293 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-12 03:54:03 +00:00
Axel Dörfler a78a421de8 Renamed sleep() to spin() as that's what it does, and sleep() also doesn't
like unistd.h.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9040 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-09-23 13:43:57 +00:00
Ingo Weinhold b07e2ab15f uint32 -> unsigned int. No need to rely on defined types.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8906 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-09-10 23:12:23 +00:00
Axel Dörfler c2d416e259 Partially covered by arch_config.h and support/ByteOrder.h now/already.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8900 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-09-10 14:18:46 +00:00
Axel Dörfler 1aaaa3689a Moved some arch dependent config information to this new file (from arch_cpu.h).
There is probably more that could be moved in here.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8899 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-09-10 13:08:06 +00:00
Ingo Weinhold 75df143732 Introduced a macro specifying the type function parameters are aligned to. Not nice, but seems to help with the automatic generation of syscall code (at least on x86).
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8783 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-09-01 20:15:19 +00:00
Axel Dörfler 3999c1f3ec Minor cleanup.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7881 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-06-09 18:15:25 +00:00
Axel Dörfler a8061da698 Removed system_time() prototype; it's already defined in OS.h.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7711 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-05-31 23:31:15 +00:00
Axel Dörfler bbd8e7fbd9 Removed unneeded prototype.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6981 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-03-15 00:56:02 +00:00
Axel Dörfler 4a2e872cca Applied NewOS change 1914: moved APIC setup into the kernel due to a
problem with the APIC clock speed test.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6980 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-03-14 22:54:00 +00:00
Axel Dörfler db5620838a Moved the vm_translation_map_get_pgdir() function from arch/vm_translation_map.h
into this file (and replaced the prefix with i386_).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@5065 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-10-17 13:35:12 +00:00
Axel Dörfler b4d2f3a8e7 Renamed arch_stage2.h to arch_kernel_args.h.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4972 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-10-07 23:34:59 +00:00
beveloper 5fe840b9b5 fixed address checking in ppc atomic functions.
fixed compilation on x86.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4361 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-08-21 23:36:06 +00:00
Axel Dörfler ff6ff33a9d Put spaces between "::" in the asm directive to let it compile in C++ mode.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3262 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-05-20 03:02:19 +00:00
Axel Dörfler f78d32a251 Some header cleanups.
Removed unused keyboard.h header.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3135 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-05-03 13:26:32 +00:00
Axel Dörfler c4bf92f686 Added new arch_elf.h header where the platform dependent relocation definitions
are located.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3134 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-05-03 12:51:56 +00:00
Axel Dörfler a02a5888af Added another argument parameter for the thread creation code. Helps
implementing a more efficient on_exit_thread().


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3073 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-04-18 09:21:22 +00:00
Axel Dörfler 9175b5a5e0 Cleanup of the header mess: removed the redundant APIC/mp structure definitions
from smp_priv.h and stage2_priv.h. Created a new file smp_apic.h which now
contains those definitions.
Made the APIC_xxx register offsets only base offsets (without referencing a
particular variable).
Other small cleanups (i.e. "unsigned int" to uint32).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2604 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-01-30 21:20:33 +00:00
Axel Dörfler 074a16b53e Added a private tls.h file with definitions for the reserved TLS slots.
Renamed i386_set_kstack() to i386_set_tss_and_kstack(), because that's what
it does.
Added a new function arch_thread_init_tls() which must be called after
having allocated the TLS area.
Renamed arch_thread_initialize_kthread_stack() to arch_thread_init_kthread_stack()
to be more consistent.
Changed the parameters for arch_thread_enter_uspace() - it now gets a pointer
to the thread structure and takes the user stack pointer from there (which
might also be architectural different).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2379 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-01-07 09:17:31 +00:00
Axel Dörfler 7208e95f0e Moved the gdt_idt_descr struct from arch_stage2.h to stage2_priv.h.
Moved the tss_descriptor structure to descriptor.h, updated it to be a
segment_descriptor structure, and provided inlines for set_tss_descriptor(),
set_segment_descriptor(), set_segment_descriptor_base(), and
clear_segment_descriptor().
Also added defines for the different privilege levels and descriptor types.
Removed the unusused and incorrect TSS definition, introduced new
TSS_BASE_SEGMENT and TLS_BASE_SEGMENT macros.
Removed include of arch/cpu.h in arch_cpu.h.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2360 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-01-06 08:02:44 +00:00
lillo f510e6ce60 posix signals support, 1st pass
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1623 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-23 17:31:10 +00:00
Axel Dörfler 11fe0cb8de Added prototypes for the sys_/user_ attribute calls.
Changed the file_descriptor structure (more status_t, name removed).
Changed "extern inline" to "static inline" in thread.h/arch_thread.h as those
also work with -O0 -g.
Added prototypes for [arch_cpu_]user_strlcpy().


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1454 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-08 03:19:57 +00:00
Axel Dörfler 4e3c12c0af Moved <types.h> to <sys/types.h>.
Removed dependencies on arch/x86/types.h - this file is not really used
anymore, now. Might prevent compiling on Windows, though.
Replaced "int" with "int32" for the id types.
Removed some stuff from ktypes.h because it didn't belong there.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1120 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-09-23 02:36:51 +00:00
Axel Dörfler 5ca8da7a4b Backported the new stack crawl command ("sc", not "bt" like in NewOS) from
NewOS. Untested yet, though.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@750 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-08-13 21:42:53 +00:00
lillo 3cfbecf1a6 First round of big changes: the term team has replaced proc all over the kernel, the few kern_* syscalls have been renamed to sys_* for consistency, and other small changes. The ps app is temporarily disabled until get_next_team_info is implemented.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@557 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-08-03 00:41:27 +00:00
David Reid 40f83ea15d Add a new line at the end...
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@445 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-25 22:28:59 +00:00
notion fde77afb37 Ported my NewOS changes to OpenBeOS.
A couple of changes in various interrupt and thread functions and structures.
These make it now possible to change the stack at any time without making the kernel crash. This is needed for calling VESA 3.0 VBE functions through the protected mode interface.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@422 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-24 20:59:25 +00:00
David Reid 8a396015a1 There is no need for this to be here, so move it alongside the code
it refers to as that makes more sense.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@345 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-19 18:23:10 +00:00
Axel Dörfler 4635c565e4 Added the arch_cpu_idle() call.
Updated stage2_priv.h to reflect geist's, and freston's changes.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@306 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-18 14:15:47 +00:00
ejakowatz 52a3801208 It is accomplished ...
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-09 12:24:59 +00:00