summaryrefslogtreecommitdiff
path: root/sys/arch/amd64/include
AgeCommit message (Collapse)Author
2003-12-30Replace the traditional buffer memory management -- based on fixed per bufferpk
virtual memory reservation and a private pool of memory pages -- by a scheme based on memory pools. This allows better utilization of memory because buffers can now be allocated with a granularity finer than the system's native page size (useful for filesystems with e.g. 1k or 2k fragment sizes). It also avoids fragmentation of virtual to physical memory mappings (due to the former fixed virtual address reservation) resulting in better utilization of MMU resources on some platforms. Finally, the scheme is more flexible by allowing run-time decisions on the amount of memory to be used for buffers. On the other hand, the effectiveness of the LRU queue for buffer recycling may be somewhat reduced compared to the traditional method since, due to the nature of the pool based memory allocation, the actual least recently used buffer may release its memory to a pool different from the one needed by a newly allocated buffer. However, this effect will kick in only if the system is under memory pressure.
2003-11-28Define the mcount function in assembler, and have it save all registersfvdl
used for argument passing, plus %rax (used to pass the number of float arguments to varargs functions), to avoid having it clobber caller-saved registers. mcount is emitted "under the radar", so the compiler doesn't know it should do this. Change the kernel mcount entry/exit macros to use plain cli/sti, like on i386.
2003-11-25bye, bye _MCONTEXT_TO_SIGCONTEXT and vice versa.christos
2003-10-31Reduce code duplication by adding mi_userret() in sys/userret.hcl
containing signal posting, kernel-exit handling and sa_upcall processing. XXX the pc532, sparc, sparc64 and vax ports should have their XXX userret() code rearranged to use this.
2003-10-22Use a common <machine/math.h> for amd64 and i386.kleink
2003-10-18Add SIGTRAMP_VALID().briggs
2003-10-17Correct VM_MAXUSER_ADDRESS definitions, it was wasting a few pages.fvdl
2003-10-13Define 32bit versions of signal frames and contexts.fvdl
2003-10-13Define a few macros to validate userspace selectors.fvdl
2003-10-13Define mcontext32_t (if COMPAT_NETBSD32).fvdl
2003-10-13Define all frame members as unsigned, to avoid any possibility offvdl
sign extension on these values.
2003-10-08Add some accessor macros for the ucontext:thorpej
* _UC_MACHINE_PC() - access the program counter * _UC_MACHINE_INTRV() - access the integer return value register * _UC_MACHINE_SET_PC() - set the program counter (this requires special handling on some platforms).
2003-10-08Overhaul MBR handling (part 1):lukem
<sys/bootblock.h>: * Added definitions for the Master Boot Record (MBR) used by a variety of systems (primarily i386), including the format of the BIOS Parameter Block (BPB). This information was cribbed from a variety of sources including <sys/disklabel_mbr.h> which this is a superset of. As part of this, some data structure elements and #defines were renamed to be more "namespace friendly" and consistent with other bootblocks and MBR documentation. Update all uses of the old names to the new names. <sys/disklabel_mbr.h>: * Deprecated in favor of <sys/bootblock.h> (the latter is more "host tool" friendly). amd64 & i386: * Renamed /usr/mdec/bootxx_dosfs to /usr/mdec/bootxx_msdos, to be consistent with the naming convention of the msdosfs tools. * Removed /usr/mdec/bootxx_ufs, as it's equivalent to bootxx_ffsv1 and it's confusing to have two functionally equivalent bootblocks, especially given that "ufs" has multiple meanings (it could be a synonym for "ffs", or the group of ffs/lfs/ext2fs file systems). * Rework pbr.S (the first sector of bootxx_*): + Ensure that BPB (bytes 11..89) and the partition table (bytes 446..509) do not contain code. + Add support for booting from FAT partitions if BOOT_FROM_FAT is defined. (Only set for bootxx_msdos). + Remove "dummy" partition 3; if people want to installboot(8) these to the start of the disk they can use fdisk(8) to create a real MBR partition table... + Compile with TERSE_ERROR so it fits because of the above. Whilst this is less user friendly, I feel it's important to have a valid partition table and BPB in the MBR/PBR. * Renamed /usr/mdec/biosboot to /usr/mdec/boot, to be consistent with other platforms. * Enable SUPPORT_DOSFS in /usr/mdec/boot (stage2), so that we can boot off FAT partitions. * Crank version of /usr/mdec/boot to 3.1, and fix some of the other entries in the version file. installboot(8) (i386): * Read the existing MBR of the filesystem and retain the BIOS Parameter Block (BPB) in bytes 11..89 and the MBR partition table in bytes 446..509. (Previously installboot(8) would trash those two sections of the MBR.) mbrlabel(8): * Use sys/lib/libkern/xlat_mbr_fstype.c instead of homegrown code to map the MBR partition type to the NetBSD disklabel type. Test built "make release" for i386, and new bootblocks verified to work (even off FAT!).
2003-10-06SIGINFO support.fvdl
Todo: 32bit compat support (COMPAT_NETBSD32 will not compile right now, as it won't on other platforms).
2003-09-26Move __cpu_simple_lock_t and __SIMPLELOCK_{UN,}LOCKED to machine/types.hnathanw
so that they can be used in a namespace-friendly way.
2003-09-26move MI stuff to the MI include.christos
2003-09-26add catch up with const sigset_t *christos
2003-09-19LONG_BIT should be 64. From Nicolas Joly.fvdl
2003-09-11__{BEGIN,END}_DECLS-wrap prototypes.kleink
2003-08-31Update a few types and formats.fvdl
2003-08-20Pass pointers to frames from assembly, do not use the 'frame on stackfvdl
as argument passed by value' trick, as gcc 3.3.x makes (valid) assumptions about the stack that will not be true. Costs 2 instructions per trap/syscall on i386, 4 per interrupt for MP. One instruction per trap/syscall on amd64, 2 per interrupt for MP. I expect gcc 3.3.1 to make up for this by better optimization (it'd better..) While here, make amd64 compile again by using subr_mbr_disk.c
2003-08-07Move UCB-licensed code from 4-clause to 3-clause licence.agc
Patches provided by Joel Baker in PR 22364, verified by myself.
2003-08-04mbr partition stuff isn't saved here (or anywhere else) anymore.dsl
2003-06-23Make sure to include opt_foo.h if a defflag option FOO is used.martin
2003-06-15Handle 64bit DMA addresses on PCI for platforms that can (currently onlyfvdl
enabled on amd64). Add a dmat64 field to various PCI attach structures, and pass it down where needed. Implement a simple new function called pci_dma64_available(pa) to test if 64bit DMA addresses may be used. This returns 1 iff _PCI_HAVE_DMA64 is defined in <machine/pci_machdep.h>, and there is more than 4G of memory.
2003-05-25Correct a few maximum values.fvdl
2003-05-11ACPI support. Wakeup code still to be done.fvdl
2003-05-11Reselect the ioapic register for each read or write.fvdl
2003-05-10Remove redundant bounds_check_with_label() prototype.thorpej
2003-05-08Move x86_pause() out of ifdef _KERNEL.fvdl
2003-05-08Add x86_pause() inline function, containing the "pause" instructionfvdl
for i386, and nothing for amd64. Sprinkle it in various spinloops, as recommended by Intel.
2003-05-04Follow i386, and mask deferred level-triggered interrupts at the ioapic.fvdl
2003-05-02set symbol to be a function using .type directive in IDTVEC macroyamt
so that ddb backtrace can pick them up after recent ksyms changes. suggested by Matt Thomas on tech-kern. ok'ed by Frank van der Linden.
2003-04-29Add a BKPT_ADDR() macro which gives MD code a chance to munge ascw
breakpoint address before it's used. Currently a no-op on all but sh5. This is useful on sh5, for example, to mask off the instruction type encoding in the bottom two address bits, and makes it possible to do "db> break $rXX" instead of manually munging the address.
2003-04-28Add a new feature-test macro, _NETBSD_SOURCE. If this is definedbjh21
by the application, all NetBSD interfaces are made visible, even if some other feature-test macro (like _POSIX_C_SOURCE) is defined. <sys/featuretest.h> defined _NETBSD_SOURCE if none of _ANSI_SOURCE, _POSIX_C_SOURCE and _XOPEN_SOURCE is defined, so as to preserve existing behaviour. This has two major advantages: + Programs that require non-POSIX facilities but define _POSIX_C_SOURCE can trivially be overruled by putting -D_NETBSD_SOURCE in their CFLAGS. + It makes most of the #ifs simpler, in that they're all now ORs of the various macros, rather than having checks for (!defined(_ANSI_SOURCE) || !defined(_POSIX_C_SOURCE) || !defined(_XOPEN_SOURCE)) all over the place. I've tried not to change the semantics of the headers in any case where _NETBSD_SOURCE wasn't defined, but there were some places where the current semantics were clearly mad, and retaining them was harder than correcting them. In particular, I've mostly normalised things so that _ANSI_SOURCE gets you the smallest set of stuff, then _POSIX_C_SOURCE, _XOPEN_SOURCE and _NETBSD_SOURCE in that order. Tested by building for vax, encouraged by thorpej, and uncontested in tech-userlevel for a week.
2003-04-27Fix *LONGMAX values.fvdl
2003-04-26Rename the x86_64 port to amd64, as this is the actual name used forfvdl
the processor family now. x86_64 is kept as the MACHINE_ARCH value, since it's already widely used (by e.g. the toolchain, etc), and by other operating systems.