peter [Thu, 1 May 2003 03:31:18 +0000 (03:31 +0000)]
Slight reorg and added AMD64 support. A couple of the MODINFOMD_* values
that were added to sparc64 and later powerpc, really should have been in
the MI area. But changing that now with insufficient preperation will
just cause too much pain.
Move MD_FETCH() to the MI sys/linker.h file to avoid another two copies
of it.
tjr [Thu, 1 May 2003 02:36:27 +0000 (02:36 +0000)]
Flush streams before calling system() so that the output appears in the
right place in the output stream when redirected to a file (when full
buffering is enabled). Noticed by schweikh on freebsd-standards.
grog [Thu, 1 May 2003 01:39:42 +0000 (01:39 +0000)]
Move most #includes to vext.h.
Change name of history file to History to avoid name conflicts.
Rewrite minor number decoding. Now we have only three types of
object: subdisks, plexes and volumes. The encoding for plexes and
subdisks no longer reflects the object to which they belong. The
super devices are high-order volume numbers. This gives vastly more
potential volumes (4 million instead of 256).
Don't try to chown directories if they haven't been created.
grog [Thu, 1 May 2003 01:35:03 +0000 (01:35 +0000)]
Rewrite minor number decoding. Now we have only three types of
object: subdisks, plexes and volumes. The encoding for plexes and
subdisks no longer reflects the object to which they belong. The
super devices are high-order volume numbers. This gives vastly more
potential volumes (4 million instead of 256).
grog [Thu, 1 May 2003 01:34:38 +0000 (01:34 +0000)]
For consistency's sake, on command failure, throw 1, not -1.
Rewrite minor number decoding. Now we have only three types of
object: subdisks, plexes and volumes. The encoding for plexes and
subdisks no longer reflects the object to which they belong. The
super devices are high-order volume numbers. This gives vastly more
potential volumes (4 million instead of 256).
grog [Thu, 1 May 2003 01:34:05 +0000 (01:34 +0000)]
Rewrite minor number decoding. Now we have only three types of
object: subdisks, plexes and volumes. The encoding for plexes and
subdisks no longer reflects the object to which they belong. The
super devices are high-order volume numbers. This gives vastly more
potential volumes (4 million instead of 256).
Correct formats for some error messages. Don't cast the value to
match the format.
grog [Thu, 1 May 2003 01:33:34 +0000 (01:33 +0000)]
Rewrite minor number decoding. Now we have only three types of
object: subdisks, plexes and volumes. The encoding for plexes and
subdisks no longer reflects the object to which they belong. The
super devices are high-order volume numbers. This gives vastly more
potential volumes (4 million instead of 256).
Tidy up comments.
Check for null rqgs. This continue to be reported, though I can't
work out why.
Correct formats for some error messages. Don't cast the value to
match the format.
Use microtime, not getmicrotime, for timing debug entries.
grog [Thu, 1 May 2003 01:31:20 +0000 (01:31 +0000)]
Don't make definition of kw_debug dependent on VINUMDEBUG. It's only
an enum value, and dropping it can lead to some spectacular surprises
in userland.
grog [Thu, 1 May 2003 01:30:59 +0000 (01:30 +0000)]
Rewrite minor number decoding. Now we have only three types of
object: subdisks, plexes and volumes. The encoding for plexes and
subdisks no longer reflects the object to which they belong. The
super devices are high-order volume numbers. This gives vastly more
potential volumes (4 million instead of 256).
As a result of the minor number changes, split out the superdevice
handling into a separate function, vinum_super_ioctl. This was most
of the code of vinumioctl.
grog [Thu, 1 May 2003 01:29:52 +0000 (01:29 +0000)]
Remove "to do" comments.
get_emppty_drive: Fix a day one bug with strcpy parameters.
Change name of find_drive_by_dev to the more descriptive
find_drive_by_name.
Rewrite minor number decoding. Now we have only three types of
object: subdisks, plexes and volumes. The encoding for plexes and
subdisks no longer reflects the object to which they belong. The
super devices are high-order volume numbers. This gives vastly more
potential volumes (4 million instead of 256).
grog [Thu, 1 May 2003 01:28:42 +0000 (01:28 +0000)]
Rewrite minor number decoding. Now we have only three types of
object: subdisks, plexes and volumes. The encoding for plexes and
subdisks no longer reflects the object to which they belong. The
super devices are high-order volume numbers. This gives vastly more
potential volumes (4 million instead of 256).
Remove an unnecessary goto.
vinumopen: Return EINVAL, not ENXIO, on an attempt to open a
referenced plex.
peter [Thu, 1 May 2003 01:05:25 +0000 (01:05 +0000)]
Commit MD parts of a loosely functional AMD64 port. This is based on
a heavily stripped down FreeBSD/i386 (brutally stripped down actually) to
attempt to get a stable base to start from. There is a lot missing still.
Worth noting:
- The kernel runs at 1GB in order to cheat with the pmap code. pmap uses
a variation of the PAE code in order to avoid having to worry about 4
levels of page tables yet.
- It boots in 64 bit "long mode" with a tiny trampoline embedded in the
i386 loader. This simplifies locore.s greatly.
- There are still quite a few fragments of i386-specific code that have
not been translated yet, and some that I cheated and wrote dumb C
versions of (bcopy etc).
- It has both int 0x80 for syscalls (but using registers for argument
passing, as is native on the amd64 ABI), and the 'syscall' instruction
for syscalls. int 0x80 preserves all registers, 'syscall' does not.
- I have tried to minimize looking at the NetBSD code, except in a couple
of places (eg: to find which register they use to replace the trashed
%rcx register in the syscall instruction). As a result, there is not a
lot of similarity. I did look at NetBSD a few times while debugging to
get some ideas about what I might have done wrong in my first attempt.
peter [Thu, 1 May 2003 00:10:38 +0000 (00:10 +0000)]
KPT_MIN_ADDRESS and KPT_MAX_ADDRESS are not used anywhere. And if they
were, they are not safe to use outside of the kernel since these values
can change at kernel compile time - ie: we do not want them compiled into
userland binaries.
peter [Wed, 30 Apr 2003 22:51:59 +0000 (22:51 +0000)]
Repocopy from x86_64/... to amd64/...
Rename visible x86_64 references to amd64.
Kill MID_MACHINE, its a.out specific, the only platform that supports it
is i386. All of the other platforms should remove it too.
peter [Wed, 30 Apr 2003 21:41:41 +0000 (21:41 +0000)]
Create a 'legacy' node for AMD64 as well as i386. While we'll never
have to use it since all AMD64 machines are supposed to have acpi etc,
I'm using it during development so I can avoid the acpi code for now.
Yes, this is cheating.
peter [Wed, 30 Apr 2003 19:27:07 +0000 (19:27 +0000)]
Update for AMD64. repocopied from i386-elf/crt1.c. Deal with regparm
argument passing rather than stack based args. The kernel passes the
base of the argument/env vector in %rdi (arg1).
peter [Wed, 30 Apr 2003 18:16:33 +0000 (18:16 +0000)]
Update for AMD64 after repocopy from i386/sys/*. This means:
- strip out the nasty PIC_PROLOGUE/EPILOGUE stuff, since we dont have
to lose a register in PIC mode anymore (we use %rip-relative addressing).
- update for C register argument passing conventions.
- convert 32 bit to 64 bit register sizes etc.
peter [Wed, 30 Apr 2003 18:13:13 +0000 (18:13 +0000)]
Update for AMD64 (repocopied from i386/sys/Ovfork.S - why is it O?)
Depend on %rsi being preserved across the "syscall"-style syscall and strip
out the PIC stuff (this cpu has full PC-relative addressing, at last!)
peter [Wed, 30 Apr 2003 18:09:33 +0000 (18:09 +0000)]
Update for AMD64 contexts. Note that this still has some x87-style FPU
instructions here, these may need to be updated for SSE.
(Repocopied from i386/gen)
peter [Wed, 30 Apr 2003 18:07:23 +0000 (18:07 +0000)]
Update for AMD64 (repocopied from i386/net). We can depend on having
the bswap instruction (yay!). Update for register parameter passing
instead of i386 style stack based param passing.
peter [Wed, 30 Apr 2003 18:06:14 +0000 (18:06 +0000)]
Update for AMD64-style syscalls. Repocopied from i386/SYS.h.
Note that the syscall instruction clobbers %rcx, which is inconvenient
because it is the fourth syscall argument, so we use %r10 (another scratch
register) for the 4th syscall arg instead (I picked %r10 to be the same as
NetBSD). int 0x80 is still possible though, and it uses %rcx as usual.
Note that the syscall style syscall does *NOT* preserve all the registers,
unlike int 0x80. We do not preserve the scratch registers except for
%rdi and %rsi. int 0x80 does preserve everything but the return values.
Floating point libc functions traditionally written in ASM.
AMD64 does away with the x87 in 64-bit long mode, so we have to play the
SSE/SSE2 game now.
Fix some easy, global, lint warnings. In most cases, this means
making some local variables static. In a couple of cases, this means
removing an unused variable.
Warns fixing. Protect against inappropriate linting, and mark
GCC-specific assemble code as such (in #ifdefs). Fix an easy
static variable warning while I'm here.
Fix "make world" for the WANT_LINT case. The various build tools
must not try to lint(1) stuff at *-tools time; keep the linting
for the actual build (which comes later).
Backout my changes in rev. 1.32 and 1.33. There is some code that depends
on the previous behaviour. This also brings strptime(3) behaviour back in line
with the other BSDs.
This script should require mountcritremote, since that is the last
script at which a filesystem will be mounted in FreeBSD. Without this
the script was being inserted later in the boot than necessary.
Approved by: markm (mentor) (implicit)
Reviewed by: dougb
Noticed by: Andrzej ToboĆ a <san@wilk.2a.pl>
o Don't announce that the timer is good when in fact it isn't timing
at all (ie reads yield constant values). Display the width as the
difference between max and min so that constant timers have width
zero.
o Get the address of the timer from the XPmTmrBlk field instead of
the V1_PmTmrBlk field. The former is a generic address and can
specify a memory mapped I/O address. Remove <machine/bus_pio.h>
to account for this. The timer is now properly configured on
machines with ACPI v2 tables, whether PIO or MEMIO. Note that
the acpica code converts v1 tables into v2 tables so the address
is always present in XPmTmrBlk.
o Replace the TIMER_READ macro with a call to the read_counter()
function and add a barrier to make sure that we observe proper
ordering of the reads.