aboutsummaryrefslogtreecommitdiff
path: root/src/farptr.h
AgeCommit message (Collapse)AuthorFilesLines
2010-01-03Be sure to add "void" to all function prototypes that take no args.Kevin O'Connor1-1/+1
Omitting "void" leads to a K&R style declaration which was not intended.
2009-12-27Only add "addr32" to memory accesses that require them.Kevin O'Connor1-46/+46
Extract out addr32 to a parameter to the READx/WRITEx_SEG macros.
2009-12-26Introduce MODESEGMENT define; rename VISIBLE32 to VISIBLE32FLAT.Kevin O'Connor1-11/+3
Prepare for support of segmented 32bit code. Add new MODESEGMENT definition, and clarify existing 32bit mode defs.
2009-09-09Replace common segment/offset pairs with struct segoff_s.Kevin O'Connor1-0/+19
Introduce 'struct segoff_s' to more places.
2009-08-01Add Post Memory Manager (PMM) support.Kevin O'Connor1-8/+9
Complete the initial implementation of PMM. Default new PMM code to be enabled. Move malloc code from memmap.c to pmm.c. Define new malloc zones for PMM (ZoneTmpLow and ZoneTmpHigh). Change default READ/WRITE_SEG macros to use 32bit pointers (the 16bit PMM code use "big real" mode and requires 32bit accesses). Allow pmm allocations to occur during bcv executions also. Add low-memory clearing before boot. Also, align the default f-seg memory.
2009-07-12Add u64 cast to READ64_SEG() macro to fix vga compiling.Kevin O'Connor1-1/+1
Cast is needed when pulling pointers or other non-int types.
2009-06-30Rework READ64_SEG macro to prevent spurious warning on gcc 4.4.Kevin O'Connor1-5/+6
Gcc is reporting a spurious unused variable warning - work around it.
2009-06-15Unify mode16/32 compiler checks.Kevin O'Connor1-0/+8
Add ASSERT16/ASSERT32 macros to farptr.h. Use those macros in place of open-coded checks. Add "noreturn" attribute to functions to reduce compiler warnings. Add ASSERT32 to smp_probe() to eliminate 16bit assembler warnings.
2009-01-19Allow GET/SET_SEG asm to access memory or a register.Kevin O'Connor1-2/+2
This is a minor optimization that can improve gcc code generation.
2009-01-19Rename MAKE_FARPTR (and similar) to MAKE_FLATPTR.Kevin O'Connor1-46/+46
The term "far pointer" is used in many 16bit specs, and it is different from what MAKE_FARPTR creates. So, use the term "flat pointer" in the code to distinguish between the two meanings. Also, use the suffix "_fl" consistently when working with "flat pointers".
2009-01-15Change license from GPLv3 to LGPLv3.Kevin O'Connor1-1/+1
Change license of contributions from Kevin O'Connor from GPLv3 to LGPLv3 (or later). Since the work as a whole is based on Kevin's contributions and the "bochs bios" which has a license of LGPL (v2 or later), this effectively makes the work as a whole available under LGPLv3 (or later).
2009-01-01Switch to new stack when calling ATA function in 16bit mode.Kevin O'Connor1-2/+3
This reduces stack usage (old dos programs don't provide much space).
2008-11-08Rework READx_SEG/WRITEx_SEG macro type detection.Kevin O'Connor1-52/+38
Detect types by size instead of by comparison to different integer types. This allows pointers and other types to be directly accessed. Note that this does slightly pessimize 64bit accesses.
2008-07-13Always define macro MODE16 - that way it can be used in C conditionals.Kevin O'Connor1-1/+1
When in 32bit mode - just define it to 0.
2008-05-14Add full support for drives with more that 2<<32 sectors.Kevin O'Connor1-0/+19
Use 64bit integers for sector and lba values.
2008-04-12Fix asm dependencies on segment based writes.Kevin O'Connor1-6/+6
The variable was marked as an input instead of an output. This could cause gcc bugs - it also forced the asm to be volatile.
2008-03-30Avoid using volatile on GET/SET_VAR macros.Kevin O'Connor1-42/+54
Instead of using volatile, use a dummy variable definition so the compiler can track the link between segment updates and accesses. This gives gcc more flexibility in instruction scheduling. Also update GET/SET_VAR macros to support signed integer variants.
2008-03-29Fix bugs in GET/SET_FARPTR macros.Kevin O'Connor1-5/+7
2008-03-22Use "FARPTR" consistently in macros.Kevin O'Connor1-16/+16
Rename MAKE_32_PTR to MAKE_FARPTR. Rename PTR_TO_SEG to FARPTR_TO_SEG. Rename PTR_TO_OFFSET to FARPTR_TO_OFFSET.
2008-03-12Use 32bit absolute pointers for buffers in ATA code.Kevin O'Connor1-40/+72
Using 32bit pointers makes the code a little simpler. It also allows the code to be used from 32 bit mode. It does require all callers to encode the segment/offset into an absolute address. The ins/outs functions also need to know how to convert from 32bit back to segment/offset addresses. The change also includes a minor cleanup of the macros in farptr.h.
2008-03-09Fix bug in SET_FARVAR.Kevin O'Connor1-1/+2
The (val) parameter needs to be evaluated before setting the segment.
2008-03-09Optimize insb/outsb/insw/etc. functions.Kevin O'Connor1-0/+27
Use "string ops" to simplify port accesses. Always run "cld" on entry to C code.
2008-02-27Some cleanups based on patch by Nguyen Anh QuynhKevin O'Connor1-0/+4
Add include guards to header files. Disable stack protector on gcc versions with that option. Fix lds bug in src/rombios32.lds.S Don't forward declare "struct bregs;" - it may be confusing gcc on some versions.
2008-02-25Version 0.1.2rel-0.1.2Kevin O'Connor1-12/+34
2008-02-25Version 0.1.1rel-0.1.1Kevin O'Connor1-4/+24
2008-02-25Initial checkin.rel-0.1.0Kevin O'Connor1-0/+57