mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-10-28 19:34:43 +01:00
Compare commits
31
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7d5bc63209 | ||
|
|
18d96317a1 | ||
|
|
68a0a8fbec | ||
|
|
43837e2288 | ||
|
|
62d02dc863 | ||
|
|
909c082ec1 | ||
|
|
86c7ef7872 | ||
|
|
ac88a0a707 | ||
|
|
e0fb848ab2 | ||
|
|
5c2f5d6243 | ||
|
|
2bc4e74f3a | ||
|
|
4026f294fb | ||
|
|
0b909877cf | ||
|
|
37cdba40e6 | ||
|
|
22381f1a11 | ||
|
|
727591c126 | ||
|
|
c826cdb249 | ||
|
|
38d3020be4 | ||
|
|
cd741eae0a | ||
|
|
e647b9b1e2 | ||
|
|
8e57c3cfe9 | ||
|
|
893abf9888 | ||
|
|
3d71b01065 | ||
|
|
5a490f9a9a | ||
|
|
3b376d0478 | ||
|
|
5f7643cd64 | ||
|
|
b67739b62d | ||
|
|
aa9dbec26b | ||
|
|
75cc813f6c | ||
|
|
69a4e11c89 | ||
|
|
40dfd7de5c |
No files matched your search
@@ -1,82 +0,0 @@
|
||||
#! /bin/sh
|
||||
|
||||
# Wrapper for compilers which do not understand `-c -o'.
|
||||
|
||||
# Copyright 1999, 2000 Free Software Foundation, Inc.
|
||||
# Written by Tom Tromey <[email protected]>.
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
# Usage:
|
||||
# compile PROGRAM [ARGS]...
|
||||
# `-o FOO.o' is removed from the args passed to the actual compile.
|
||||
|
||||
prog=$1
|
||||
shift
|
||||
|
||||
ofile=
|
||||
cfile=
|
||||
args=
|
||||
while test $# -gt 0; do
|
||||
case "$1" in
|
||||
-o)
|
||||
ofile=$2
|
||||
shift
|
||||
;;
|
||||
*.c)
|
||||
cfile=$1
|
||||
args="$args $1"
|
||||
;;
|
||||
*)
|
||||
args="$args $1"
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
test -z "$ofile" && {
|
||||
echo "compile: no \`-o' option seen" 1>&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
test -z "$cfile" && {
|
||||
echo "compile: no \`.c' file seen" 1>&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Name of file we expect compiler to create.
|
||||
cofile=`echo $cfile | sed -e 's|^.*/||' -e 's/\.c$/.o/'`
|
||||
|
||||
# Create the lock directory.
|
||||
lockdir=`echo $ofile | sed -e 's|/|_|g'`
|
||||
while true; do
|
||||
if mkdir $lockdir > /dev/null 2>&1; then
|
||||
break
|
||||
fi
|
||||
sleep 1
|
||||
done
|
||||
# FIXME: race condition here if user kills between mkdir and trap.
|
||||
trap "rmdir $lockdir; exit 1" 1 2 15
|
||||
|
||||
# Run the compile.
|
||||
"$prog" $args
|
||||
status=$?
|
||||
|
||||
if test -f "$cofile"; then
|
||||
mv "$cofile" "$ofile"
|
||||
fi
|
||||
|
||||
rmdir $lockdir
|
||||
exit $status
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,92 +0,0 @@
|
||||
#!/bin/sh
|
||||
# Get modification time of a file or directory and pretty-print it.
|
||||
# Copyright 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
# written by Ulrich Drepper <[email protected]>, June 1995
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
# Prevent date giving response in another language.
|
||||
LANG=C
|
||||
export LANG
|
||||
LC_ALL=C
|
||||
export LC_ALL
|
||||
LC_TIME=C
|
||||
export LC_TIME
|
||||
|
||||
# Get the extended ls output of the file or directory.
|
||||
# On HPUX /bin/sh, "set" interprets "-rw-r--r--" as options, so the "x" below.
|
||||
if ls -L /dev/null 1>/dev/null 2>&1; then
|
||||
set - x`ls -L -l -d $1`
|
||||
else
|
||||
set - x`ls -l -d $1`
|
||||
fi
|
||||
# The month is at least the fourth argument
|
||||
# (3 shifts here, the next inside the loop).
|
||||
shift
|
||||
shift
|
||||
shift
|
||||
|
||||
# Find the month. Next argument is day, followed by the year or time.
|
||||
month=
|
||||
until test $month
|
||||
do
|
||||
shift
|
||||
case $1 in
|
||||
Jan) month=January; nummonth=1;;
|
||||
Feb) month=February; nummonth=2;;
|
||||
Mar) month=March; nummonth=3;;
|
||||
Apr) month=April; nummonth=4;;
|
||||
May) month=May; nummonth=5;;
|
||||
Jun) month=June; nummonth=6;;
|
||||
Jul) month=July; nummonth=7;;
|
||||
Aug) month=August; nummonth=8;;
|
||||
Sep) month=September; nummonth=9;;
|
||||
Oct) month=October; nummonth=10;;
|
||||
Nov) month=November; nummonth=11;;
|
||||
Dec) month=December; nummonth=12;;
|
||||
esac
|
||||
done
|
||||
|
||||
day=$2
|
||||
|
||||
# Here we have to deal with the problem that the ls output gives either
|
||||
# the time of day or the year.
|
||||
case $3 in
|
||||
*:*) set `date`; eval year=\$$#
|
||||
case $2 in
|
||||
Jan) nummonthtod=1;;
|
||||
Feb) nummonthtod=2;;
|
||||
Mar) nummonthtod=3;;
|
||||
Apr) nummonthtod=4;;
|
||||
May) nummonthtod=5;;
|
||||
Jun) nummonthtod=6;;
|
||||
Jul) nummonthtod=7;;
|
||||
Aug) nummonthtod=8;;
|
||||
Sep) nummonthtod=9;;
|
||||
Oct) nummonthtod=10;;
|
||||
Nov) nummonthtod=11;;
|
||||
Dec) nummonthtod=12;;
|
||||
esac
|
||||
# For the first six month of the year the time notation can also
|
||||
# be used for files modified in the last year.
|
||||
if (expr $nummonth \> $nummonthtod) > /dev/null;
|
||||
then
|
||||
year=`expr $year - 1`
|
||||
fi;;
|
||||
*) year=$3;;
|
||||
esac
|
||||
|
||||
# The result.
|
||||
echo $day $month $year
|
||||
@@ -1,4 +0,0 @@
|
||||
@set UPDATED 5 September 2001
|
||||
@set UPDATED-MONTH September 2001
|
||||
@set EDITION 1.11.2
|
||||
@set VERSION 1.11.2
|
||||
@@ -1,4 +0,0 @@
|
||||
@set UPDATED 17 April 2002
|
||||
@set UPDATED-MONTH April 2002
|
||||
@set EDITION 1.11.2
|
||||
@set VERSION 1.11.2
|
||||
@@ -1,4 +0,0 @@
|
||||
@set UPDATED 5 September 2001
|
||||
@set UPDATED-MONTH September 2001
|
||||
@set EDITION 1.11.2
|
||||
@set VERSION 1.11.2
|
||||
@@ -1,4 +0,0 @@
|
||||
@set UPDATED 17 April 2002
|
||||
@set UPDATED-MONTH April 2002
|
||||
@set EDITION 1.11.2
|
||||
@set VERSION 1.11.2
|
||||
@@ -1,92 +0,0 @@
|
||||
#!/bin/sh
|
||||
# Get modification time of a file or directory and pretty-print it.
|
||||
# Copyright 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
# written by Ulrich Drepper <[email protected]>, June 1995
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
# Prevent date giving response in another language.
|
||||
LANG=C
|
||||
export LANG
|
||||
LC_ALL=C
|
||||
export LC_ALL
|
||||
LC_TIME=C
|
||||
export LC_TIME
|
||||
|
||||
# Get the extended ls output of the file or directory.
|
||||
# On HPUX /bin/sh, "set" interprets "-rw-r--r--" as options, so the "x" below.
|
||||
if ls -L /dev/null 1>/dev/null 2>&1; then
|
||||
set - x`ls -L -l -d $1`
|
||||
else
|
||||
set - x`ls -l -d $1`
|
||||
fi
|
||||
# The month is at least the fourth argument
|
||||
# (3 shifts here, the next inside the loop).
|
||||
shift
|
||||
shift
|
||||
shift
|
||||
|
||||
# Find the month. Next argument is day, followed by the year or time.
|
||||
month=
|
||||
until test $month
|
||||
do
|
||||
shift
|
||||
case $1 in
|
||||
Jan) month=January; nummonth=1;;
|
||||
Feb) month=February; nummonth=2;;
|
||||
Mar) month=March; nummonth=3;;
|
||||
Apr) month=April; nummonth=4;;
|
||||
May) month=May; nummonth=5;;
|
||||
Jun) month=June; nummonth=6;;
|
||||
Jul) month=July; nummonth=7;;
|
||||
Aug) month=August; nummonth=8;;
|
||||
Sep) month=September; nummonth=9;;
|
||||
Oct) month=October; nummonth=10;;
|
||||
Nov) month=November; nummonth=11;;
|
||||
Dec) month=December; nummonth=12;;
|
||||
esac
|
||||
done
|
||||
|
||||
day=$2
|
||||
|
||||
# Here we have to deal with the problem that the ls output gives either
|
||||
# the time of day or the year.
|
||||
case $3 in
|
||||
*:*) set `date`; eval year=\$$#
|
||||
case $2 in
|
||||
Jan) nummonthtod=1;;
|
||||
Feb) nummonthtod=2;;
|
||||
Mar) nummonthtod=3;;
|
||||
Apr) nummonthtod=4;;
|
||||
May) nummonthtod=5;;
|
||||
Jun) nummonthtod=6;;
|
||||
Jul) nummonthtod=7;;
|
||||
Aug) nummonthtod=8;;
|
||||
Sep) nummonthtod=9;;
|
||||
Oct) nummonthtod=10;;
|
||||
Nov) nummonthtod=11;;
|
||||
Dec) nummonthtod=12;;
|
||||
esac
|
||||
# For the first six month of the year the time notation can also
|
||||
# be used for files modified in the last year.
|
||||
if (expr $nummonth \> $nummonthtod) > /dev/null;
|
||||
then
|
||||
year=`expr $year - 1`
|
||||
fi;;
|
||||
*) year=$3;;
|
||||
esac
|
||||
|
||||
# The result.
|
||||
echo $day $month $year
|
||||
@@ -1,92 +0,0 @@
|
||||
#! /bin/sh
|
||||
|
||||
# Let autoconf run when this is set
|
||||
autoconf=:
|
||||
|
||||
usage()
|
||||
{
|
||||
echo "usage: `basename $0` --help | --version"
|
||||
echo "usage: `basename $0` [--[no]autoconf]"
|
||||
}
|
||||
|
||||
help()
|
||||
{
|
||||
echo
|
||||
echo "This program will touch the files necessary to prevent Automake, aclocal,"
|
||||
echo "and, optionally, Autoheader, Autoconf, and configure from running after a"
|
||||
echo "fresh update from the CVS repository."
|
||||
echo
|
||||
echo " -h | --help Display this text and exit"
|
||||
echo " -V | --version Display version and exit"
|
||||
echo " -a | --autoconf Allow Autoconf & Autoheader to run (default)"
|
||||
echo " -A | --noautoconf Prevent Autoconf & Autoheader from running"
|
||||
echo
|
||||
echo "Not running Automake & aclocal causes changes to the following user files"
|
||||
echo "to be ignored:"
|
||||
echo
|
||||
echo " Makefile.am, acinclude.m4, configure.in"
|
||||
echo
|
||||
echo "Not running Autoconf & Autoheader causes changes to the following user"
|
||||
echo "files to be ignored:"
|
||||
echo
|
||||
echo " acconfig.h, configure.in"
|
||||
}
|
||||
|
||||
while getopts VACach-: opt; do
|
||||
if test "x$opt" = "x-"; then
|
||||
case $OPTARG in
|
||||
help)
|
||||
opt=h
|
||||
;;
|
||||
version)
|
||||
opt=V
|
||||
;;
|
||||
autoconf)
|
||||
opt=a
|
||||
;;
|
||||
noautoconf)
|
||||
opt=A
|
||||
;;
|
||||
*)
|
||||
opt=?
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
case $opt in
|
||||
h)
|
||||
usage
|
||||
help
|
||||
exit 0
|
||||
;;
|
||||
V)
|
||||
echo "CVS No Automake 0.1"
|
||||
exit 0
|
||||
;;
|
||||
A)
|
||||
autoconf=false
|
||||
;;
|
||||
a)
|
||||
autoconf=:
|
||||
;;
|
||||
?)
|
||||
usage >&2
|
||||
exit 2
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# prevent aclocal from running
|
||||
find . -name aclocal.m4 -exec touch {} \;
|
||||
|
||||
# prevent Automake from running
|
||||
find . -name Makefile.in -exec touch {} \;
|
||||
|
||||
# prevent Autoheader from running
|
||||
if $autoconf; then :; else
|
||||
find . -name 'stamp-h?.in' -exec touch {} \;
|
||||
fi
|
||||
|
||||
# prevent Autoconf from running
|
||||
if $autoconf; then :; else
|
||||
find . -name configure -exec touch {} \;
|
||||
fi
|
||||
@@ -1,37 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2001, Derek Price and others
|
||||
* Copyright (c) 1992, Brian Berliner and Jeff Polk
|
||||
* Copyright (c) 1989-1992, Brian Berliner
|
||||
*
|
||||
* You may distribute under the terms of the GNU General Public License as
|
||||
* specified in the README file that comes with the CVS kit.
|
||||
*/
|
||||
|
||||
/* CVSroot data structures */
|
||||
|
||||
/* Access method specified in CVSroot. */
|
||||
typedef enum {
|
||||
null_method,
|
||||
local_method,
|
||||
server_method,
|
||||
pserver_method,
|
||||
kserver_method,
|
||||
gserver_method,
|
||||
ext_method,
|
||||
fork_method
|
||||
} CVSmethod;
|
||||
extern char *method_names[]; /* change this in root.c if you change
|
||||
the enum above */
|
||||
|
||||
typedef struct cvsroot_s {
|
||||
char *original; /* the complete source CVSroot string */
|
||||
CVSmethod method; /* one of the enum values above */
|
||||
char *username; /* the username or NULL if method == local */
|
||||
char *password; /* the username or NULL if method == local */
|
||||
char *hostname; /* the hostname or NULL if method == local */
|
||||
int port; /* the port or zero if method == local */
|
||||
char *directory; /* the directory name */
|
||||
#ifdef CLIENT_SUPPORT
|
||||
unsigned char isremote; /* nonzero if we are doing remote access */
|
||||
#endif /* CLIENT_SUPPORT */
|
||||
} cvsroot_t;
|
||||
@@ -1,15 +0,0 @@
|
||||
/* -*- c -*-
|
||||
*
|
||||
* Copyright (c) 1992, Brian Berliner and Jeff Polk
|
||||
* Copyright (c) 1989-1992, Brian Berliner
|
||||
*
|
||||
* You may distribute under the terms of the GNU General Public License as
|
||||
* specified in the README file that comes with the CVS kit.
|
||||
*/
|
||||
|
||||
#ifndef VERSION_H
|
||||
#define VERSION_H 1
|
||||
|
||||
#define version_string "Concurrent Versions System (CVS) @VERSION@"
|
||||
|
||||
#endif /* VERSION_H */
|
||||
@@ -1,32 +0,0 @@
|
||||
#------------------------------------------------------------------------------
|
||||
# acorn: file(1) magic for files found on Acorn systems
|
||||
#
|
||||
|
||||
# RISC OS Chunk File Format
|
||||
# From RISC OS Programmer's Reference Manual, Appendix D
|
||||
# We guess the file type from the type of the first chunk.
|
||||
0 lelong 0xc3cbc6c5 RISC OS Chunk data
|
||||
>12 string OBJ_ \b, AOF object
|
||||
>12 string LIB_ \b, ALF library
|
||||
|
||||
# RISC OS AIF, contains "SWI OS_Exit" at offset 16.
|
||||
16 lelong 0xef000011 RISC OS AIF executable
|
||||
|
||||
# RISC OS Draw files
|
||||
# From RISC OS Programmer's Reference Manual, Appendix E
|
||||
0 string Draw RISC OS Draw file data
|
||||
|
||||
# RISC OS new format font files
|
||||
# From RISC OS Programmer's Reference Manual, Appendix E
|
||||
0 string FONT\0 RISC OS outline font data,
|
||||
>5 byte x version %d
|
||||
0 string FONT\1 RISC OS 1bpp font data,
|
||||
>5 byte x version %d
|
||||
0 string FONT\4 RISC OS 4bpp font data
|
||||
>5 byte x version %d
|
||||
|
||||
# RISC OS Music files
|
||||
# From RISC OS Programmer's Reference Manual, Appendix E
|
||||
0 string Maestro\r RISC OS music file
|
||||
>8 byte x version %d
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# CDDB: file(1) magic for CDDB(tm) format CD text data files
|
||||
#
|
||||
# From <[email protected]>
|
||||
#
|
||||
# This is the /etc/magic entry to decode datafiles as used by
|
||||
# CDDB-enabled CD player applications.
|
||||
#
|
||||
|
||||
0 string/b #\040xmcd CDDB(tm) format CD text data
|
||||
@@ -1,6 +0,0 @@
|
||||
#------------------------------------------------------------------------------
|
||||
# citrus locale declaration
|
||||
#
|
||||
|
||||
0 string RuneCT Citrus locale declaration for LC_CTYPE
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
#------------------------------------------------------------------------------
|
||||
# file(1) magic for cvs(1) files
|
||||
# From Hendrik Scholz <[email protected]>
|
||||
|
||||
0 string /1\ :pserver: cvs password text file
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
# ATSC A/53 aka AC-3 aka Dolby Digital <[email protected]>
|
||||
# from http://www.atsc.org/standards/a_52a.pdf
|
||||
# corrections, additions, etc. are always welcome!
|
||||
#
|
||||
# syncword
|
||||
0 beshort 0x0b77 ATSC A/52 aka AC-3 aka Dolby Digital stream,
|
||||
# fscod
|
||||
>4 byte&0xc0 0x00 48 kHz,
|
||||
>4 byte&0xc0 0x40 44.1 kHz,
|
||||
>4 byte&0xc0 0x80 32 kHz,
|
||||
# is this one used for 96 kHz?
|
||||
>4 byte&0xc0 0xc0 reserved frequency,
|
||||
#
|
||||
>5 byte&7 = 0 \b, complete main (CM)
|
||||
>5 byte&7 = 1 \b, music and effects (ME)
|
||||
>5 byte&7 = 2 \b, visually impaired (VI)
|
||||
>5 byte&7 = 3 \b, hearing impaired (HI)
|
||||
>5 byte&7 = 4 \b, dialogue (D)
|
||||
>5 byte&7 = 5 \b, commentary (C)
|
||||
>5 byte&7 = 6 \b, emergency (E)
|
||||
# acmod
|
||||
>6 byte&0xe0 0x00 1+1 front,
|
||||
>6 byte&0xe0 0x20 1 front/0 rear,
|
||||
>6 byte&0xe0 0x40 2 front/0 rear,
|
||||
>6 byte&0xe0 0x60 3 front/0 rear,
|
||||
>6 byte&0xe0 0x80 2 front/1 rear,
|
||||
>6 byte&0xe0 0xa0 3 front/1 rear,
|
||||
>6 byte&0xe0 0xc0 2 front/2 rear,
|
||||
>6 byte&0xe0 0xe0 3 front/2 rear,
|
||||
# lfeon (these may be incorrect)
|
||||
>7 byte&0x40 0x00 LFE off,
|
||||
>7 byte&0x40 0x40 LFE on,
|
||||
#
|
||||
>4 byte&0x3e = 0x00 \b, 32 kbit/s
|
||||
>4 byte&0x3e = 0x02 \b, 40 kbit/s
|
||||
>4 byte&0x3e = 0x04 \b, 48 kbit/s
|
||||
>4 byte&0x3e = 0x06 \b, 56 kbit/s
|
||||
>4 byte&0x3e = 0x08 \b, 64 kbit/s
|
||||
>4 byte&0x3e = 0x0a \b, 80 kbit/s
|
||||
>4 byte&0x3e = 0x0c \b, 96 kbit/s
|
||||
>4 byte&0x3e = 0x0e \b, 112 kbit/s
|
||||
>4 byte&0x3e = 0x10 \b, 128 kbit/s
|
||||
>4 byte&0x3e = 0x12 \b, 160 kbit/s
|
||||
>4 byte&0x3e = 0x14 \b, 192 kbit/s
|
||||
>4 byte&0x3e = 0x16 \b, 224 kbit/s
|
||||
>4 byte&0x3e = 0x18 \b, 256 kbit/s
|
||||
>4 byte&0x3e = 0x1a \b, 320 kbit/s
|
||||
>4 byte&0x3e = 0x1c \b, 384 kbit/s
|
||||
>4 byte&0x3e = 0x1e \b, 448 kbit/s
|
||||
>4 byte&0x3e = 0x20 \b, 512 kbit/s
|
||||
>4 byte&0x3e = 0x22 \b, 576 kbit/s
|
||||
>4 byte&0x3e = 0x24 \b, 640 kbit/s
|
||||
# dsurmod (these may be incorrect)
|
||||
>6 beshort&0x0180 0x0000 Dolby Surround not indicated
|
||||
>6 beshort&0x0180 0x0080 not Dolby Surround encoded
|
||||
>6 beshort&0x0180 0x0100 Dolby Surround encoded
|
||||
>6 beshort&0x0180 0x0180 reserved Dolby Surround mode
|
||||
@@ -1,25 +0,0 @@
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# human68k: file(1) magic for Human68k (X680x0 DOS) binary formats
|
||||
|
||||
0 string HU Human68k
|
||||
>68 string LZX LZX compressed
|
||||
>>72 string >\0 (version %s)
|
||||
>(8.L+74) string LZX LZX compressed
|
||||
>>(8.L+78) string >\0 (version %s)
|
||||
>60 belong >0 binded
|
||||
>(8.L+66) string #HUPAIR hupair
|
||||
>0 string HU X executable
|
||||
>(8.L+74) string #LIBCV1 - linked PD LIBC ver 1
|
||||
>4 belong >0 - base address 0x%x
|
||||
>28 belong >0 not stripped
|
||||
>32 belong >0 with debug information
|
||||
0 beshort 0x601a Human68k Z executable
|
||||
0 beshort 0x6000 Human68k object file
|
||||
0 belong 0xd1000000 Human68k ar binary archive
|
||||
0 belong 0xd1010000 Human68k ar ascii archive
|
||||
0 beshort 0x0068 Human68k lib archive
|
||||
4 string LZX Human68k LZX compressed
|
||||
>8 string >\0 (version %s)
|
||||
>4 string LZX R executable
|
||||
2 string #HUPAIR Human68k hupair R executable
|
||||
@@ -1,18 +0,0 @@
|
||||
#------------------------------------------------------------------------------
|
||||
# impulse tracker: file(1) magic for Impulse Tracker data files
|
||||
#
|
||||
# From <[email protected]>
|
||||
# These are the /etc/magic entries to decode modules, instruments, and
|
||||
# samples in Impulse Tracker's native format.
|
||||
|
||||
0 string IMPS Impulse Tracker Sample
|
||||
>18 byte &2 16 bit
|
||||
>18 byte ^2 8 bit
|
||||
>18 byte &4 stereo
|
||||
>18 byte ^4 mono
|
||||
0 string IMPI Impulse Tracker Instrument
|
||||
>28 leshort !0 ITv%x
|
||||
>30 byte !0 %d samples
|
||||
0 string IMPM Impulse Tracker Module
|
||||
>40 leshort !0 compatible w/ITv%x
|
||||
>42 leshort !0 created w/ITv%x
|
||||
@@ -1,7 +0,0 @@
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# mlssa: file(1) magic for MLSSA datafiles
|
||||
#
|
||||
0 lelong 0xffffabcd MLSSA datafile,
|
||||
>4 leshort x algorithm %d,
|
||||
>10 lelong x %d samples
|
||||
@@ -1,23 +0,0 @@
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# natinst: file(1) magic for National Instruments Code Files
|
||||
|
||||
#
|
||||
# From <[email protected]> Enrique Gámez-Flores
|
||||
# version 1
|
||||
# Many formats still missing, we use, for the moment LabVIEW
|
||||
# We guess VXI format file. VISA, LabWindowsCVI, BridgeVIEW, etc, are missing
|
||||
#
|
||||
0 string RSRC National Instruments,
|
||||
# Check if it's a LabVIEW File
|
||||
>8 string LV LabVIEW File,
|
||||
# Check wich kind of file is
|
||||
>>10 string SB Code Resource File, data
|
||||
>>10 string IN Virtual Instrument Program, data
|
||||
>>10 string AR VI Library, data
|
||||
# This is for Menu Libraries
|
||||
>8 string LMNULBVW Portable File Names, data
|
||||
# This is for General Resources
|
||||
>8 string rsc Resources File, data
|
||||
# This is for VXI Package
|
||||
0 string VMAP National Instruments, VXI File, data
|
||||
@@ -1,12 +0,0 @@
|
||||
#------------------------------------------------------------------------------
|
||||
# nitpicker: file(1) magic for Flowfiles.
|
||||
# From: Christian Jachmann <[email protected]> http://www.nitpicker.de
|
||||
0 string NPFF NItpicker Flow File
|
||||
>4 byte x V%d.
|
||||
>5 byte x %d
|
||||
>6 bedate x started: %s
|
||||
>10 bedate x stopped: %s
|
||||
>14 belong x Bytes: %u
|
||||
>18 belong x Bytes1: %u
|
||||
>22 belong x Flows: %u
|
||||
>26 belong x Pkts: %u
|
||||
@@ -1,18 +0,0 @@
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# perl: file(1) magic for Larry Wall's perl language.
|
||||
#
|
||||
# The ``eval'' line recognizes an outrageously clever hack for USG systems.
|
||||
# Keith Waclena <[email protected]>
|
||||
# Send additions to <[email protected]>
|
||||
0 string/b #!\ /bin/perl perl script text executable
|
||||
0 string eval\ "exec\ /bin/perl perl script text
|
||||
0 string/b #!\ /usr/bin/perl perl script text executable
|
||||
0 string eval\ "exec\ /usr/bin/perl perl script text
|
||||
0 string/b #!\ /usr/local/bin/perl perl script text
|
||||
0 string eval\ "exec\ /usr/local/bin/perl perl script text executable
|
||||
|
||||
# a couple more, by me
|
||||
# XXX: christos matches
|
||||
#0 regex package Perl5 module source text (via regex)
|
||||
0 string package Perl5 module source text
|
||||
@@ -1,12 +0,0 @@
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# pulsar: file(1) magic for Pulsar POP3 daemon binary files
|
||||
#
|
||||
# http://pulsar.sourceforge.net
|
||||
# mailto:[email protected]
|
||||
#
|
||||
|
||||
0 belong 0x1ee7f11e Pulsar POP3 daemon mailbox cache file.
|
||||
>4 ubelong x Version: %d.
|
||||
>8 ubelong x \b%d
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
#------------------------------------------------------------------------------
|
||||
# file(1) magic for tgif(1) files
|
||||
# From Hendrik Scholz <[email protected]>
|
||||
|
||||
0 string %TGIF\ 4 tgif version 4 object file
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# VXL: file(1) magic for VXL binary IO data files
|
||||
#
|
||||
# from Ian Scott <[email protected]>
|
||||
#
|
||||
# VXL is a collection of C++ libraries for Computer Vision.
|
||||
# See the vsl chapter in the VXL Book for more info
|
||||
# http://www.isbe.man.ac.uk/public_vxl_doc/books/vxl/book.html
|
||||
# http:/vxl.sf.net
|
||||
|
||||
2 lelong 0x472b2c4e VXL data file,
|
||||
>0 leshort >0 schema version no %d
|
||||
@@ -59,6 +59,8 @@ SM_IDSTR(id, "@(#)$Id: smrsh.c,v 8.58 2002/05/25 02:41:31 ca Exp $")
|
||||
#include <sm/limits.h>
|
||||
#include <sm/string.h>
|
||||
#include <sys/file.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
@@ -147,6 +149,7 @@ main(argc, argv)
|
||||
char *newenv[2];
|
||||
char pathbuf[1000];
|
||||
char specialbuf[32];
|
||||
struct stat st;
|
||||
|
||||
#ifndef DEBUG
|
||||
# ifndef LOG_MAIL
|
||||
@@ -304,6 +307,38 @@ main(argc, argv)
|
||||
(void) sm_io_fprintf(smioout, SM_TIME_DEFAULT,
|
||||
"Trying %s\n", cmdbuf);
|
||||
#endif /* DEBUG */
|
||||
if (stat(cmdbuf, &st) < 0)
|
||||
{
|
||||
/* can't stat it */
|
||||
(void) sm_io_fprintf(smioerr, SM_TIME_DEFAULT,
|
||||
"%s: %s not available for sendmail programs (stat failed)\n",
|
||||
prg, cmd);
|
||||
if (p != NULL)
|
||||
*p = ' ';
|
||||
#ifndef DEBUG
|
||||
syslog(LOG_CRIT, "uid %d: attempt to use %s (stat failed)",
|
||||
(int) getuid(), cmd);
|
||||
#endif /* ! DEBUG */
|
||||
exit(EX_UNAVAILABLE);
|
||||
}
|
||||
if (!S_ISREG(st.st_mode)
|
||||
#ifdef S_ISLNK
|
||||
&& !S_ISLNK(st.st_mode)
|
||||
#endif /* S_ISLNK */
|
||||
)
|
||||
{
|
||||
/* can't stat it */
|
||||
(void) sm_io_fprintf(smioerr, SM_TIME_DEFAULT,
|
||||
"%s: %s not available for sendmail programs (not a file)\n",
|
||||
prg, cmd);
|
||||
if (p != NULL)
|
||||
*p = ' ';
|
||||
#ifndef DEBUG
|
||||
syslog(LOG_CRIT, "uid %d: attempt to use %s (not a file)",
|
||||
(int) getuid(), cmd);
|
||||
#endif /* ! DEBUG */
|
||||
exit(EX_UNAVAILABLE);
|
||||
}
|
||||
if (access(cmdbuf, X_OK) < 0)
|
||||
{
|
||||
/* oops.... crack attack possiblity */
|
||||
|
||||
@@ -1,86 +0,0 @@
|
||||
/* prepend_args.c - utilility programs for manpiulating argv[]
|
||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
02111-1307, USA. */
|
||||
|
||||
/* $FreeBSD$ */
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
#include "cvs.h"
|
||||
#include "prepend_args.h"
|
||||
|
||||
|
||||
/* Find the white-space-separated options specified by OPTIONS, and
|
||||
using BUF to store copies of these options, set ARGV[0], ARGV[1],
|
||||
etc. to the option copies. Return the number N of options found.
|
||||
Do not set ARGV[N] to NULL. If ARGV is NULL, do not store ARGV[0]
|
||||
etc. Backslash can be used to escape whitespace (and backslashes). */
|
||||
static int
|
||||
prepend_args (options, buf, argv)
|
||||
char const *options;
|
||||
char *buf;
|
||||
char **argv;
|
||||
{
|
||||
char const *o = options;
|
||||
char *b = buf;
|
||||
int n = 0;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
while (isspace ((unsigned char) *o))
|
||||
o++;
|
||||
if (!*o)
|
||||
return n;
|
||||
if (argv)
|
||||
argv[n] = b;
|
||||
n++;
|
||||
|
||||
do
|
||||
if ((*b++ = *o++) == '\\' && *o)
|
||||
b[-1] = *o++;
|
||||
while (*o && ! isspace ((unsigned char) *o));
|
||||
|
||||
*b++ = '\0';
|
||||
}
|
||||
}
|
||||
|
||||
/* Prepend the whitespace-separated options in OPTIONS to the argument
|
||||
vector of a main program with argument count *PARGC and argument
|
||||
vector *PARGV. */
|
||||
void
|
||||
prepend_default_options (options, pargc, pargv)
|
||||
char const *options;
|
||||
int *pargc;
|
||||
char ***pargv;
|
||||
{
|
||||
if (options)
|
||||
{
|
||||
char *buf = xmalloc (strlen (options) + 1);
|
||||
int prepended = prepend_args (options, buf, (char **) NULL);
|
||||
int argc = *pargc;
|
||||
char * const *argv = *pargv;
|
||||
char **pp = (char **) xmalloc ((prepended + argc + 1) * sizeof *pp);
|
||||
*pargc = prepended + argc;
|
||||
*pargv = pp;
|
||||
*pp++ = *argv++;
|
||||
pp += prepend_args (options, buf, pp);
|
||||
while ((*pp++ = *argv++))
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
/* prepend_args.h - utilility programs for manpiulating argv[]
|
||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||
02111-1307, USA. */
|
||||
|
||||
/* $FreeBSD$ */
|
||||
|
||||
/* This code, taken from GNU Grep, originally used the "PARAM" macro, as the
|
||||
current GNU coding standards requires. Older GNU code used the "PROTO"
|
||||
macro, before the GNU coding standards replaced it. We use the older
|
||||
form here to keep from having to include another file in cvs/src/main.c. */
|
||||
|
||||
void prepend_default_options PROTO ((char const *, int *, char ***));
|
||||
@@ -52,7 +52,7 @@
|
||||
.ds doc-str-Lb-libvgl Video Graphics Library (libvgl, \-lvgl)
|
||||
.
|
||||
.\" Default .Os value
|
||||
.ds doc-operating-system FreeBSD\~4.6
|
||||
.ds doc-operating-system FreeBSD\~4.7
|
||||
.
|
||||
.\" FreeBSD releases not found in doc-common
|
||||
.ds doc-operating-system-FreeBSD-4.6 4.6
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
# $FreeBSD$
|
||||
|
||||
LIB= sbuf
|
||||
SRCS= subr_sbuf.c
|
||||
WARNS?= 2
|
||||
|
||||
.PATH: ${.CURDIR}/../../sys/kern
|
||||
|
||||
.include <bsd.lib.mk>
|
||||
+1
-1
@@ -25,7 +25,7 @@
|
||||
#
|
||||
# Automatic SNAP versioning:
|
||||
DATE != date +%Y%m%d
|
||||
BASE = 4.6
|
||||
BASE = 4.7
|
||||
BUILDNAME?=${BASE}-${DATE}-STABLE
|
||||
#
|
||||
#CHROOTDIR=/junk/release
|
||||
|
||||
@@ -32,17 +32,6 @@
|
||||
(list (list "HREF" "mailto:[email protected]"))
|
||||
(literal "[email protected]"))
|
||||
(literal ">.")
|
||||
(make element gi: "p"
|
||||
attributes: (list (list "align" "center"))
|
||||
(make element gi: "small"
|
||||
(literal "All users of FreeBSD ")
|
||||
(literal (entity-text "release.branch"))
|
||||
(literal " should subscribe to the ")
|
||||
(literal "<")
|
||||
(create-link (list (list "HREF" "mailto:[email protected]"))
|
||||
(literal "[email protected]"))
|
||||
(literal "> mailing list.")))
|
||||
|
||||
(make element gi: "p"
|
||||
attributes: (list (list "align" "center"))
|
||||
(literal "For questions about this documentation, e-mail <")
|
||||
@@ -71,7 +60,7 @@
|
||||
(("xfree86") (string-append u "&" "manpath=XFree86+4.2.0"))
|
||||
(("netbsd") (string-append u "&" "manpath=NetBSD+1.5"))
|
||||
(("ports") (string-append u "&" "manpath=FreeBSD+Ports"))
|
||||
(else (string-append u "&" "manpath=FreeBSD+4.6-stable")))))
|
||||
(else (string-append u "&" "manpath=FreeBSD+4.7-RELEASE")))))
|
||||
]]>
|
||||
|
||||
(define (toc-depth nd)
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
#
|
||||
# The FreeBSD Documentation Project
|
||||
# The FreeBSD French Documentation Project
|
||||
#
|
||||
# $Id$
|
||||
# $FreeBSD$
|
||||
# Original revision: 1.4
|
||||
|
||||
RELN_ROOT?= ${.CURDIR}/../..
|
||||
|
||||
SUBDIR = alpha
|
||||
SUBDIR+= i386
|
||||
SUBDIR+= pc98
|
||||
SUBDIR+= sparc64
|
||||
|
||||
.include "${RELN_ROOT}/share/mk/doc.relnotes.mk"
|
||||
.include "${DOC_PREFIX}/share/mk/doc.project.mk"
|
||||
@@ -1,13 +0,0 @@
|
||||
#
|
||||
# The FreeBSD Documentation Project
|
||||
# The FreeBSD French Documentation Project
|
||||
#
|
||||
# $Id$
|
||||
# $FreeBSD$
|
||||
# Original revision: 1.2
|
||||
|
||||
.ifdef NO_LANGCODE_IN_DESTDIR
|
||||
DESTDIR?= ${DOCDIR}/hardware/${.CURDIR:T}
|
||||
.else
|
||||
DESTDIR?= ${DOCDIR}/en_US.ISO8859-1/hardware/${.CURDIR:T}
|
||||
.endif
|
||||
@@ -1,26 +0,0 @@
|
||||
#
|
||||
# The FreeBSD Documentation Project
|
||||
# The FreeBSD French Documentation Project
|
||||
#
|
||||
# $Id$
|
||||
# $FreeBSD$
|
||||
# Original revision: 1.6
|
||||
|
||||
RELN_ROOT?= ${.CURDIR}/../../..
|
||||
|
||||
DOC?= article
|
||||
FORMATS?= html
|
||||
INSTALL_COMPRESSED?= gz
|
||||
INSTALL_ONLY_COMPRESSED?=
|
||||
|
||||
JADEFLAGS+= -V %generate-article-toc%
|
||||
|
||||
# SGML content
|
||||
SRCS+= article.sgml
|
||||
SRCS+= proc-alpha.sgml
|
||||
SRCS+= ../common/hw.ent
|
||||
SRCS+= ../common/artheader.sgml
|
||||
SRCS+= ../common/dev.sgml
|
||||
|
||||
.include "${RELN_ROOT}/share/mk/doc.relnotes.mk"
|
||||
.include "${DOC_PREFIX}/share/mk/doc.project.mk"
|
||||
@@ -1,23 +0,0 @@
|
||||
<!--
|
||||
The FreeBSD Documentation Project
|
||||
The FreeBSD French Documentation Project
|
||||
|
||||
$Id$
|
||||
$FreeBSD$
|
||||
Original revision: 1.3
|
||||
-->
|
||||
|
||||
|
||||
<articleinfo>
|
||||
<title>&os;/&arch; &release.current; compatibilité
|
||||
matérielle</title>
|
||||
|
||||
<corpauthor>Le projet de documentation FreeBSD</corpauthor>
|
||||
|
||||
<copyright>
|
||||
<year>2000</year>
|
||||
<year>2001</year>
|
||||
<year>2002</year>
|
||||
<holder role="mailto:[email protected]">Le projet de documentation FreeBSD</holder>
|
||||
</copyright>
|
||||
</articleinfo>
|
||||
@@ -1,23 +0,0 @@
|
||||
<!--
|
||||
The FreeBSD Documentation Project
|
||||
The FreeBSD French Documentation Project
|
||||
|
||||
$Id$
|
||||
$FreeBSD$
|
||||
Original revision: 1.4
|
||||
-->
|
||||
<!-- -*- sgml -*- -->
|
||||
|
||||
<!-- Text constants which probably don't need to be changed.-->
|
||||
|
||||
<!-- Files to be included -->
|
||||
|
||||
<!ENTITY artheader SYSTEM "../common/artheader.sgml">
|
||||
<!ENTITY sect.intro SYSTEM "../common/intro.sgml">
|
||||
<!ENTITY sect.proc.alpha SYSTEM "../alpha/proc-alpha.sgml">
|
||||
<!ENTITY sect.proc.i386 SYSTEM "../i386/proc-i386.sgml">
|
||||
<!ENTITY sect.proc.ia64 SYSTEM "../ia64/proc-ia64.sgml">
|
||||
<!ENTITY sect.proc.pc98 SYSTEM "../pc98/proc-pc98.sgml">
|
||||
<!ENTITY sect.proc.sparc64 SYSTEM "../sparc64/proc-sparc64.sgml">
|
||||
<!ENTITY sect.dev SYSTEM "../common/dev.sgml">
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
<!--
|
||||
The FreeBSD Documentation Project
|
||||
The FreeBSD French Documentation Project
|
||||
|
||||
$Id$
|
||||
$FreeBSD$
|
||||
Original revision: 1.3
|
||||
-->
|
||||
|
||||
<sect1>
|
||||
<title>Introduction</title>
|
||||
|
||||
<para>Ce document contient la liste de matériel compatible avec
|
||||
&os; &release.current; sur la plateforme matérielle &arch.print;
|
||||
(dont on fait souvent référence comme &os;/&arch;
|
||||
&release.current;). Il liste les périphériques connus pour
|
||||
fonctionner sur cette plate-forme, tout comme certaines notes sur la
|
||||
configuration du noyau au moment du démarrage, qui peuvent etre
|
||||
utiles lorsque l'on veut configurer certains nouveaux
|
||||
périphériques.</para>
|
||||
|
||||
<note>
|
||||
<para>Ce document inclue des informations spécifique à
|
||||
l'architecture matérielle &arch.print;. Les versions de ces notes
|
||||
de compatibilité matérielle pour d'autres architectures
|
||||
peuvent comporter des différences.</para>
|
||||
</note>
|
||||
</sect1>
|
||||
@@ -1,26 +0,0 @@
|
||||
#
|
||||
# The FreeBSD Documentation Project
|
||||
# The FreeBSD French Documentation Project
|
||||
#
|
||||
# $Id$
|
||||
# $FreeBSD$
|
||||
# Original revision: 1.5
|
||||
|
||||
RELN_ROOT?= ${.CURDIR}/../../..
|
||||
|
||||
DOC?= article
|
||||
FORMATS?= html
|
||||
INSTALL_COMPRESSED?= gz
|
||||
INSTALL_ONLY_COMPRESSED?=
|
||||
|
||||
JADEFLAGS+= -V %generate-article-toc%
|
||||
|
||||
# SGML content
|
||||
SRCS+= article.sgml
|
||||
SRCS+= proc-i386.sgml
|
||||
SRCS+= ../common/hw.ent
|
||||
SRCS+= ../common/artheader.sgml
|
||||
SRCS+= ../common/dev.sgml
|
||||
|
||||
.include "${RELN_ROOT}/share/mk/doc.relnotes.mk"
|
||||
.include "${DOC_PREFIX}/share/mk/doc.project.mk"
|
||||
@@ -12,7 +12,7 @@ UNITEXTS= readme errata
|
||||
|
||||
IMAGEDIR= .imagedir
|
||||
RHOST= freefall.freebsd.org
|
||||
RDIR= public_html/relnotes/4-STABLE
|
||||
RDIR= public_html/relnotes/4.7-RELEASE
|
||||
DOCDIR= ./release/doc
|
||||
LANG= en_US.ISO8859-1
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
<!-- Version of the OS we're describing. This needs to be updated
|
||||
with each new release. -->
|
||||
<!ENTITY release.current "4.7-RC">
|
||||
<!ENTITY release.current "4.7-RELEASE">
|
||||
|
||||
<!-- The previous version used for comparison in the "What's New"
|
||||
section. For -CURRENT, we might point back to the last
|
||||
@@ -14,19 +14,19 @@
|
||||
<!ENTITY release.prev "4.6-RELEASE">
|
||||
|
||||
<!-- The next version to be released, usually used for snapshots. -->
|
||||
<!ENTITY release.next "4.7-RELEASE">
|
||||
<!ENTITY release.next "4.8-RELEASE">
|
||||
|
||||
<!-- The name of this branch. -->
|
||||
<!ENTITY release.branch "4-STABLE">
|
||||
|
||||
<!-- The URL for obtaining this version of FreeBSD. -->
|
||||
<!ENTITY release.url "http://snapshots.jp.FreeBSD.org/">
|
||||
<!ENTITY release.url "ftp://ftp.FreeBSD.org/">
|
||||
|
||||
<!-- The type of release (usually this will be either "snapshot"
|
||||
or "release" -->
|
||||
<!ENTITY release.type "snapshot">
|
||||
<!ENTITY % release.type.snapshot "INCLUDE">
|
||||
<!ENTITY % release.type.release "IGNORE">
|
||||
<!ENTITY release.type "release">
|
||||
<!ENTITY % release.type.snapshot "IGNORE">
|
||||
<!ENTITY % release.type.release "INCLUDE">
|
||||
|
||||
<!-- Text constants which probably don't need to be changed.-->
|
||||
|
||||
|
||||
@@ -1,932 +0,0 @@
|
||||
# $FreeBSD$
|
||||
# Dont even think of reading this code
|
||||
# It was automatically generated by bf-586.pl
|
||||
# Which is a perl program used to generate the x86 assember for
|
||||
# any of elf, a.out, BSDI, Win32, gaswin (for GNU as on Win32) or Solaris
|
||||
# eric <eay@cryptsoft.com>
|
||||
|
||||
.file "bf-586.s"
|
||||
.version "01.01"
|
||||
gcc2_compiled.:
|
||||
.text
|
||||
.align 16
|
||||
.globl BF_encrypt
|
||||
.type BF_encrypt,@function
|
||||
BF_encrypt:
|
||||
|
||||
pushl %ebp
|
||||
pushl %ebx
|
||||
movl 12(%esp), %ebx
|
||||
movl 16(%esp), %ebp
|
||||
pushl %esi
|
||||
pushl %edi
|
||||
# Load the 2 words
|
||||
movl (%ebx), %edi
|
||||
movl 4(%ebx), %esi
|
||||
xorl %eax, %eax
|
||||
movl (%ebp), %ebx
|
||||
xorl %ecx, %ecx
|
||||
xorl %ebx, %edi
|
||||
|
||||
# Round 0
|
||||
movl 4(%ebp), %edx
|
||||
movl %edi, %ebx
|
||||
xorl %edx, %esi
|
||||
shrl $16, %ebx
|
||||
movl %edi, %edx
|
||||
movb %bh, %al
|
||||
andl $255, %ebx
|
||||
movb %dh, %cl
|
||||
andl $255, %edx
|
||||
movl 72(%ebp,%eax,4),%eax
|
||||
movl 1096(%ebp,%ebx,4),%ebx
|
||||
addl %eax, %ebx
|
||||
movl 2120(%ebp,%ecx,4),%eax
|
||||
xorl %eax, %ebx
|
||||
movl 3144(%ebp,%edx,4),%edx
|
||||
addl %edx, %ebx
|
||||
xorl %eax, %eax
|
||||
xorl %ebx, %esi
|
||||
|
||||
# Round 1
|
||||
movl 8(%ebp), %edx
|
||||
movl %esi, %ebx
|
||||
xorl %edx, %edi
|
||||
shrl $16, %ebx
|
||||
movl %esi, %edx
|
||||
movb %bh, %al
|
||||
andl $255, %ebx
|
||||
movb %dh, %cl
|
||||
andl $255, %edx
|
||||
movl 72(%ebp,%eax,4),%eax
|
||||
movl 1096(%ebp,%ebx,4),%ebx
|
||||
addl %eax, %ebx
|
||||
movl 2120(%ebp,%ecx,4),%eax
|
||||
xorl %eax, %ebx
|
||||
movl 3144(%ebp,%edx,4),%edx
|
||||
addl %edx, %ebx
|
||||
xorl %eax, %eax
|
||||
xorl %ebx, %edi
|
||||
|
||||
# Round 2
|
||||
movl 12(%ebp), %edx
|
||||
movl %edi, %ebx
|
||||
xorl %edx, %esi
|
||||
shrl $16, %ebx
|
||||
movl %edi, %edx
|
||||
movb %bh, %al
|
||||
andl $255, %ebx
|
||||
movb %dh, %cl
|
||||
andl $255, %edx
|
||||
movl 72(%ebp,%eax,4),%eax
|
||||
movl 1096(%ebp,%ebx,4),%ebx
|
||||
addl %eax, %ebx
|
||||
movl 2120(%ebp,%ecx,4),%eax
|
||||
xorl %eax, %ebx
|
||||
movl 3144(%ebp,%edx,4),%edx
|
||||
addl %edx, %ebx
|
||||
xorl %eax, %eax
|
||||
xorl %ebx, %esi
|
||||
|
||||
# Round 3
|
||||
movl 16(%ebp), %edx
|
||||
movl %esi, %ebx
|
||||
xorl %edx, %edi
|
||||
shrl $16, %ebx
|
||||
movl %esi, %edx
|
||||
movb %bh, %al
|
||||
andl $255, %ebx
|
||||
movb %dh, %cl
|
||||
andl $255, %edx
|
||||
movl 72(%ebp,%eax,4),%eax
|
||||
movl 1096(%ebp,%ebx,4),%ebx
|
||||
addl %eax, %ebx
|
||||
movl 2120(%ebp,%ecx,4),%eax
|
||||
xorl %eax, %ebx
|
||||
movl 3144(%ebp,%edx,4),%edx
|
||||
addl %edx, %ebx
|
||||
xorl %eax, %eax
|
||||
xorl %ebx, %edi
|
||||
|
||||
# Round 4
|
||||
movl 20(%ebp), %edx
|
||||
movl %edi, %ebx
|
||||
xorl %edx, %esi
|
||||
shrl $16, %ebx
|
||||
movl %edi, %edx
|
||||
movb %bh, %al
|
||||
andl $255, %ebx
|
||||
movb %dh, %cl
|
||||
andl $255, %edx
|
||||
movl 72(%ebp,%eax,4),%eax
|
||||
movl 1096(%ebp,%ebx,4),%ebx
|
||||
addl %eax, %ebx
|
||||
movl 2120(%ebp,%ecx,4),%eax
|
||||
xorl %eax, %ebx
|
||||
movl 3144(%ebp,%edx,4),%edx
|
||||
addl %edx, %ebx
|
||||
xorl %eax, %eax
|
||||
xorl %ebx, %esi
|
||||
|
||||
# Round 5
|
||||
movl 24(%ebp), %edx
|
||||
movl %esi, %ebx
|
||||
xorl %edx, %edi
|
||||
shrl $16, %ebx
|
||||
movl %esi, %edx
|
||||
movb %bh, %al
|
||||
andl $255, %ebx
|
||||
movb %dh, %cl
|
||||
andl $255, %edx
|
||||
movl 72(%ebp,%eax,4),%eax
|
||||
movl 1096(%ebp,%ebx,4),%ebx
|
||||
addl %eax, %ebx
|
||||
movl 2120(%ebp,%ecx,4),%eax
|
||||
xorl %eax, %ebx
|
||||
movl 3144(%ebp,%edx,4),%edx
|
||||
addl %edx, %ebx
|
||||
xorl %eax, %eax
|
||||
xorl %ebx, %edi
|
||||
|
||||
# Round 6
|
||||
movl 28(%ebp), %edx
|
||||
movl %edi, %ebx
|
||||
xorl %edx, %esi
|
||||
shrl $16, %ebx
|
||||
movl %edi, %edx
|
||||
movb %bh, %al
|
||||
andl $255, %ebx
|
||||
movb %dh, %cl
|
||||
andl $255, %edx
|
||||
movl 72(%ebp,%eax,4),%eax
|
||||
movl 1096(%ebp,%ebx,4),%ebx
|
||||
addl %eax, %ebx
|
||||
movl 2120(%ebp,%ecx,4),%eax
|
||||
xorl %eax, %ebx
|
||||
movl 3144(%ebp,%edx,4),%edx
|
||||
addl %edx, %ebx
|
||||
xorl %eax, %eax
|
||||
xorl %ebx, %esi
|
||||
|
||||
# Round 7
|
||||
movl 32(%ebp), %edx
|
||||
movl %esi, %ebx
|
||||
xorl %edx, %edi
|
||||
shrl $16, %ebx
|
||||
movl %esi, %edx
|
||||
movb %bh, %al
|
||||
andl $255, %ebx
|
||||
movb %dh, %cl
|
||||
andl $255, %edx
|
||||
movl 72(%ebp,%eax,4),%eax
|
||||
movl 1096(%ebp,%ebx,4),%ebx
|
||||
addl %eax, %ebx
|
||||
movl 2120(%ebp,%ecx,4),%eax
|
||||
xorl %eax, %ebx
|
||||
movl 3144(%ebp,%edx,4),%edx
|
||||
addl %edx, %ebx
|
||||
xorl %eax, %eax
|
||||
xorl %ebx, %edi
|
||||
|
||||
# Round 8
|
||||
movl 36(%ebp), %edx
|
||||
movl %edi, %ebx
|
||||
xorl %edx, %esi
|
||||
shrl $16, %ebx
|
||||
movl %edi, %edx
|
||||
movb %bh, %al
|
||||
andl $255, %ebx
|
||||
movb %dh, %cl
|
||||
andl $255, %edx
|
||||
movl 72(%ebp,%eax,4),%eax
|
||||
movl 1096(%ebp,%ebx,4),%ebx
|
||||
addl %eax, %ebx
|
||||
movl 2120(%ebp,%ecx,4),%eax
|
||||
xorl %eax, %ebx
|
||||
movl 3144(%ebp,%edx,4),%edx
|
||||
addl %edx, %ebx
|
||||
xorl %eax, %eax
|
||||
xorl %ebx, %esi
|
||||
|
||||
# Round 9
|
||||
movl 40(%ebp), %edx
|
||||
movl %esi, %ebx
|
||||
xorl %edx, %edi
|
||||
shrl $16, %ebx
|
||||
movl %esi, %edx
|
||||
movb %bh, %al
|
||||
andl $255, %ebx
|
||||
movb %dh, %cl
|
||||
andl $255, %edx
|
||||
movl 72(%ebp,%eax,4),%eax
|
||||
movl 1096(%ebp,%ebx,4),%ebx
|
||||
addl %eax, %ebx
|
||||
movl 2120(%ebp,%ecx,4),%eax
|
||||
xorl %eax, %ebx
|
||||
movl 3144(%ebp,%edx,4),%edx
|
||||
addl %edx, %ebx
|
||||
xorl %eax, %eax
|
||||
xorl %ebx, %edi
|
||||
|
||||
# Round 10
|
||||
movl 44(%ebp), %edx
|
||||
movl %edi, %ebx
|
||||
xorl %edx, %esi
|
||||
shrl $16, %ebx
|
||||
movl %edi, %edx
|
||||
movb %bh, %al
|
||||
andl $255, %ebx
|
||||
movb %dh, %cl
|
||||
andl $255, %edx
|
||||
movl 72(%ebp,%eax,4),%eax
|
||||
movl 1096(%ebp,%ebx,4),%ebx
|
||||
addl %eax, %ebx
|
||||
movl 2120(%ebp,%ecx,4),%eax
|
||||
xorl %eax, %ebx
|
||||
movl 3144(%ebp,%edx,4),%edx
|
||||
addl %edx, %ebx
|
||||
xorl %eax, %eax
|
||||
xorl %ebx, %esi
|
||||
|
||||
# Round 11
|
||||
movl 48(%ebp), %edx
|
||||
movl %esi, %ebx
|
||||
xorl %edx, %edi
|
||||
shrl $16, %ebx
|
||||
movl %esi, %edx
|
||||
movb %bh, %al
|
||||
andl $255, %ebx
|
||||
movb %dh, %cl
|
||||
andl $255, %edx
|
||||
movl 72(%ebp,%eax,4),%eax
|
||||
movl 1096(%ebp,%ebx,4),%ebx
|
||||
addl %eax, %ebx
|
||||
movl 2120(%ebp,%ecx,4),%eax
|
||||
xorl %eax, %ebx
|
||||
movl 3144(%ebp,%edx,4),%edx
|
||||
addl %edx, %ebx
|
||||
xorl %eax, %eax
|
||||
xorl %ebx, %edi
|
||||
|
||||
# Round 12
|
||||
movl 52(%ebp), %edx
|
||||
movl %edi, %ebx
|
||||
xorl %edx, %esi
|
||||
shrl $16, %ebx
|
||||
movl %edi, %edx
|
||||
movb %bh, %al
|
||||
andl $255, %ebx
|
||||
movb %dh, %cl
|
||||
andl $255, %edx
|
||||
movl 72(%ebp,%eax,4),%eax
|
||||
movl 1096(%ebp,%ebx,4),%ebx
|
||||
addl %eax, %ebx
|
||||
movl 2120(%ebp,%ecx,4),%eax
|
||||
xorl %eax, %ebx
|
||||
movl 3144(%ebp,%edx,4),%edx
|
||||
addl %edx, %ebx
|
||||
xorl %eax, %eax
|
||||
xorl %ebx, %esi
|
||||
|
||||
# Round 13
|
||||
movl 56(%ebp), %edx
|
||||
movl %esi, %ebx
|
||||
xorl %edx, %edi
|
||||
shrl $16, %ebx
|
||||
movl %esi, %edx
|
||||
movb %bh, %al
|
||||
andl $255, %ebx
|
||||
movb %dh, %cl
|
||||
andl $255, %edx
|
||||
movl 72(%ebp,%eax,4),%eax
|
||||
movl 1096(%ebp,%ebx,4),%ebx
|
||||
addl %eax, %ebx
|
||||
movl 2120(%ebp,%ecx,4),%eax
|
||||
xorl %eax, %ebx
|
||||
movl 3144(%ebp,%edx,4),%edx
|
||||
addl %edx, %ebx
|
||||
xorl %eax, %eax
|
||||
xorl %ebx, %edi
|
||||
|
||||
# Round 14
|
||||
movl 60(%ebp), %edx
|
||||
movl %edi, %ebx
|
||||
xorl %edx, %esi
|
||||
shrl $16, %ebx
|
||||
movl %edi, %edx
|
||||
movb %bh, %al
|
||||
andl $255, %ebx
|
||||
movb %dh, %cl
|
||||
andl $255, %edx
|
||||
movl 72(%ebp,%eax,4),%eax
|
||||
movl 1096(%ebp,%ebx,4),%ebx
|
||||
addl %eax, %ebx
|
||||
movl 2120(%ebp,%ecx,4),%eax
|
||||
xorl %eax, %ebx
|
||||
movl 3144(%ebp,%edx,4),%edx
|
||||
addl %edx, %ebx
|
||||
xorl %eax, %eax
|
||||
xorl %ebx, %esi
|
||||
|
||||
# Round 15
|
||||
movl 64(%ebp), %edx
|
||||
movl %esi, %ebx
|
||||
xorl %edx, %edi
|
||||
shrl $16, %ebx
|
||||
movl %esi, %edx
|
||||
movb %bh, %al
|
||||
andl $255, %ebx
|
||||
movb %dh, %cl
|
||||
andl $255, %edx
|
||||
movl 72(%ebp,%eax,4),%eax
|
||||
movl 1096(%ebp,%ebx,4),%ebx
|
||||
addl %eax, %ebx
|
||||
movl 2120(%ebp,%ecx,4),%eax
|
||||
xorl %eax, %ebx
|
||||
movl 3144(%ebp,%edx,4),%edx
|
||||
addl %edx, %ebx
|
||||
# Load parameter 0 (16) enc=1
|
||||
movl 20(%esp), %eax
|
||||
xorl %ebx, %edi
|
||||
movl 68(%ebp), %edx
|
||||
xorl %edx, %esi
|
||||
movl %edi, 4(%eax)
|
||||
movl %esi, (%eax)
|
||||
popl %edi
|
||||
popl %esi
|
||||
popl %ebx
|
||||
popl %ebp
|
||||
ret
|
||||
.BF_encrypt_end:
|
||||
.size BF_encrypt,.BF_encrypt_end-BF_encrypt
|
||||
.ident "BF_encrypt"
|
||||
.text
|
||||
.align 16
|
||||
.globl BF_decrypt
|
||||
.type BF_decrypt,@function
|
||||
BF_decrypt:
|
||||
|
||||
pushl %ebp
|
||||
pushl %ebx
|
||||
movl 12(%esp), %ebx
|
||||
movl 16(%esp), %ebp
|
||||
pushl %esi
|
||||
pushl %edi
|
||||
# Load the 2 words
|
||||
movl (%ebx), %edi
|
||||
movl 4(%ebx), %esi
|
||||
xorl %eax, %eax
|
||||
movl 68(%ebp), %ebx
|
||||
xorl %ecx, %ecx
|
||||
xorl %ebx, %edi
|
||||
|
||||
# Round 16
|
||||
movl 64(%ebp), %edx
|
||||
movl %edi, %ebx
|
||||
xorl %edx, %esi
|
||||
shrl $16, %ebx
|
||||
movl %edi, %edx
|
||||
movb %bh, %al
|
||||
andl $255, %ebx
|
||||
movb %dh, %cl
|
||||
andl $255, %edx
|
||||
movl 72(%ebp,%eax,4),%eax
|
||||
movl 1096(%ebp,%ebx,4),%ebx
|
||||
addl %eax, %ebx
|
||||
movl 2120(%ebp,%ecx,4),%eax
|
||||
xorl %eax, %ebx
|
||||
movl 3144(%ebp,%edx,4),%edx
|
||||
addl %edx, %ebx
|
||||
xorl %eax, %eax
|
||||
xorl %ebx, %esi
|
||||
|
||||
# Round 15
|
||||
movl 60(%ebp), %edx
|
||||
movl %esi, %ebx
|
||||
xorl %edx, %edi
|
||||
shrl $16, %ebx
|
||||
movl %esi, %edx
|
||||
movb %bh, %al
|
||||
andl $255, %ebx
|
||||
movb %dh, %cl
|
||||
andl $255, %edx
|
||||
movl 72(%ebp,%eax,4),%eax
|
||||
movl 1096(%ebp,%ebx,4),%ebx
|
||||
addl %eax, %ebx
|
||||
movl 2120(%ebp,%ecx,4),%eax
|
||||
xorl %eax, %ebx
|
||||
movl 3144(%ebp,%edx,4),%edx
|
||||
addl %edx, %ebx
|
||||
xorl %eax, %eax
|
||||
xorl %ebx, %edi
|
||||
|
||||
# Round 14
|
||||
movl 56(%ebp), %edx
|
||||
movl %edi, %ebx
|
||||
xorl %edx, %esi
|
||||
shrl $16, %ebx
|
||||
movl %edi, %edx
|
||||
movb %bh, %al
|
||||
andl $255, %ebx
|
||||
movb %dh, %cl
|
||||
andl $255, %edx
|
||||
movl 72(%ebp,%eax,4),%eax
|
||||
movl 1096(%ebp,%ebx,4),%ebx
|
||||
addl %eax, %ebx
|
||||
movl 2120(%ebp,%ecx,4),%eax
|
||||
xorl %eax, %ebx
|
||||
movl 3144(%ebp,%edx,4),%edx
|
||||
addl %edx, %ebx
|
||||
xorl %eax, %eax
|
||||
xorl %ebx, %esi
|
||||
|
||||
# Round 13
|
||||
movl 52(%ebp), %edx
|
||||
movl %esi, %ebx
|
||||
xorl %edx, %edi
|
||||
shrl $16, %ebx
|
||||
movl %esi, %edx
|
||||
movb %bh, %al
|
||||
andl $255, %ebx
|
||||
movb %dh, %cl
|
||||
andl $255, %edx
|
||||
movl 72(%ebp,%eax,4),%eax
|
||||
movl 1096(%ebp,%ebx,4),%ebx
|
||||
addl %eax, %ebx
|
||||
movl 2120(%ebp,%ecx,4),%eax
|
||||
xorl %eax, %ebx
|
||||
movl 3144(%ebp,%edx,4),%edx
|
||||
addl %edx, %ebx
|
||||
xorl %eax, %eax
|
||||
xorl %ebx, %edi
|
||||
|
||||
# Round 12
|
||||
movl 48(%ebp), %edx
|
||||
movl %edi, %ebx
|
||||
xorl %edx, %esi
|
||||
shrl $16, %ebx
|
||||
movl %edi, %edx
|
||||
movb %bh, %al
|
||||
andl $255, %ebx
|
||||
movb %dh, %cl
|
||||
andl $255, %edx
|
||||
movl 72(%ebp,%eax,4),%eax
|
||||
movl 1096(%ebp,%ebx,4),%ebx
|
||||
addl %eax, %ebx
|
||||
movl 2120(%ebp,%ecx,4),%eax
|
||||
xorl %eax, %ebx
|
||||
movl 3144(%ebp,%edx,4),%edx
|
||||
addl %edx, %ebx
|
||||
xorl %eax, %eax
|
||||
xorl %ebx, %esi
|
||||
|
||||
# Round 11
|
||||
movl 44(%ebp), %edx
|
||||
movl %esi, %ebx
|
||||
xorl %edx, %edi
|
||||
shrl $16, %ebx
|
||||
movl %esi, %edx
|
||||
movb %bh, %al
|
||||
andl $255, %ebx
|
||||
movb %dh, %cl
|
||||
andl $255, %edx
|
||||
movl 72(%ebp,%eax,4),%eax
|
||||
movl 1096(%ebp,%ebx,4),%ebx
|
||||
addl %eax, %ebx
|
||||
movl 2120(%ebp,%ecx,4),%eax
|
||||
xorl %eax, %ebx
|
||||
movl 3144(%ebp,%edx,4),%edx
|
||||
addl %edx, %ebx
|
||||
xorl %eax, %eax
|
||||
xorl %ebx, %edi
|
||||
|
||||
# Round 10
|
||||
movl 40(%ebp), %edx
|
||||
movl %edi, %ebx
|
||||
xorl %edx, %esi
|
||||
shrl $16, %ebx
|
||||
movl %edi, %edx
|
||||
movb %bh, %al
|
||||
andl $255, %ebx
|
||||
movb %dh, %cl
|
||||
andl $255, %edx
|
||||
movl 72(%ebp,%eax,4),%eax
|
||||
movl 1096(%ebp,%ebx,4),%ebx
|
||||
addl %eax, %ebx
|
||||
movl 2120(%ebp,%ecx,4),%eax
|
||||
xorl %eax, %ebx
|
||||
movl 3144(%ebp,%edx,4),%edx
|
||||
addl %edx, %ebx
|
||||
xorl %eax, %eax
|
||||
xorl %ebx, %esi
|
||||
|
||||
# Round 9
|
||||
movl 36(%ebp), %edx
|
||||
movl %esi, %ebx
|
||||
xorl %edx, %edi
|
||||
shrl $16, %ebx
|
||||
movl %esi, %edx
|
||||
movb %bh, %al
|
||||
andl $255, %ebx
|
||||
movb %dh, %cl
|
||||
andl $255, %edx
|
||||
movl 72(%ebp,%eax,4),%eax
|
||||
movl 1096(%ebp,%ebx,4),%ebx
|
||||
addl %eax, %ebx
|
||||
movl 2120(%ebp,%ecx,4),%eax
|
||||
xorl %eax, %ebx
|
||||
movl 3144(%ebp,%edx,4),%edx
|
||||
addl %edx, %ebx
|
||||
xorl %eax, %eax
|
||||
xorl %ebx, %edi
|
||||
|
||||
# Round 8
|
||||
movl 32(%ebp), %edx
|
||||
movl %edi, %ebx
|
||||
xorl %edx, %esi
|
||||
shrl $16, %ebx
|
||||
movl %edi, %edx
|
||||
movb %bh, %al
|
||||
andl $255, %ebx
|
||||
movb %dh, %cl
|
||||
andl $255, %edx
|
||||
movl 72(%ebp,%eax,4),%eax
|
||||
movl 1096(%ebp,%ebx,4),%ebx
|
||||
addl %eax, %ebx
|
||||
movl 2120(%ebp,%ecx,4),%eax
|
||||
xorl %eax, %ebx
|
||||
movl 3144(%ebp,%edx,4),%edx
|
||||
addl %edx, %ebx
|
||||
xorl %eax, %eax
|
||||
xorl %ebx, %esi
|
||||
|
||||
# Round 7
|
||||
movl 28(%ebp), %edx
|
||||
movl %esi, %ebx
|
||||
xorl %edx, %edi
|
||||
shrl $16, %ebx
|
||||
movl %esi, %edx
|
||||
movb %bh, %al
|
||||
andl $255, %ebx
|
||||
movb %dh, %cl
|
||||
andl $255, %edx
|
||||
movl 72(%ebp,%eax,4),%eax
|
||||
movl 1096(%ebp,%ebx,4),%ebx
|
||||
addl %eax, %ebx
|
||||
movl 2120(%ebp,%ecx,4),%eax
|
||||
xorl %eax, %ebx
|
||||
movl 3144(%ebp,%edx,4),%edx
|
||||
addl %edx, %ebx
|
||||
xorl %eax, %eax
|
||||
xorl %ebx, %edi
|
||||
|
||||
# Round 6
|
||||
movl 24(%ebp), %edx
|
||||
movl %edi, %ebx
|
||||
xorl %edx, %esi
|
||||
shrl $16, %ebx
|
||||
movl %edi, %edx
|
||||
movb %bh, %al
|
||||
andl $255, %ebx
|
||||
movb %dh, %cl
|
||||
andl $255, %edx
|
||||
movl 72(%ebp,%eax,4),%eax
|
||||
movl 1096(%ebp,%ebx,4),%ebx
|
||||
addl %eax, %ebx
|
||||
movl 2120(%ebp,%ecx,4),%eax
|
||||
xorl %eax, %ebx
|
||||
movl 3144(%ebp,%edx,4),%edx
|
||||
addl %edx, %ebx
|
||||
xorl %eax, %eax
|
||||
xorl %ebx, %esi
|
||||
|
||||
# Round 5
|
||||
movl 20(%ebp), %edx
|
||||
movl %esi, %ebx
|
||||
xorl %edx, %edi
|
||||
shrl $16, %ebx
|
||||
movl %esi, %edx
|
||||
movb %bh, %al
|
||||
andl $255, %ebx
|
||||
movb %dh, %cl
|
||||
andl $255, %edx
|
||||
movl 72(%ebp,%eax,4),%eax
|
||||
movl 1096(%ebp,%ebx,4),%ebx
|
||||
addl %eax, %ebx
|
||||
movl 2120(%ebp,%ecx,4),%eax
|
||||
xorl %eax, %ebx
|
||||
movl 3144(%ebp,%edx,4),%edx
|
||||
addl %edx, %ebx
|
||||
xorl %eax, %eax
|
||||
xorl %ebx, %edi
|
||||
|
||||
# Round 4
|
||||
movl 16(%ebp), %edx
|
||||
movl %edi, %ebx
|
||||
xorl %edx, %esi
|
||||
shrl $16, %ebx
|
||||
movl %edi, %edx
|
||||
movb %bh, %al
|
||||
andl $255, %ebx
|
||||
movb %dh, %cl
|
||||
andl $255, %edx
|
||||
movl 72(%ebp,%eax,4),%eax
|
||||
movl 1096(%ebp,%ebx,4),%ebx
|
||||
addl %eax, %ebx
|
||||
movl 2120(%ebp,%ecx,4),%eax
|
||||
xorl %eax, %ebx
|
||||
movl 3144(%ebp,%edx,4),%edx
|
||||
addl %edx, %ebx
|
||||
xorl %eax, %eax
|
||||
xorl %ebx, %esi
|
||||
|
||||
# Round 3
|
||||
movl 12(%ebp), %edx
|
||||
movl %esi, %ebx
|
||||
xorl %edx, %edi
|
||||
shrl $16, %ebx
|
||||
movl %esi, %edx
|
||||
movb %bh, %al
|
||||
andl $255, %ebx
|
||||
movb %dh, %cl
|
||||
andl $255, %edx
|
||||
movl 72(%ebp,%eax,4),%eax
|
||||
movl 1096(%ebp,%ebx,4),%ebx
|
||||
addl %eax, %ebx
|
||||
movl 2120(%ebp,%ecx,4),%eax
|
||||
xorl %eax, %ebx
|
||||
movl 3144(%ebp,%edx,4),%edx
|
||||
addl %edx, %ebx
|
||||
xorl %eax, %eax
|
||||
xorl %ebx, %edi
|
||||
|
||||
# Round 2
|
||||
movl 8(%ebp), %edx
|
||||
movl %edi, %ebx
|
||||
xorl %edx, %esi
|
||||
shrl $16, %ebx
|
||||
movl %edi, %edx
|
||||
movb %bh, %al
|
||||
andl $255, %ebx
|
||||
movb %dh, %cl
|
||||
andl $255, %edx
|
||||
movl 72(%ebp,%eax,4),%eax
|
||||
movl 1096(%ebp,%ebx,4),%ebx
|
||||
addl %eax, %ebx
|
||||
movl 2120(%ebp,%ecx,4),%eax
|
||||
xorl %eax, %ebx
|
||||
movl 3144(%ebp,%edx,4),%edx
|
||||
addl %edx, %ebx
|
||||
xorl %eax, %eax
|
||||
xorl %ebx, %esi
|
||||
|
||||
# Round 1
|
||||
movl 4(%ebp), %edx
|
||||
movl %esi, %ebx
|
||||
xorl %edx, %edi
|
||||
shrl $16, %ebx
|
||||
movl %esi, %edx
|
||||
movb %bh, %al
|
||||
andl $255, %ebx
|
||||
movb %dh, %cl
|
||||
andl $255, %edx
|
||||
movl 72(%ebp,%eax,4),%eax
|
||||
movl 1096(%ebp,%ebx,4),%ebx
|
||||
addl %eax, %ebx
|
||||
movl 2120(%ebp,%ecx,4),%eax
|
||||
xorl %eax, %ebx
|
||||
movl 3144(%ebp,%edx,4),%edx
|
||||
addl %edx, %ebx
|
||||
# Load parameter 0 (1) enc=0
|
||||
movl 20(%esp), %eax
|
||||
xorl %ebx, %edi
|
||||
movl (%ebp), %edx
|
||||
xorl %edx, %esi
|
||||
movl %edi, 4(%eax)
|
||||
movl %esi, (%eax)
|
||||
popl %edi
|
||||
popl %esi
|
||||
popl %ebx
|
||||
popl %ebp
|
||||
ret
|
||||
.BF_decrypt_end:
|
||||
.size BF_decrypt,.BF_decrypt_end-BF_decrypt
|
||||
.ident "BF_decrypt"
|
||||
.text
|
||||
.align 16
|
||||
.globl BF_cbc_encrypt
|
||||
.type BF_cbc_encrypt,@function
|
||||
BF_cbc_encrypt:
|
||||
|
||||
pushl %ebp
|
||||
pushl %ebx
|
||||
pushl %esi
|
||||
pushl %edi
|
||||
movl 28(%esp), %ebp
|
||||
# getting iv ptr from parameter 4
|
||||
movl 36(%esp), %ebx
|
||||
movl (%ebx), %esi
|
||||
movl 4(%ebx), %edi
|
||||
pushl %edi
|
||||
pushl %esi
|
||||
pushl %edi
|
||||
pushl %esi
|
||||
movl %esp, %ebx
|
||||
movl 36(%esp), %esi
|
||||
movl 40(%esp), %edi
|
||||
# getting encrypt flag from parameter 5
|
||||
movl 56(%esp), %ecx
|
||||
# get and push parameter 3
|
||||
movl 48(%esp), %eax
|
||||
pushl %eax
|
||||
pushl %ebx
|
||||
cmpl $0, %ecx
|
||||
jz .L000decrypt
|
||||
andl $4294967288, %ebp
|
||||
movl 8(%esp), %eax
|
||||
movl 12(%esp), %ebx
|
||||
jz .L001encrypt_finish
|
||||
.L002encrypt_loop:
|
||||
movl (%esi), %ecx
|
||||
movl 4(%esi), %edx
|
||||
xorl %ecx, %eax
|
||||
xorl %edx, %ebx
|
||||
.byte 15
|
||||
.byte 200 # bswapl %eax
|
||||
.byte 15
|
||||
.byte 203 # bswapl %ebx
|
||||
movl %eax, 8(%esp)
|
||||
movl %ebx, 12(%esp)
|
||||
call BF_encrypt
|
||||
movl 8(%esp), %eax
|
||||
movl 12(%esp), %ebx
|
||||
.byte 15
|
||||
.byte 200 # bswapl %eax
|
||||
.byte 15
|
||||
.byte 203 # bswapl %ebx
|
||||
movl %eax, (%edi)
|
||||
movl %ebx, 4(%edi)
|
||||
addl $8, %esi
|
||||
addl $8, %edi
|
||||
subl $8, %ebp
|
||||
jnz .L002encrypt_loop
|
||||
.L001encrypt_finish:
|
||||
movl 52(%esp), %ebp
|
||||
andl $7, %ebp
|
||||
jz .L003finish
|
||||
xorl %ecx, %ecx
|
||||
xorl %edx, %edx
|
||||
movl .L004cbc_enc_jmp_table(,%ebp,4),%ebp
|
||||
jmp *%ebp
|
||||
.L005ej7:
|
||||
movb 6(%esi), %dh
|
||||
sall $8, %edx
|
||||
.L006ej6:
|
||||
movb 5(%esi), %dh
|
||||
.L007ej5:
|
||||
movb 4(%esi), %dl
|
||||
.L008ej4:
|
||||
movl (%esi), %ecx
|
||||
jmp .L009ejend
|
||||
.L010ej3:
|
||||
movb 2(%esi), %ch
|
||||
sall $8, %ecx
|
||||
.L011ej2:
|
||||
movb 1(%esi), %ch
|
||||
.L012ej1:
|
||||
movb (%esi), %cl
|
||||
.L009ejend:
|
||||
xorl %ecx, %eax
|
||||
xorl %edx, %ebx
|
||||
.byte 15
|
||||
.byte 200 # bswapl %eax
|
||||
.byte 15
|
||||
.byte 203 # bswapl %ebx
|
||||
movl %eax, 8(%esp)
|
||||
movl %ebx, 12(%esp)
|
||||
call BF_encrypt
|
||||
movl 8(%esp), %eax
|
||||
movl 12(%esp), %ebx
|
||||
.byte 15
|
||||
.byte 200 # bswapl %eax
|
||||
.byte 15
|
||||
.byte 203 # bswapl %ebx
|
||||
movl %eax, (%edi)
|
||||
movl %ebx, 4(%edi)
|
||||
jmp .L003finish
|
||||
.align 16
|
||||
.L000decrypt:
|
||||
andl $4294967288, %ebp
|
||||
movl 16(%esp), %eax
|
||||
movl 20(%esp), %ebx
|
||||
jz .L013decrypt_finish
|
||||
.L014decrypt_loop:
|
||||
movl (%esi), %eax
|
||||
movl 4(%esi), %ebx
|
||||
.byte 15
|
||||
.byte 200 # bswapl %eax
|
||||
.byte 15
|
||||
.byte 203 # bswapl %ebx
|
||||
movl %eax, 8(%esp)
|
||||
movl %ebx, 12(%esp)
|
||||
call BF_decrypt
|
||||
movl 8(%esp), %eax
|
||||
movl 12(%esp), %ebx
|
||||
.byte 15
|
||||
.byte 200 # bswapl %eax
|
||||
.byte 15
|
||||
.byte 203 # bswapl %ebx
|
||||
movl 16(%esp), %ecx
|
||||
movl 20(%esp), %edx
|
||||
xorl %eax, %ecx
|
||||
xorl %ebx, %edx
|
||||
movl (%esi), %eax
|
||||
movl 4(%esi), %ebx
|
||||
movl %ecx, (%edi)
|
||||
movl %edx, 4(%edi)
|
||||
movl %eax, 16(%esp)
|
||||
movl %ebx, 20(%esp)
|
||||
addl $8, %esi
|
||||
addl $8, %edi
|
||||
subl $8, %ebp
|
||||
jnz .L014decrypt_loop
|
||||
.L013decrypt_finish:
|
||||
movl 52(%esp), %ebp
|
||||
andl $7, %ebp
|
||||
jz .L003finish
|
||||
movl (%esi), %eax
|
||||
movl 4(%esi), %ebx
|
||||
.byte 15
|
||||
.byte 200 # bswapl %eax
|
||||
.byte 15
|
||||
.byte 203 # bswapl %ebx
|
||||
movl %eax, 8(%esp)
|
||||
movl %ebx, 12(%esp)
|
||||
call BF_decrypt
|
||||
movl 8(%esp), %eax
|
||||
movl 12(%esp), %ebx
|
||||
.byte 15
|
||||
.byte 200 # bswapl %eax
|
||||
.byte 15
|
||||
.byte 203 # bswapl %ebx
|
||||
movl 16(%esp), %ecx
|
||||
movl 20(%esp), %edx
|
||||
xorl %eax, %ecx
|
||||
xorl %ebx, %edx
|
||||
movl (%esi), %eax
|
||||
movl 4(%esi), %ebx
|
||||
.L015dj7:
|
||||
rorl $16, %edx
|
||||
movb %dl, 6(%edi)
|
||||
shrl $16, %edx
|
||||
.L016dj6:
|
||||
movb %dh, 5(%edi)
|
||||
.L017dj5:
|
||||
movb %dl, 4(%edi)
|
||||
.L018dj4:
|
||||
movl %ecx, (%edi)
|
||||
jmp .L019djend
|
||||
.L020dj3:
|
||||
rorl $16, %ecx
|
||||
movb %cl, 2(%edi)
|
||||
sall $16, %ecx
|
||||
.L021dj2:
|
||||
movb %ch, 1(%esi)
|
||||
.L022dj1:
|
||||
movb %cl, (%esi)
|
||||
.L019djend:
|
||||
jmp .L003finish
|
||||
.align 16
|
||||
.L003finish:
|
||||
movl 60(%esp), %ecx
|
||||
addl $24, %esp
|
||||
movl %eax, (%ecx)
|
||||
movl %ebx, 4(%ecx)
|
||||
popl %edi
|
||||
popl %esi
|
||||
popl %ebx
|
||||
popl %ebp
|
||||
ret
|
||||
.align 16
|
||||
.L004cbc_enc_jmp_table:
|
||||
.long 0
|
||||
.long .L012ej1
|
||||
.long .L011ej2
|
||||
.long .L010ej3
|
||||
.long .L008ej4
|
||||
.long .L007ej5
|
||||
.long .L006ej6
|
||||
.long .L005ej7
|
||||
.align 16
|
||||
.L023cbc_dec_jmp_table:
|
||||
.long 0
|
||||
.long .L022dj1
|
||||
.long .L021dj2
|
||||
.long .L020dj3
|
||||
.long .L018dj4
|
||||
.long .L017dj5
|
||||
.long .L016dj6
|
||||
.long .L015dj7
|
||||
.L_BF_cbc_encrypt_end:
|
||||
.size BF_cbc_encrypt,.L_BF_cbc_encrypt_end-BF_cbc_encrypt
|
||||
.ident "desasm.pl"
|
||||
@@ -1,902 +0,0 @@
|
||||
# $FreeBSD$
|
||||
# Dont even think of reading this code
|
||||
# It was automatically generated by bf-686.pl
|
||||
# Which is a perl program used to generate the x86 assember for
|
||||
# any of elf, a.out, BSDI, Win32, gaswin (for GNU as on Win32) or Solaris
|
||||
# eric <eay@cryptsoft.com>
|
||||
|
||||
.file "bf-686.s"
|
||||
.version "01.01"
|
||||
gcc2_compiled.:
|
||||
.text
|
||||
.align 16
|
||||
.globl BF_encrypt
|
||||
.type BF_encrypt,@function
|
||||
BF_encrypt:
|
||||
pushl %ebp
|
||||
pushl %ebx
|
||||
pushl %esi
|
||||
pushl %edi
|
||||
|
||||
|
||||
# Load the 2 words
|
||||
movl 20(%esp), %eax
|
||||
movl (%eax), %ecx
|
||||
movl 4(%eax), %edx
|
||||
|
||||
# P pointer, s and enc flag
|
||||
movl 24(%esp), %edi
|
||||
xorl %eax, %eax
|
||||
xorl %ebx, %ebx
|
||||
xorl (%edi), %ecx
|
||||
|
||||
# Round 0
|
||||
rorl $16, %ecx
|
||||
movl 4(%edi), %esi
|
||||
movb %ch, %al
|
||||
movb %cl, %bl
|
||||
rorl $16, %ecx
|
||||
xorl %esi, %edx
|
||||
movl 72(%edi,%eax,4),%esi
|
||||
movl 1096(%edi,%ebx,4),%ebp
|
||||
movb %ch, %al
|
||||
movb %cl, %bl
|
||||
addl %ebp, %esi
|
||||
movl 2120(%edi,%eax,4),%eax
|
||||
xorl %eax, %esi
|
||||
movl 3144(%edi,%ebx,4),%ebp
|
||||
addl %ebp, %esi
|
||||
xorl %eax, %eax
|
||||
xorl %esi, %edx
|
||||
|
||||
# Round 1
|
||||
rorl $16, %edx
|
||||
movl 8(%edi), %esi
|
||||
movb %dh, %al
|
||||
movb %dl, %bl
|
||||
rorl $16, %edx
|
||||
xorl %esi, %ecx
|
||||
movl 72(%edi,%eax,4),%esi
|
||||
movl 1096(%edi,%ebx,4),%ebp
|
||||
movb %dh, %al
|
||||
movb %dl, %bl
|
||||
addl %ebp, %esi
|
||||
movl 2120(%edi,%eax,4),%eax
|
||||
xorl %eax, %esi
|
||||
movl 3144(%edi,%ebx,4),%ebp
|
||||
addl %ebp, %esi
|
||||
xorl %eax, %eax
|
||||
xorl %esi, %ecx
|
||||
|
||||
# Round 2
|
||||
rorl $16, %ecx
|
||||
movl 12(%edi), %esi
|
||||
movb %ch, %al
|
||||
movb %cl, %bl
|
||||
rorl $16, %ecx
|
||||
xorl %esi, %edx
|
||||
movl 72(%edi,%eax,4),%esi
|
||||
movl 1096(%edi,%ebx,4),%ebp
|
||||
movb %ch, %al
|
||||
movb %cl, %bl
|
||||
addl %ebp, %esi
|
||||
movl 2120(%edi,%eax,4),%eax
|
||||
xorl %eax, %esi
|
||||
movl 3144(%edi,%ebx,4),%ebp
|
||||
addl %ebp, %esi
|
||||
xorl %eax, %eax
|
||||
xorl %esi, %edx
|
||||
|
||||
# Round 3
|
||||
rorl $16, %edx
|
||||
movl 16(%edi), %esi
|
||||
movb %dh, %al
|
||||
movb %dl, %bl
|
||||
rorl $16, %edx
|
||||
xorl %esi, %ecx
|
||||
movl 72(%edi,%eax,4),%esi
|
||||
movl 1096(%edi,%ebx,4),%ebp
|
||||
movb %dh, %al
|
||||
movb %dl, %bl
|
||||
addl %ebp, %esi
|
||||
movl 2120(%edi,%eax,4),%eax
|
||||
xorl %eax, %esi
|
||||
movl 3144(%edi,%ebx,4),%ebp
|
||||
addl %ebp, %esi
|
||||
xorl %eax, %eax
|
||||
xorl %esi, %ecx
|
||||
|
||||
# Round 4
|
||||
rorl $16, %ecx
|
||||
movl 20(%edi), %esi
|
||||
movb %ch, %al
|
||||
movb %cl, %bl
|
||||
rorl $16, %ecx
|
||||
xorl %esi, %edx
|
||||
movl 72(%edi,%eax,4),%esi
|
||||
movl 1096(%edi,%ebx,4),%ebp
|
||||
movb %ch, %al
|
||||
movb %cl, %bl
|
||||
addl %ebp, %esi
|
||||
movl 2120(%edi,%eax,4),%eax
|
||||
xorl %eax, %esi
|
||||
movl 3144(%edi,%ebx,4),%ebp
|
||||
addl %ebp, %esi
|
||||
xorl %eax, %eax
|
||||
xorl %esi, %edx
|
||||
|
||||
# Round 5
|
||||
rorl $16, %edx
|
||||
movl 24(%edi), %esi
|
||||
movb %dh, %al
|
||||
movb %dl, %bl
|
||||
rorl $16, %edx
|
||||
xorl %esi, %ecx
|
||||
movl 72(%edi,%eax,4),%esi
|
||||
movl 1096(%edi,%ebx,4),%ebp
|
||||
movb %dh, %al
|
||||
movb %dl, %bl
|
||||
addl %ebp, %esi
|
||||
movl 2120(%edi,%eax,4),%eax
|
||||
xorl %eax, %esi
|
||||
movl 3144(%edi,%ebx,4),%ebp
|
||||
addl %ebp, %esi
|
||||
xorl %eax, %eax
|
||||
xorl %esi, %ecx
|
||||
|
||||
# Round 6
|
||||
rorl $16, %ecx
|
||||
movl 28(%edi), %esi
|
||||
movb %ch, %al
|
||||
movb %cl, %bl
|
||||
rorl $16, %ecx
|
||||
xorl %esi, %edx
|
||||
movl 72(%edi,%eax,4),%esi
|
||||
movl 1096(%edi,%ebx,4),%ebp
|
||||
movb %ch, %al
|
||||
movb %cl, %bl
|
||||
addl %ebp, %esi
|
||||
movl 2120(%edi,%eax,4),%eax
|
||||
xorl %eax, %esi
|
||||
movl 3144(%edi,%ebx,4),%ebp
|
||||
addl %ebp, %esi
|
||||
xorl %eax, %eax
|
||||
xorl %esi, %edx
|
||||
|
||||
# Round 7
|
||||
rorl $16, %edx
|
||||
movl 32(%edi), %esi
|
||||
movb %dh, %al
|
||||
movb %dl, %bl
|
||||
rorl $16, %edx
|
||||
xorl %esi, %ecx
|
||||
movl 72(%edi,%eax,4),%esi
|
||||
movl 1096(%edi,%ebx,4),%ebp
|
||||
movb %dh, %al
|
||||
movb %dl, %bl
|
||||
addl %ebp, %esi
|
||||
movl 2120(%edi,%eax,4),%eax
|
||||
xorl %eax, %esi
|
||||
movl 3144(%edi,%ebx,4),%ebp
|
||||
addl %ebp, %esi
|
||||
xorl %eax, %eax
|
||||
xorl %esi, %ecx
|
||||
|
||||
# Round 8
|
||||
rorl $16, %ecx
|
||||
movl 36(%edi), %esi
|
||||
movb %ch, %al
|
||||
movb %cl, %bl
|
||||
rorl $16, %ecx
|
||||
xorl %esi, %edx
|
||||
movl 72(%edi,%eax,4),%esi
|
||||
movl 1096(%edi,%ebx,4),%ebp
|
||||
movb %ch, %al
|
||||
movb %cl, %bl
|
||||
addl %ebp, %esi
|
||||
movl 2120(%edi,%eax,4),%eax
|
||||
xorl %eax, %esi
|
||||
movl 3144(%edi,%ebx,4),%ebp
|
||||
addl %ebp, %esi
|
||||
xorl %eax, %eax
|
||||
xorl %esi, %edx
|
||||
|
||||
# Round 9
|
||||
rorl $16, %edx
|
||||
movl 40(%edi), %esi
|
||||
movb %dh, %al
|
||||
movb %dl, %bl
|
||||
rorl $16, %edx
|
||||
xorl %esi, %ecx
|
||||
movl 72(%edi,%eax,4),%esi
|
||||
movl 1096(%edi,%ebx,4),%ebp
|
||||
movb %dh, %al
|
||||
movb %dl, %bl
|
||||
addl %ebp, %esi
|
||||
movl 2120(%edi,%eax,4),%eax
|
||||
xorl %eax, %esi
|
||||
movl 3144(%edi,%ebx,4),%ebp
|
||||
addl %ebp, %esi
|
||||
xorl %eax, %eax
|
||||
xorl %esi, %ecx
|
||||
|
||||
# Round 10
|
||||
rorl $16, %ecx
|
||||
movl 44(%edi), %esi
|
||||
movb %ch, %al
|
||||
movb %cl, %bl
|
||||
rorl $16, %ecx
|
||||
xorl %esi, %edx
|
||||
movl 72(%edi,%eax,4),%esi
|
||||
movl 1096(%edi,%ebx,4),%ebp
|
||||
movb %ch, %al
|
||||
movb %cl, %bl
|
||||
addl %ebp, %esi
|
||||
movl 2120(%edi,%eax,4),%eax
|
||||
xorl %eax, %esi
|
||||
movl 3144(%edi,%ebx,4),%ebp
|
||||
addl %ebp, %esi
|
||||
xorl %eax, %eax
|
||||
xorl %esi, %edx
|
||||
|
||||
# Round 11
|
||||
rorl $16, %edx
|
||||
movl 48(%edi), %esi
|
||||
movb %dh, %al
|
||||
movb %dl, %bl
|
||||
rorl $16, %edx
|
||||
xorl %esi, %ecx
|
||||
movl 72(%edi,%eax,4),%esi
|
||||
movl 1096(%edi,%ebx,4),%ebp
|
||||
movb %dh, %al
|
||||
movb %dl, %bl
|
||||
addl %ebp, %esi
|
||||
movl 2120(%edi,%eax,4),%eax
|
||||
xorl %eax, %esi
|
||||
movl 3144(%edi,%ebx,4),%ebp
|
||||
addl %ebp, %esi
|
||||
xorl %eax, %eax
|
||||
xorl %esi, %ecx
|
||||
|
||||
# Round 12
|
||||
rorl $16, %ecx
|
||||
movl 52(%edi), %esi
|
||||
movb %ch, %al
|
||||
movb %cl, %bl
|
||||
rorl $16, %ecx
|
||||
xorl %esi, %edx
|
||||
movl 72(%edi,%eax,4),%esi
|
||||
movl 1096(%edi,%ebx,4),%ebp
|
||||
movb %ch, %al
|
||||
movb %cl, %bl
|
||||
addl %ebp, %esi
|
||||
movl 2120(%edi,%eax,4),%eax
|
||||
xorl %eax, %esi
|
||||
movl 3144(%edi,%ebx,4),%ebp
|
||||
addl %ebp, %esi
|
||||
xorl %eax, %eax
|
||||
xorl %esi, %edx
|
||||
|
||||
# Round 13
|
||||
rorl $16, %edx
|
||||
movl 56(%edi), %esi
|
||||
movb %dh, %al
|
||||
movb %dl, %bl
|
||||
rorl $16, %edx
|
||||
xorl %esi, %ecx
|
||||
movl 72(%edi,%eax,4),%esi
|
||||
movl 1096(%edi,%ebx,4),%ebp
|
||||
movb %dh, %al
|
||||
movb %dl, %bl
|
||||
addl %ebp, %esi
|
||||
movl 2120(%edi,%eax,4),%eax
|
||||
xorl %eax, %esi
|
||||
movl 3144(%edi,%ebx,4),%ebp
|
||||
addl %ebp, %esi
|
||||
xorl %eax, %eax
|
||||
xorl %esi, %ecx
|
||||
|
||||
# Round 14
|
||||
rorl $16, %ecx
|
||||
movl 60(%edi), %esi
|
||||
movb %ch, %al
|
||||
movb %cl, %bl
|
||||
rorl $16, %ecx
|
||||
xorl %esi, %edx
|
||||
movl 72(%edi,%eax,4),%esi
|
||||
movl 1096(%edi,%ebx,4),%ebp
|
||||
movb %ch, %al
|
||||
movb %cl, %bl
|
||||
addl %ebp, %esi
|
||||
movl 2120(%edi,%eax,4),%eax
|
||||
xorl %eax, %esi
|
||||
movl 3144(%edi,%ebx,4),%ebp
|
||||
addl %ebp, %esi
|
||||
xorl %eax, %eax
|
||||
xorl %esi, %edx
|
||||
|
||||
# Round 15
|
||||
rorl $16, %edx
|
||||
movl 64(%edi), %esi
|
||||
movb %dh, %al
|
||||
movb %dl, %bl
|
||||
rorl $16, %edx
|
||||
xorl %esi, %ecx
|
||||
movl 72(%edi,%eax,4),%esi
|
||||
movl 1096(%edi,%ebx,4),%ebp
|
||||
movb %dh, %al
|
||||
movb %dl, %bl
|
||||
addl %ebp, %esi
|
||||
movl 2120(%edi,%eax,4),%eax
|
||||
xorl %eax, %esi
|
||||
movl 3144(%edi,%ebx,4),%ebp
|
||||
addl %ebp, %esi
|
||||
xorl %eax, %eax
|
||||
xorl %esi, %ecx
|
||||
xorl 68(%edi), %edx
|
||||
movl 20(%esp), %eax
|
||||
movl %edx, (%eax)
|
||||
movl %ecx, 4(%eax)
|
||||
popl %edi
|
||||
popl %esi
|
||||
popl %ebx
|
||||
popl %ebp
|
||||
ret
|
||||
.L_BF_encrypt_end:
|
||||
.size BF_encrypt,.L_BF_encrypt_end-BF_encrypt
|
||||
.ident "desasm.pl"
|
||||
.text
|
||||
.align 16
|
||||
.globl BF_decrypt
|
||||
.type BF_decrypt,@function
|
||||
BF_decrypt:
|
||||
pushl %ebp
|
||||
pushl %ebx
|
||||
pushl %esi
|
||||
pushl %edi
|
||||
|
||||
|
||||
# Load the 2 words
|
||||
movl 20(%esp), %eax
|
||||
movl (%eax), %ecx
|
||||
movl 4(%eax), %edx
|
||||
|
||||
# P pointer, s and enc flag
|
||||
movl 24(%esp), %edi
|
||||
xorl %eax, %eax
|
||||
xorl %ebx, %ebx
|
||||
xorl 68(%edi), %ecx
|
||||
|
||||
# Round 16
|
||||
rorl $16, %ecx
|
||||
movl 64(%edi), %esi
|
||||
movb %ch, %al
|
||||
movb %cl, %bl
|
||||
rorl $16, %ecx
|
||||
xorl %esi, %edx
|
||||
movl 72(%edi,%eax,4),%esi
|
||||
movl 1096(%edi,%ebx,4),%ebp
|
||||
movb %ch, %al
|
||||
movb %cl, %bl
|
||||
addl %ebp, %esi
|
||||
movl 2120(%edi,%eax,4),%eax
|
||||
xorl %eax, %esi
|
||||
movl 3144(%edi,%ebx,4),%ebp
|
||||
addl %ebp, %esi
|
||||
xorl %eax, %eax
|
||||
xorl %esi, %edx
|
||||
|
||||
# Round 15
|
||||
rorl $16, %edx
|
||||
movl 60(%edi), %esi
|
||||
movb %dh, %al
|
||||
movb %dl, %bl
|
||||
rorl $16, %edx
|
||||
xorl %esi, %ecx
|
||||
movl 72(%edi,%eax,4),%esi
|
||||
movl 1096(%edi,%ebx,4),%ebp
|
||||
movb %dh, %al
|
||||
movb %dl, %bl
|
||||
addl %ebp, %esi
|
||||
movl 2120(%edi,%eax,4),%eax
|
||||
xorl %eax, %esi
|
||||
movl 3144(%edi,%ebx,4),%ebp
|
||||
addl %ebp, %esi
|
||||
xorl %eax, %eax
|
||||
xorl %esi, %ecx
|
||||
|
||||
# Round 14
|
||||
rorl $16, %ecx
|
||||
movl 56(%edi), %esi
|
||||
movb %ch, %al
|
||||
movb %cl, %bl
|
||||
rorl $16, %ecx
|
||||
xorl %esi, %edx
|
||||
movl 72(%edi,%eax,4),%esi
|
||||
movl 1096(%edi,%ebx,4),%ebp
|
||||
movb %ch, %al
|
||||
movb %cl, %bl
|
||||
addl %ebp, %esi
|
||||
movl 2120(%edi,%eax,4),%eax
|
||||
xorl %eax, %esi
|
||||
movl 3144(%edi,%ebx,4),%ebp
|
||||
addl %ebp, %esi
|
||||
xorl %eax, %eax
|
||||
xorl %esi, %edx
|
||||
|
||||
# Round 13
|
||||
rorl $16, %edx
|
||||
movl 52(%edi), %esi
|
||||
movb %dh, %al
|
||||
movb %dl, %bl
|
||||
rorl $16, %edx
|
||||
xorl %esi, %ecx
|
||||
movl 72(%edi,%eax,4),%esi
|
||||
movl 1096(%edi,%ebx,4),%ebp
|
||||
movb %dh, %al
|
||||
movb %dl, %bl
|
||||
addl %ebp, %esi
|
||||
movl 2120(%edi,%eax,4),%eax
|
||||
xorl %eax, %esi
|
||||
movl 3144(%edi,%ebx,4),%ebp
|
||||
addl %ebp, %esi
|
||||
xorl %eax, %eax
|
||||
xorl %esi, %ecx
|
||||
|
||||
# Round 12
|
||||
rorl $16, %ecx
|
||||
movl 48(%edi), %esi
|
||||
movb %ch, %al
|
||||
movb %cl, %bl
|
||||
rorl $16, %ecx
|
||||
xorl %esi, %edx
|
||||
movl 72(%edi,%eax,4),%esi
|
||||
movl 1096(%edi,%ebx,4),%ebp
|
||||
movb %ch, %al
|
||||
movb %cl, %bl
|
||||
addl %ebp, %esi
|
||||
movl 2120(%edi,%eax,4),%eax
|
||||
xorl %eax, %esi
|
||||
movl 3144(%edi,%ebx,4),%ebp
|
||||
addl %ebp, %esi
|
||||
xorl %eax, %eax
|
||||
xorl %esi, %edx
|
||||
|
||||
# Round 11
|
||||
rorl $16, %edx
|
||||
movl 44(%edi), %esi
|
||||
movb %dh, %al
|
||||
movb %dl, %bl
|
||||
rorl $16, %edx
|
||||
xorl %esi, %ecx
|
||||
movl 72(%edi,%eax,4),%esi
|
||||
movl 1096(%edi,%ebx,4),%ebp
|
||||
movb %dh, %al
|
||||
movb %dl, %bl
|
||||
addl %ebp, %esi
|
||||
movl 2120(%edi,%eax,4),%eax
|
||||
xorl %eax, %esi
|
||||
movl 3144(%edi,%ebx,4),%ebp
|
||||
addl %ebp, %esi
|
||||
xorl %eax, %eax
|
||||
xorl %esi, %ecx
|
||||
|
||||
# Round 10
|
||||
rorl $16, %ecx
|
||||
movl 40(%edi), %esi
|
||||
movb %ch, %al
|
||||
movb %cl, %bl
|
||||
rorl $16, %ecx
|
||||
xorl %esi, %edx
|
||||
movl 72(%edi,%eax,4),%esi
|
||||
movl 1096(%edi,%ebx,4),%ebp
|
||||
movb %ch, %al
|
||||
movb %cl, %bl
|
||||
addl %ebp, %esi
|
||||
movl 2120(%edi,%eax,4),%eax
|
||||
xorl %eax, %esi
|
||||
movl 3144(%edi,%ebx,4),%ebp
|
||||
addl %ebp, %esi
|
||||
xorl %eax, %eax
|
||||
xorl %esi, %edx
|
||||
|
||||
# Round 9
|
||||
rorl $16, %edx
|
||||
movl 36(%edi), %esi
|
||||
movb %dh, %al
|
||||
movb %dl, %bl
|
||||
rorl $16, %edx
|
||||
xorl %esi, %ecx
|
||||
movl 72(%edi,%eax,4),%esi
|
||||
movl 1096(%edi,%ebx,4),%ebp
|
||||
movb %dh, %al
|
||||
movb %dl, %bl
|
||||
addl %ebp, %esi
|
||||
movl 2120(%edi,%eax,4),%eax
|
||||
xorl %eax, %esi
|
||||
movl 3144(%edi,%ebx,4),%ebp
|
||||
addl %ebp, %esi
|
||||
xorl %eax, %eax
|
||||
xorl %esi, %ecx
|
||||
|
||||
# Round 8
|
||||
rorl $16, %ecx
|
||||
movl 32(%edi), %esi
|
||||
movb %ch, %al
|
||||
movb %cl, %bl
|
||||
rorl $16, %ecx
|
||||
xorl %esi, %edx
|
||||
movl 72(%edi,%eax,4),%esi
|
||||
movl 1096(%edi,%ebx,4),%ebp
|
||||
movb %ch, %al
|
||||
movb %cl, %bl
|
||||
addl %ebp, %esi
|
||||
movl 2120(%edi,%eax,4),%eax
|
||||
xorl %eax, %esi
|
||||
movl 3144(%edi,%ebx,4),%ebp
|
||||
addl %ebp, %esi
|
||||
xorl %eax, %eax
|
||||
xorl %esi, %edx
|
||||
|
||||
# Round 7
|
||||
rorl $16, %edx
|
||||
movl 28(%edi), %esi
|
||||
movb %dh, %al
|
||||
movb %dl, %bl
|
||||
rorl $16, %edx
|
||||
xorl %esi, %ecx
|
||||
movl 72(%edi,%eax,4),%esi
|
||||
movl 1096(%edi,%ebx,4),%ebp
|
||||
movb %dh, %al
|
||||
movb %dl, %bl
|
||||
addl %ebp, %esi
|
||||
movl 2120(%edi,%eax,4),%eax
|
||||
xorl %eax, %esi
|
||||
movl 3144(%edi,%ebx,4),%ebp
|
||||
addl %ebp, %esi
|
||||
xorl %eax, %eax
|
||||
xorl %esi, %ecx
|
||||
|
||||
# Round 6
|
||||
rorl $16, %ecx
|
||||
movl 24(%edi), %esi
|
||||
movb %ch, %al
|
||||
movb %cl, %bl
|
||||
rorl $16, %ecx
|
||||
xorl %esi, %edx
|
||||
movl 72(%edi,%eax,4),%esi
|
||||
movl 1096(%edi,%ebx,4),%ebp
|
||||
movb %ch, %al
|
||||
movb %cl, %bl
|
||||
addl %ebp, %esi
|
||||
movl 2120(%edi,%eax,4),%eax
|
||||
xorl %eax, %esi
|
||||
movl 3144(%edi,%ebx,4),%ebp
|
||||
addl %ebp, %esi
|
||||
xorl %eax, %eax
|
||||
xorl %esi, %edx
|
||||
|
||||
# Round 5
|
||||
rorl $16, %edx
|
||||
movl 20(%edi), %esi
|
||||
movb %dh, %al
|
||||
movb %dl, %bl
|
||||
rorl $16, %edx
|
||||
xorl %esi, %ecx
|
||||
movl 72(%edi,%eax,4),%esi
|
||||
movl 1096(%edi,%ebx,4),%ebp
|
||||
movb %dh, %al
|
||||
movb %dl, %bl
|
||||
addl %ebp, %esi
|
||||
movl 2120(%edi,%eax,4),%eax
|
||||
xorl %eax, %esi
|
||||
movl 3144(%edi,%ebx,4),%ebp
|
||||
addl %ebp, %esi
|
||||
xorl %eax, %eax
|
||||
xorl %esi, %ecx
|
||||
|
||||
# Round 4
|
||||
rorl $16, %ecx
|
||||
movl 16(%edi), %esi
|
||||
movb %ch, %al
|
||||
movb %cl, %bl
|
||||
rorl $16, %ecx
|
||||
xorl %esi, %edx
|
||||
movl 72(%edi,%eax,4),%esi
|
||||
movl 1096(%edi,%ebx,4),%ebp
|
||||
movb %ch, %al
|
||||
movb %cl, %bl
|
||||
addl %ebp, %esi
|
||||
movl 2120(%edi,%eax,4),%eax
|
||||
xorl %eax, %esi
|
||||
movl 3144(%edi,%ebx,4),%ebp
|
||||
addl %ebp, %esi
|
||||
xorl %eax, %eax
|
||||
xorl %esi, %edx
|
||||
|
||||
# Round 3
|
||||
rorl $16, %edx
|
||||
movl 12(%edi), %esi
|
||||
movb %dh, %al
|
||||
movb %dl, %bl
|
||||
rorl $16, %edx
|
||||
xorl %esi, %ecx
|
||||
movl 72(%edi,%eax,4),%esi
|
||||
movl 1096(%edi,%ebx,4),%ebp
|
||||
movb %dh, %al
|
||||
movb %dl, %bl
|
||||
addl %ebp, %esi
|
||||
movl 2120(%edi,%eax,4),%eax
|
||||
xorl %eax, %esi
|
||||
movl 3144(%edi,%ebx,4),%ebp
|
||||
addl %ebp, %esi
|
||||
xorl %eax, %eax
|
||||
xorl %esi, %ecx
|
||||
|
||||
# Round 2
|
||||
rorl $16, %ecx
|
||||
movl 8(%edi), %esi
|
||||
movb %ch, %al
|
||||
movb %cl, %bl
|
||||
rorl $16, %ecx
|
||||
xorl %esi, %edx
|
||||
movl 72(%edi,%eax,4),%esi
|
||||
movl 1096(%edi,%ebx,4),%ebp
|
||||
movb %ch, %al
|
||||
movb %cl, %bl
|
||||
addl %ebp, %esi
|
||||
movl 2120(%edi,%eax,4),%eax
|
||||
xorl %eax, %esi
|
||||
movl 3144(%edi,%ebx,4),%ebp
|
||||
addl %ebp, %esi
|
||||
xorl %eax, %eax
|
||||
xorl %esi, %edx
|
||||
|
||||
# Round 1
|
||||
rorl $16, %edx
|
||||
movl 4(%edi), %esi
|
||||
movb %dh, %al
|
||||
movb %dl, %bl
|
||||
rorl $16, %edx
|
||||
xorl %esi, %ecx
|
||||
movl 72(%edi,%eax,4),%esi
|
||||
movl 1096(%edi,%ebx,4),%ebp
|
||||
movb %dh, %al
|
||||
movb %dl, %bl
|
||||
addl %ebp, %esi
|
||||
movl 2120(%edi,%eax,4),%eax
|
||||
xorl %eax, %esi
|
||||
movl 3144(%edi,%ebx,4),%ebp
|
||||
addl %ebp, %esi
|
||||
xorl %eax, %eax
|
||||
xorl %esi, %ecx
|
||||
xorl (%edi), %edx
|
||||
movl 20(%esp), %eax
|
||||
movl %edx, (%eax)
|
||||
movl %ecx, 4(%eax)
|
||||
popl %edi
|
||||
popl %esi
|
||||
popl %ebx
|
||||
popl %ebp
|
||||
ret
|
||||
.L_BF_decrypt_end:
|
||||
.size BF_decrypt,.L_BF_decrypt_end-BF_decrypt
|
||||
.ident "desasm.pl"
|
||||
.text
|
||||
.align 16
|
||||
.globl BF_cbc_encrypt
|
||||
.type BF_cbc_encrypt,@function
|
||||
BF_cbc_encrypt:
|
||||
|
||||
pushl %ebp
|
||||
pushl %ebx
|
||||
pushl %esi
|
||||
pushl %edi
|
||||
movl 28(%esp), %ebp
|
||||
# getting iv ptr from parameter 4
|
||||
movl 36(%esp), %ebx
|
||||
movl (%ebx), %esi
|
||||
movl 4(%ebx), %edi
|
||||
pushl %edi
|
||||
pushl %esi
|
||||
pushl %edi
|
||||
pushl %esi
|
||||
movl %esp, %ebx
|
||||
movl 36(%esp), %esi
|
||||
movl 40(%esp), %edi
|
||||
# getting encrypt flag from parameter 5
|
||||
movl 56(%esp), %ecx
|
||||
# get and push parameter 3
|
||||
movl 48(%esp), %eax
|
||||
pushl %eax
|
||||
pushl %ebx
|
||||
cmpl $0, %ecx
|
||||
jz .L000decrypt
|
||||
andl $4294967288, %ebp
|
||||
movl 8(%esp), %eax
|
||||
movl 12(%esp), %ebx
|
||||
jz .L001encrypt_finish
|
||||
.L002encrypt_loop:
|
||||
movl (%esi), %ecx
|
||||
movl 4(%esi), %edx
|
||||
xorl %ecx, %eax
|
||||
xorl %edx, %ebx
|
||||
.byte 15
|
||||
.byte 200 # bswapl %eax
|
||||
.byte 15
|
||||
.byte 203 # bswapl %ebx
|
||||
movl %eax, 8(%esp)
|
||||
movl %ebx, 12(%esp)
|
||||
call BF_encrypt
|
||||
movl 8(%esp), %eax
|
||||
movl 12(%esp), %ebx
|
||||
.byte 15
|
||||
.byte 200 # bswapl %eax
|
||||
.byte 15
|
||||
.byte 203 # bswapl %ebx
|
||||
movl %eax, (%edi)
|
||||
movl %ebx, 4(%edi)
|
||||
addl $8, %esi
|
||||
addl $8, %edi
|
||||
subl $8, %ebp
|
||||
jnz .L002encrypt_loop
|
||||
.L001encrypt_finish:
|
||||
movl 52(%esp), %ebp
|
||||
andl $7, %ebp
|
||||
jz .L003finish
|
||||
xorl %ecx, %ecx
|
||||
xorl %edx, %edx
|
||||
movl .L004cbc_enc_jmp_table(,%ebp,4),%ebp
|
||||
jmp *%ebp
|
||||
.L005ej7:
|
||||
movb 6(%esi), %dh
|
||||
sall $8, %edx
|
||||
.L006ej6:
|
||||
movb 5(%esi), %dh
|
||||
.L007ej5:
|
||||
movb 4(%esi), %dl
|
||||
.L008ej4:
|
||||
movl (%esi), %ecx
|
||||
jmp .L009ejend
|
||||
.L010ej3:
|
||||
movb 2(%esi), %ch
|
||||
sall $8, %ecx
|
||||
.L011ej2:
|
||||
movb 1(%esi), %ch
|
||||
.L012ej1:
|
||||
movb (%esi), %cl
|
||||
.L009ejend:
|
||||
xorl %ecx, %eax
|
||||
xorl %edx, %ebx
|
||||
.byte 15
|
||||
.byte 200 # bswapl %eax
|
||||
.byte 15
|
||||
.byte 203 # bswapl %ebx
|
||||
movl %eax, 8(%esp)
|
||||
movl %ebx, 12(%esp)
|
||||
call BF_encrypt
|
||||
movl 8(%esp), %eax
|
||||
movl 12(%esp), %ebx
|
||||
.byte 15
|
||||
.byte 200 # bswapl %eax
|
||||
.byte 15
|
||||
.byte 203 # bswapl %ebx
|
||||
movl %eax, (%edi)
|
||||
movl %ebx, 4(%edi)
|
||||
jmp .L003finish
|
||||
.align 16
|
||||
.L000decrypt:
|
||||
andl $4294967288, %ebp
|
||||
movl 16(%esp), %eax
|
||||
movl 20(%esp), %ebx
|
||||
jz .L013decrypt_finish
|
||||
.L014decrypt_loop:
|
||||
movl (%esi), %eax
|
||||
movl 4(%esi), %ebx
|
||||
.byte 15
|
||||
.byte 200 # bswapl %eax
|
||||
.byte 15
|
||||
.byte 203 # bswapl %ebx
|
||||
movl %eax, 8(%esp)
|
||||
movl %ebx, 12(%esp)
|
||||
call BF_decrypt
|
||||
movl 8(%esp), %eax
|
||||
movl 12(%esp), %ebx
|
||||
.byte 15
|
||||
.byte 200 # bswapl %eax
|
||||
.byte 15
|
||||
.byte 203 # bswapl %ebx
|
||||
movl 16(%esp), %ecx
|
||||
movl 20(%esp), %edx
|
||||
xorl %eax, %ecx
|
||||
xorl %ebx, %edx
|
||||
movl (%esi), %eax
|
||||
movl 4(%esi), %ebx
|
||||
movl %ecx, (%edi)
|
||||
movl %edx, 4(%edi)
|
||||
movl %eax, 16(%esp)
|
||||
movl %ebx, 20(%esp)
|
||||
addl $8, %esi
|
||||
addl $8, %edi
|
||||
subl $8, %ebp
|
||||
jnz .L014decrypt_loop
|
||||
.L013decrypt_finish:
|
||||
movl 52(%esp), %ebp
|
||||
andl $7, %ebp
|
||||
jz .L003finish
|
||||
movl (%esi), %eax
|
||||
movl 4(%esi), %ebx
|
||||
.byte 15
|
||||
.byte 200 # bswapl %eax
|
||||
.byte 15
|
||||
.byte 203 # bswapl %ebx
|
||||
movl %eax, 8(%esp)
|
||||
movl %ebx, 12(%esp)
|
||||
call BF_decrypt
|
||||
movl 8(%esp), %eax
|
||||
movl 12(%esp), %ebx
|
||||
.byte 15
|
||||
.byte 200 # bswapl %eax
|
||||
.byte 15
|
||||
.byte 203 # bswapl %ebx
|
||||
movl 16(%esp), %ecx
|
||||
movl 20(%esp), %edx
|
||||
xorl %eax, %ecx
|
||||
xorl %ebx, %edx
|
||||
movl (%esi), %eax
|
||||
movl 4(%esi), %ebx
|
||||
.L015dj7:
|
||||
rorl $16, %edx
|
||||
movb %dl, 6(%edi)
|
||||
shrl $16, %edx
|
||||
.L016dj6:
|
||||
movb %dh, 5(%edi)
|
||||
.L017dj5:
|
||||
movb %dl, 4(%edi)
|
||||
.L018dj4:
|
||||
movl %ecx, (%edi)
|
||||
jmp .L019djend
|
||||
.L020dj3:
|
||||
rorl $16, %ecx
|
||||
movb %cl, 2(%edi)
|
||||
sall $16, %ecx
|
||||
.L021dj2:
|
||||
movb %ch, 1(%esi)
|
||||
.L022dj1:
|
||||
movb %cl, (%esi)
|
||||
.L019djend:
|
||||
jmp .L003finish
|
||||
.align 16
|
||||
.L003finish:
|
||||
movl 60(%esp), %ecx
|
||||
addl $24, %esp
|
||||
movl %eax, (%ecx)
|
||||
movl %ebx, 4(%ecx)
|
||||
popl %edi
|
||||
popl %esi
|
||||
popl %ebx
|
||||
popl %ebp
|
||||
ret
|
||||
.align 16
|
||||
.L004cbc_enc_jmp_table:
|
||||
.long 0
|
||||
.long .L012ej1
|
||||
.long .L011ej2
|
||||
.long .L010ej3
|
||||
.long .L008ej4
|
||||
.long .L007ej5
|
||||
.long .L006ej6
|
||||
.long .L005ej7
|
||||
.align 16
|
||||
.L023cbc_dec_jmp_table:
|
||||
.long 0
|
||||
.long .L022dj1
|
||||
.long .L021dj2
|
||||
.long .L020dj3
|
||||
.long .L018dj4
|
||||
.long .L017dj5
|
||||
.long .L016dj6
|
||||
.long .L015dj7
|
||||
.L_BF_cbc_encrypt_end:
|
||||
.size BF_cbc_encrypt,.L_BF_cbc_encrypt_end-BF_cbc_encrypt
|
||||
.ident "desasm.pl"
|
||||
@@ -1,890 +0,0 @@
|
||||
# $FreeBSD$
|
||||
# Dont even think of reading this code
|
||||
# It was automatically generated by bn-586.pl
|
||||
# Which is a perl program used to generate the x86 assember for
|
||||
# any of elf, a.out, BSDI, Win32, gaswin (for GNU as on Win32) or Solaris
|
||||
# eric <eay@cryptsoft.com>
|
||||
|
||||
.file "bn-586.s"
|
||||
.version "01.01"
|
||||
gcc2_compiled.:
|
||||
.text
|
||||
.align 16
|
||||
.globl bn_mul_add_words
|
||||
.type bn_mul_add_words,@function
|
||||
bn_mul_add_words:
|
||||
pushl %ebp
|
||||
pushl %ebx
|
||||
pushl %esi
|
||||
pushl %edi
|
||||
|
||||
|
||||
xorl %esi, %esi
|
||||
movl 20(%esp), %edi
|
||||
movl 28(%esp), %ecx
|
||||
movl 24(%esp), %ebx
|
||||
andl $4294967288, %ecx
|
||||
movl 32(%esp), %ebp
|
||||
pushl %ecx
|
||||
jz .L000maw_finish
|
||||
.L001maw_loop:
|
||||
movl %ecx, (%esp)
|
||||
# Round 0
|
||||
movl (%ebx), %eax
|
||||
mull %ebp
|
||||
addl %esi, %eax
|
||||
movl (%edi), %esi
|
||||
adcl $0, %edx
|
||||
addl %esi, %eax
|
||||
adcl $0, %edx
|
||||
movl %eax, (%edi)
|
||||
movl %edx, %esi
|
||||
# Round 4
|
||||
movl 4(%ebx), %eax
|
||||
mull %ebp
|
||||
addl %esi, %eax
|
||||
movl 4(%edi), %esi
|
||||
adcl $0, %edx
|
||||
addl %esi, %eax
|
||||
adcl $0, %edx
|
||||
movl %eax, 4(%edi)
|
||||
movl %edx, %esi
|
||||
# Round 8
|
||||
movl 8(%ebx), %eax
|
||||
mull %ebp
|
||||
addl %esi, %eax
|
||||
movl 8(%edi), %esi
|
||||
adcl $0, %edx
|
||||
addl %esi, %eax
|
||||
adcl $0, %edx
|
||||
movl %eax, 8(%edi)
|
||||
movl %edx, %esi
|
||||
# Round 12
|
||||
movl 12(%ebx), %eax
|
||||
mull %ebp
|
||||
addl %esi, %eax
|
||||
movl 12(%edi), %esi
|
||||
adcl $0, %edx
|
||||
addl %esi, %eax
|
||||
adcl $0, %edx
|
||||
movl %eax, 12(%edi)
|
||||
movl %edx, %esi
|
||||
# Round 16
|
||||
movl 16(%ebx), %eax
|
||||
mull %ebp
|
||||
addl %esi, %eax
|
||||
movl 16(%edi), %esi
|
||||
adcl $0, %edx
|
||||
addl %esi, %eax
|
||||
adcl $0, %edx
|
||||
movl %eax, 16(%edi)
|
||||
movl %edx, %esi
|
||||
# Round 20
|
||||
movl 20(%ebx), %eax
|
||||
mull %ebp
|
||||
addl %esi, %eax
|
||||
movl 20(%edi), %esi
|
||||
adcl $0, %edx
|
||||
addl %esi, %eax
|
||||
adcl $0, %edx
|
||||
movl %eax, 20(%edi)
|
||||
movl %edx, %esi
|
||||
# Round 24
|
||||
movl 24(%ebx), %eax
|
||||
mull %ebp
|
||||
addl %esi, %eax
|
||||
movl 24(%edi), %esi
|
||||
adcl $0, %edx
|
||||
addl %esi, %eax
|
||||
adcl $0, %edx
|
||||
movl %eax, 24(%edi)
|
||||
movl %edx, %esi
|
||||
# Round 28
|
||||
movl 28(%ebx), %eax
|
||||
mull %ebp
|
||||
addl %esi, %eax
|
||||
movl 28(%edi), %esi
|
||||
adcl $0, %edx
|
||||
addl %esi, %eax
|
||||
adcl $0, %edx
|
||||
movl %eax, 28(%edi)
|
||||
movl %edx, %esi
|
||||
|
||||
movl (%esp), %ecx
|
||||
addl $32, %ebx
|
||||
addl $32, %edi
|
||||
subl $8, %ecx
|
||||
jnz .L001maw_loop
|
||||
.L000maw_finish:
|
||||
movl 32(%esp), %ecx
|
||||
andl $7, %ecx
|
||||
jnz .L002maw_finish2
|
||||
jmp .L003maw_end
|
||||
.align 16
|
||||
.L002maw_finish2:
|
||||
# Tail Round 0
|
||||
movl (%ebx), %eax
|
||||
mull %ebp
|
||||
addl %esi, %eax
|
||||
movl (%edi), %esi
|
||||
adcl $0, %edx
|
||||
addl %esi, %eax
|
||||
adcl $0, %edx
|
||||
decl %ecx
|
||||
movl %eax, (%edi)
|
||||
movl %edx, %esi
|
||||
jz .L003maw_end
|
||||
# Tail Round 1
|
||||
movl 4(%ebx), %eax
|
||||
mull %ebp
|
||||
addl %esi, %eax
|
||||
movl 4(%edi), %esi
|
||||
adcl $0, %edx
|
||||
addl %esi, %eax
|
||||
adcl $0, %edx
|
||||
decl %ecx
|
||||
movl %eax, 4(%edi)
|
||||
movl %edx, %esi
|
||||
jz .L003maw_end
|
||||
# Tail Round 2
|
||||
movl 8(%ebx), %eax
|
||||
mull %ebp
|
||||
addl %esi, %eax
|
||||
movl 8(%edi), %esi
|
||||
adcl $0, %edx
|
||||
addl %esi, %eax
|
||||
adcl $0, %edx
|
||||
decl %ecx
|
||||
movl %eax, 8(%edi)
|
||||
movl %edx, %esi
|
||||
jz .L003maw_end
|
||||
# Tail Round 3
|
||||
movl 12(%ebx), %eax
|
||||
mull %ebp
|
||||
addl %esi, %eax
|
||||
movl 12(%edi), %esi
|
||||
adcl $0, %edx
|
||||
addl %esi, %eax
|
||||
adcl $0, %edx
|
||||
decl %ecx
|
||||
movl %eax, 12(%edi)
|
||||
movl %edx, %esi
|
||||
jz .L003maw_end
|
||||
# Tail Round 4
|
||||
movl 16(%ebx), %eax
|
||||
mull %ebp
|
||||
addl %esi, %eax
|
||||
movl 16(%edi), %esi
|
||||
adcl $0, %edx
|
||||
addl %esi, %eax
|
||||
adcl $0, %edx
|
||||
decl %ecx
|
||||
movl %eax, 16(%edi)
|
||||
movl %edx, %esi
|
||||
jz .L003maw_end
|
||||
# Tail Round 5
|
||||
movl 20(%ebx), %eax
|
||||
mull %ebp
|
||||
addl %esi, %eax
|
||||
movl 20(%edi), %esi
|
||||
adcl $0, %edx
|
||||
addl %esi, %eax
|
||||
adcl $0, %edx
|
||||
decl %ecx
|
||||
movl %eax, 20(%edi)
|
||||
movl %edx, %esi
|
||||
jz .L003maw_end
|
||||
# Tail Round 6
|
||||
movl 24(%ebx), %eax
|
||||
mull %ebp
|
||||
addl %esi, %eax
|
||||
movl 24(%edi), %esi
|
||||
adcl $0, %edx
|
||||
addl %esi, %eax
|
||||
adcl $0, %edx
|
||||
movl %eax, 24(%edi)
|
||||
movl %edx, %esi
|
||||
.L003maw_end:
|
||||
movl %esi, %eax
|
||||
popl %ecx
|
||||
popl %edi
|
||||
popl %esi
|
||||
popl %ebx
|
||||
popl %ebp
|
||||
ret
|
||||
.bn_mul_add_words_end:
|
||||
.size bn_mul_add_words,.bn_mul_add_words_end-bn_mul_add_words
|
||||
.ident "bn_mul_add_words"
|
||||
.text
|
||||
.align 16
|
||||
.globl bn_mul_words
|
||||
.type bn_mul_words,@function
|
||||
bn_mul_words:
|
||||
pushl %ebp
|
||||
pushl %ebx
|
||||
pushl %esi
|
||||
pushl %edi
|
||||
|
||||
|
||||
xorl %esi, %esi
|
||||
movl 20(%esp), %edi
|
||||
movl 24(%esp), %ebx
|
||||
movl 28(%esp), %ebp
|
||||
movl 32(%esp), %ecx
|
||||
andl $4294967288, %ebp
|
||||
jz .L004mw_finish
|
||||
.L005mw_loop:
|
||||
# Round 0
|
||||
movl (%ebx), %eax
|
||||
mull %ecx
|
||||
addl %esi, %eax
|
||||
adcl $0, %edx
|
||||
movl %eax, (%edi)
|
||||
movl %edx, %esi
|
||||
# Round 4
|
||||
movl 4(%ebx), %eax
|
||||
mull %ecx
|
||||
addl %esi, %eax
|
||||
adcl $0, %edx
|
||||
movl %eax, 4(%edi)
|
||||
movl %edx, %esi
|
||||
# Round 8
|
||||
movl 8(%ebx), %eax
|
||||
mull %ecx
|
||||
addl %esi, %eax
|
||||
adcl $0, %edx
|
||||
movl %eax, 8(%edi)
|
||||
movl %edx, %esi
|
||||
# Round 12
|
||||
movl 12(%ebx), %eax
|
||||
mull %ecx
|
||||
addl %esi, %eax
|
||||
adcl $0, %edx
|
||||
movl %eax, 12(%edi)
|
||||
movl %edx, %esi
|
||||
# Round 16
|
||||
movl 16(%ebx), %eax
|
||||
mull %ecx
|
||||
addl %esi, %eax
|
||||
adcl $0, %edx
|
||||
movl %eax, 16(%edi)
|
||||
movl %edx, %esi
|
||||
# Round 20
|
||||
movl 20(%ebx), %eax
|
||||
mull %ecx
|
||||
addl %esi, %eax
|
||||
adcl $0, %edx
|
||||
movl %eax, 20(%edi)
|
||||
movl %edx, %esi
|
||||
# Round 24
|
||||
movl 24(%ebx), %eax
|
||||
mull %ecx
|
||||
addl %esi, %eax
|
||||
adcl $0, %edx
|
||||
movl %eax, 24(%edi)
|
||||
movl %edx, %esi
|
||||
# Round 28
|
||||
movl 28(%ebx), %eax
|
||||
mull %ecx
|
||||
addl %esi, %eax
|
||||
adcl $0, %edx
|
||||
movl %eax, 28(%edi)
|
||||
movl %edx, %esi
|
||||
|
||||
addl $32, %ebx
|
||||
addl $32, %edi
|
||||
subl $8, %ebp
|
||||
jz .L004mw_finish
|
||||
jmp .L005mw_loop
|
||||
.L004mw_finish:
|
||||
movl 28(%esp), %ebp
|
||||
andl $7, %ebp
|
||||
jnz .L006mw_finish2
|
||||
jmp .L007mw_end
|
||||
.align 16
|
||||
.L006mw_finish2:
|
||||
# Tail Round 0
|
||||
movl (%ebx), %eax
|
||||
mull %ecx
|
||||
addl %esi, %eax
|
||||
adcl $0, %edx
|
||||
movl %eax, (%edi)
|
||||
movl %edx, %esi
|
||||
decl %ebp
|
||||
jz .L007mw_end
|
||||
# Tail Round 1
|
||||
movl 4(%ebx), %eax
|
||||
mull %ecx
|
||||
addl %esi, %eax
|
||||
adcl $0, %edx
|
||||
movl %eax, 4(%edi)
|
||||
movl %edx, %esi
|
||||
decl %ebp
|
||||
jz .L007mw_end
|
||||
# Tail Round 2
|
||||
movl 8(%ebx), %eax
|
||||
mull %ecx
|
||||
addl %esi, %eax
|
||||
adcl $0, %edx
|
||||
movl %eax, 8(%edi)
|
||||
movl %edx, %esi
|
||||
decl %ebp
|
||||
jz .L007mw_end
|
||||
# Tail Round 3
|
||||
movl 12(%ebx), %eax
|
||||
mull %ecx
|
||||
addl %esi, %eax
|
||||
adcl $0, %edx
|
||||
movl %eax, 12(%edi)
|
||||
movl %edx, %esi
|
||||
decl %ebp
|
||||
jz .L007mw_end
|
||||
# Tail Round 4
|
||||
movl 16(%ebx), %eax
|
||||
mull %ecx
|
||||
addl %esi, %eax
|
||||
adcl $0, %edx
|
||||
movl %eax, 16(%edi)
|
||||
movl %edx, %esi
|
||||
decl %ebp
|
||||
jz .L007mw_end
|
||||
# Tail Round 5
|
||||
movl 20(%ebx), %eax
|
||||
mull %ecx
|
||||
addl %esi, %eax
|
||||
adcl $0, %edx
|
||||
movl %eax, 20(%edi)
|
||||
movl %edx, %esi
|
||||
decl %ebp
|
||||
jz .L007mw_end
|
||||
# Tail Round 6
|
||||
movl 24(%ebx), %eax
|
||||
mull %ecx
|
||||
addl %esi, %eax
|
||||
adcl $0, %edx
|
||||
movl %eax, 24(%edi)
|
||||
movl %edx, %esi
|
||||
.L007mw_end:
|
||||
movl %esi, %eax
|
||||
popl %edi
|
||||
popl %esi
|
||||
popl %ebx
|
||||
popl %ebp
|
||||
ret
|
||||
.bn_mul_words_end:
|
||||
.size bn_mul_words,.bn_mul_words_end-bn_mul_words
|
||||
.ident "bn_mul_words"
|
||||
.text
|
||||
.align 16
|
||||
.globl bn_sqr_words
|
||||
.type bn_sqr_words,@function
|
||||
bn_sqr_words:
|
||||
pushl %ebp
|
||||
pushl %ebx
|
||||
pushl %esi
|
||||
pushl %edi
|
||||
|
||||
|
||||
movl 20(%esp), %esi
|
||||
movl 24(%esp), %edi
|
||||
movl 28(%esp), %ebx
|
||||
andl $4294967288, %ebx
|
||||
jz .L008sw_finish
|
||||
.L009sw_loop:
|
||||
# Round 0
|
||||
movl (%edi), %eax
|
||||
mull %eax
|
||||
movl %eax, (%esi)
|
||||
movl %edx, 4(%esi)
|
||||
# Round 4
|
||||
movl 4(%edi), %eax
|
||||
mull %eax
|
||||
movl %eax, 8(%esi)
|
||||
movl %edx, 12(%esi)
|
||||
# Round 8
|
||||
movl 8(%edi), %eax
|
||||
mull %eax
|
||||
movl %eax, 16(%esi)
|
||||
movl %edx, 20(%esi)
|
||||
# Round 12
|
||||
movl 12(%edi), %eax
|
||||
mull %eax
|
||||
movl %eax, 24(%esi)
|
||||
movl %edx, 28(%esi)
|
||||
# Round 16
|
||||
movl 16(%edi), %eax
|
||||
mull %eax
|
||||
movl %eax, 32(%esi)
|
||||
movl %edx, 36(%esi)
|
||||
# Round 20
|
||||
movl 20(%edi), %eax
|
||||
mull %eax
|
||||
movl %eax, 40(%esi)
|
||||
movl %edx, 44(%esi)
|
||||
# Round 24
|
||||
movl 24(%edi), %eax
|
||||
mull %eax
|
||||
movl %eax, 48(%esi)
|
||||
movl %edx, 52(%esi)
|
||||
# Round 28
|
||||
movl 28(%edi), %eax
|
||||
mull %eax
|
||||
movl %eax, 56(%esi)
|
||||
movl %edx, 60(%esi)
|
||||
|
||||
addl $32, %edi
|
||||
addl $64, %esi
|
||||
subl $8, %ebx
|
||||
jnz .L009sw_loop
|
||||
.L008sw_finish:
|
||||
movl 28(%esp), %ebx
|
||||
andl $7, %ebx
|
||||
jz .L010sw_end
|
||||
# Tail Round 0
|
||||
movl (%edi), %eax
|
||||
mull %eax
|
||||
movl %eax, (%esi)
|
||||
decl %ebx
|
||||
movl %edx, 4(%esi)
|
||||
jz .L010sw_end
|
||||
# Tail Round 1
|
||||
movl 4(%edi), %eax
|
||||
mull %eax
|
||||
movl %eax, 8(%esi)
|
||||
decl %ebx
|
||||
movl %edx, 12(%esi)
|
||||
jz .L010sw_end
|
||||
# Tail Round 2
|
||||
movl 8(%edi), %eax
|
||||
mull %eax
|
||||
movl %eax, 16(%esi)
|
||||
decl %ebx
|
||||
movl %edx, 20(%esi)
|
||||
jz .L010sw_end
|
||||
# Tail Round 3
|
||||
movl 12(%edi), %eax
|
||||
mull %eax
|
||||
movl %eax, 24(%esi)
|
||||
decl %ebx
|
||||
movl %edx, 28(%esi)
|
||||
jz .L010sw_end
|
||||
# Tail Round 4
|
||||
movl 16(%edi), %eax
|
||||
mull %eax
|
||||
movl %eax, 32(%esi)
|
||||
decl %ebx
|
||||
movl %edx, 36(%esi)
|
||||
jz .L010sw_end
|
||||
# Tail Round 5
|
||||
movl 20(%edi), %eax
|
||||
mull %eax
|
||||
movl %eax, 40(%esi)
|
||||
decl %ebx
|
||||
movl %edx, 44(%esi)
|
||||
jz .L010sw_end
|
||||
# Tail Round 6
|
||||
movl 24(%edi), %eax
|
||||
mull %eax
|
||||
movl %eax, 48(%esi)
|
||||
movl %edx, 52(%esi)
|
||||
.L010sw_end:
|
||||
popl %edi
|
||||
popl %esi
|
||||
popl %ebx
|
||||
popl %ebp
|
||||
ret
|
||||
.bn_sqr_words_end:
|
||||
.size bn_sqr_words,.bn_sqr_words_end-bn_sqr_words
|
||||
.ident "bn_sqr_words"
|
||||
.text
|
||||
.align 16
|
||||
.globl bn_div_words
|
||||
.type bn_div_words,@function
|
||||
bn_div_words:
|
||||
pushl %ebp
|
||||
pushl %ebx
|
||||
pushl %esi
|
||||
pushl %edi
|
||||
|
||||
movl 20(%esp), %edx
|
||||
movl 24(%esp), %eax
|
||||
movl 28(%esp), %ebx
|
||||
divl %ebx
|
||||
popl %edi
|
||||
popl %esi
|
||||
popl %ebx
|
||||
popl %ebp
|
||||
ret
|
||||
.bn_div_words_end:
|
||||
.size bn_div_words,.bn_div_words_end-bn_div_words
|
||||
.ident "bn_div_words"
|
||||
.text
|
||||
.align 16
|
||||
.globl bn_add_words
|
||||
.type bn_add_words,@function
|
||||
bn_add_words:
|
||||
pushl %ebp
|
||||
pushl %ebx
|
||||
pushl %esi
|
||||
pushl %edi
|
||||
|
||||
|
||||
movl 20(%esp), %ebx
|
||||
movl 24(%esp), %esi
|
||||
movl 28(%esp), %edi
|
||||
movl 32(%esp), %ebp
|
||||
xorl %eax, %eax
|
||||
andl $4294967288, %ebp
|
||||
jz .L011aw_finish
|
||||
.L012aw_loop:
|
||||
# Round 0
|
||||
movl (%esi), %ecx
|
||||
movl (%edi), %edx
|
||||
addl %eax, %ecx
|
||||
movl $0, %eax
|
||||
adcl %eax, %eax
|
||||
addl %edx, %ecx
|
||||
adcl $0, %eax
|
||||
movl %ecx, (%ebx)
|
||||
# Round 1
|
||||
movl 4(%esi), %ecx
|
||||
movl 4(%edi), %edx
|
||||
addl %eax, %ecx
|
||||
movl $0, %eax
|
||||
adcl %eax, %eax
|
||||
addl %edx, %ecx
|
||||
adcl $0, %eax
|
||||
movl %ecx, 4(%ebx)
|
||||
# Round 2
|
||||
movl 8(%esi), %ecx
|
||||
movl 8(%edi), %edx
|
||||
addl %eax, %ecx
|
||||
movl $0, %eax
|
||||
adcl %eax, %eax
|
||||
addl %edx, %ecx
|
||||
adcl $0, %eax
|
||||
movl %ecx, 8(%ebx)
|
||||
# Round 3
|
||||
movl 12(%esi), %ecx
|
||||
movl 12(%edi), %edx
|
||||
addl %eax, %ecx
|
||||
movl $0, %eax
|
||||
adcl %eax, %eax
|
||||
addl %edx, %ecx
|
||||
adcl $0, %eax
|
||||
movl %ecx, 12(%ebx)
|
||||
# Round 4
|
||||
movl 16(%esi), %ecx
|
||||
movl 16(%edi), %edx
|
||||
addl %eax, %ecx
|
||||
movl $0, %eax
|
||||
adcl %eax, %eax
|
||||
addl %edx, %ecx
|
||||
adcl $0, %eax
|
||||
movl %ecx, 16(%ebx)
|
||||
# Round 5
|
||||
movl 20(%esi), %ecx
|
||||
movl 20(%edi), %edx
|
||||
addl %eax, %ecx
|
||||
movl $0, %eax
|
||||
adcl %eax, %eax
|
||||
addl %edx, %ecx
|
||||
adcl $0, %eax
|
||||
movl %ecx, 20(%ebx)
|
||||
# Round 6
|
||||
movl 24(%esi), %ecx
|
||||
movl 24(%edi), %edx
|
||||
addl %eax, %ecx
|
||||
movl $0, %eax
|
||||
adcl %eax, %eax
|
||||
addl %edx, %ecx
|
||||
adcl $0, %eax
|
||||
movl %ecx, 24(%ebx)
|
||||
# Round 7
|
||||
movl 28(%esi), %ecx
|
||||
movl 28(%edi), %edx
|
||||
addl %eax, %ecx
|
||||
movl $0, %eax
|
||||
adcl %eax, %eax
|
||||
addl %edx, %ecx
|
||||
adcl $0, %eax
|
||||
movl %ecx, 28(%ebx)
|
||||
|
||||
addl $32, %esi
|
||||
addl $32, %edi
|
||||
addl $32, %ebx
|
||||
subl $8, %ebp
|
||||
jnz .L012aw_loop
|
||||
.L011aw_finish:
|
||||
movl 32(%esp), %ebp
|
||||
andl $7, %ebp
|
||||
jz .L013aw_end
|
||||
# Tail Round 0
|
||||
movl (%esi), %ecx
|
||||
movl (%edi), %edx
|
||||
addl %eax, %ecx
|
||||
movl $0, %eax
|
||||
adcl %eax, %eax
|
||||
addl %edx, %ecx
|
||||
adcl $0, %eax
|
||||
decl %ebp
|
||||
movl %ecx, (%ebx)
|
||||
jz .L013aw_end
|
||||
# Tail Round 1
|
||||
movl 4(%esi), %ecx
|
||||
movl 4(%edi), %edx
|
||||
addl %eax, %ecx
|
||||
movl $0, %eax
|
||||
adcl %eax, %eax
|
||||
addl %edx, %ecx
|
||||
adcl $0, %eax
|
||||
decl %ebp
|
||||
movl %ecx, 4(%ebx)
|
||||
jz .L013aw_end
|
||||
# Tail Round 2
|
||||
movl 8(%esi), %ecx
|
||||
movl 8(%edi), %edx
|
||||
addl %eax, %ecx
|
||||
movl $0, %eax
|
||||
adcl %eax, %eax
|
||||
addl %edx, %ecx
|
||||
adcl $0, %eax
|
||||
decl %ebp
|
||||
movl %ecx, 8(%ebx)
|
||||
jz .L013aw_end
|
||||
# Tail Round 3
|
||||
movl 12(%esi), %ecx
|
||||
movl 12(%edi), %edx
|
||||
addl %eax, %ecx
|
||||
movl $0, %eax
|
||||
adcl %eax, %eax
|
||||
addl %edx, %ecx
|
||||
adcl $0, %eax
|
||||
decl %ebp
|
||||
movl %ecx, 12(%ebx)
|
||||
jz .L013aw_end
|
||||
# Tail Round 4
|
||||
movl 16(%esi), %ecx
|
||||
movl 16(%edi), %edx
|
||||
addl %eax, %ecx
|
||||
movl $0, %eax
|
||||
adcl %eax, %eax
|
||||
addl %edx, %ecx
|
||||
adcl $0, %eax
|
||||
decl %ebp
|
||||
movl %ecx, 16(%ebx)
|
||||
jz .L013aw_end
|
||||
# Tail Round 5
|
||||
movl 20(%esi), %ecx
|
||||
movl 20(%edi), %edx
|
||||
addl %eax, %ecx
|
||||
movl $0, %eax
|
||||
adcl %eax, %eax
|
||||
addl %edx, %ecx
|
||||
adcl $0, %eax
|
||||
decl %ebp
|
||||
movl %ecx, 20(%ebx)
|
||||
jz .L013aw_end
|
||||
# Tail Round 6
|
||||
movl 24(%esi), %ecx
|
||||
movl 24(%edi), %edx
|
||||
addl %eax, %ecx
|
||||
movl $0, %eax
|
||||
adcl %eax, %eax
|
||||
addl %edx, %ecx
|
||||
adcl $0, %eax
|
||||
movl %ecx, 24(%ebx)
|
||||
.L013aw_end:
|
||||
popl %edi
|
||||
popl %esi
|
||||
popl %ebx
|
||||
popl %ebp
|
||||
ret
|
||||
.bn_add_words_end:
|
||||
.size bn_add_words,.bn_add_words_end-bn_add_words
|
||||
.ident "bn_add_words"
|
||||
.text
|
||||
.align 16
|
||||
.globl bn_sub_words
|
||||
.type bn_sub_words,@function
|
||||
bn_sub_words:
|
||||
pushl %ebp
|
||||
pushl %ebx
|
||||
pushl %esi
|
||||
pushl %edi
|
||||
|
||||
|
||||
movl 20(%esp), %ebx
|
||||
movl 24(%esp), %esi
|
||||
movl 28(%esp), %edi
|
||||
movl 32(%esp), %ebp
|
||||
xorl %eax, %eax
|
||||
andl $4294967288, %ebp
|
||||
jz .L014aw_finish
|
||||
.L015aw_loop:
|
||||
# Round 0
|
||||
movl (%esi), %ecx
|
||||
movl (%edi), %edx
|
||||
subl %eax, %ecx
|
||||
movl $0, %eax
|
||||
adcl %eax, %eax
|
||||
subl %edx, %ecx
|
||||
adcl $0, %eax
|
||||
movl %ecx, (%ebx)
|
||||
# Round 1
|
||||
movl 4(%esi), %ecx
|
||||
movl 4(%edi), %edx
|
||||
subl %eax, %ecx
|
||||
movl $0, %eax
|
||||
adcl %eax, %eax
|
||||
subl %edx, %ecx
|
||||
adcl $0, %eax
|
||||
movl %ecx, 4(%ebx)
|
||||
# Round 2
|
||||
movl 8(%esi), %ecx
|
||||
movl 8(%edi), %edx
|
||||
subl %eax, %ecx
|
||||
movl $0, %eax
|
||||
adcl %eax, %eax
|
||||
subl %edx, %ecx
|
||||
adcl $0, %eax
|
||||
movl %ecx, 8(%ebx)
|
||||
# Round 3
|
||||
movl 12(%esi), %ecx
|
||||
movl 12(%edi), %edx
|
||||
subl %eax, %ecx
|
||||
movl $0, %eax
|
||||
adcl %eax, %eax
|
||||
subl %edx, %ecx
|
||||
adcl $0, %eax
|
||||
movl %ecx, 12(%ebx)
|
||||
# Round 4
|
||||
movl 16(%esi), %ecx
|
||||
movl 16(%edi), %edx
|
||||
subl %eax, %ecx
|
||||
movl $0, %eax
|
||||
adcl %eax, %eax
|
||||
subl %edx, %ecx
|
||||
adcl $0, %eax
|
||||
movl %ecx, 16(%ebx)
|
||||
# Round 5
|
||||
movl 20(%esi), %ecx
|
||||
movl 20(%edi), %edx
|
||||
subl %eax, %ecx
|
||||
movl $0, %eax
|
||||
adcl %eax, %eax
|
||||
subl %edx, %ecx
|
||||
adcl $0, %eax
|
||||
movl %ecx, 20(%ebx)
|
||||
# Round 6
|
||||
movl 24(%esi), %ecx
|
||||
movl 24(%edi), %edx
|
||||
subl %eax, %ecx
|
||||
movl $0, %eax
|
||||
adcl %eax, %eax
|
||||
subl %edx, %ecx
|
||||
adcl $0, %eax
|
||||
movl %ecx, 24(%ebx)
|
||||
# Round 7
|
||||
movl 28(%esi), %ecx
|
||||
movl 28(%edi), %edx
|
||||
subl %eax, %ecx
|
||||
movl $0, %eax
|
||||
adcl %eax, %eax
|
||||
subl %edx, %ecx
|
||||
adcl $0, %eax
|
||||
movl %ecx, 28(%ebx)
|
||||
|
||||
addl $32, %esi
|
||||
addl $32, %edi
|
||||
addl $32, %ebx
|
||||
subl $8, %ebp
|
||||
jnz .L015aw_loop
|
||||
.L014aw_finish:
|
||||
movl 32(%esp), %ebp
|
||||
andl $7, %ebp
|
||||
jz .L016aw_end
|
||||
# Tail Round 0
|
||||
movl (%esi), %ecx
|
||||
movl (%edi), %edx
|
||||
subl %eax, %ecx
|
||||
movl $0, %eax
|
||||
adcl %eax, %eax
|
||||
subl %edx, %ecx
|
||||
adcl $0, %eax
|
||||
decl %ebp
|
||||
movl %ecx, (%ebx)
|
||||
jz .L016aw_end
|
||||
# Tail Round 1
|
||||
movl 4(%esi), %ecx
|
||||
movl 4(%edi), %edx
|
||||
subl %eax, %ecx
|
||||
movl $0, %eax
|
||||
adcl %eax, %eax
|
||||
subl %edx, %ecx
|
||||
adcl $0, %eax
|
||||
decl %ebp
|
||||
movl %ecx, 4(%ebx)
|
||||
jz .L016aw_end
|
||||
# Tail Round 2
|
||||
movl 8(%esi), %ecx
|
||||
movl 8(%edi), %edx
|
||||
subl %eax, %ecx
|
||||
movl $0, %eax
|
||||
adcl %eax, %eax
|
||||
subl %edx, %ecx
|
||||
adcl $0, %eax
|
||||
decl %ebp
|
||||
movl %ecx, 8(%ebx)
|
||||
jz .L016aw_end
|
||||
# Tail Round 3
|
||||
movl 12(%esi), %ecx
|
||||
movl 12(%edi), %edx
|
||||
subl %eax, %ecx
|
||||
movl $0, %eax
|
||||
adcl %eax, %eax
|
||||
subl %edx, %ecx
|
||||
adcl $0, %eax
|
||||
decl %ebp
|
||||
movl %ecx, 12(%ebx)
|
||||
jz .L016aw_end
|
||||
# Tail Round 4
|
||||
movl 16(%esi), %ecx
|
||||
movl 16(%edi), %edx
|
||||
subl %eax, %ecx
|
||||
movl $0, %eax
|
||||
adcl %eax, %eax
|
||||
subl %edx, %ecx
|
||||
adcl $0, %eax
|
||||
decl %ebp
|
||||
movl %ecx, 16(%ebx)
|
||||
jz .L016aw_end
|
||||
# Tail Round 5
|
||||
movl 20(%esi), %ecx
|
||||
movl 20(%edi), %edx
|
||||
subl %eax, %ecx
|
||||
movl $0, %eax
|
||||
adcl %eax, %eax
|
||||
subl %edx, %ecx
|
||||
adcl $0, %eax
|
||||
decl %ebp
|
||||
movl %ecx, 20(%ebx)
|
||||
jz .L016aw_end
|
||||
# Tail Round 6
|
||||
movl 24(%esi), %ecx
|
||||
movl 24(%edi), %edx
|
||||
subl %eax, %ecx
|
||||
movl $0, %eax
|
||||
adcl %eax, %eax
|
||||
subl %edx, %ecx
|
||||
adcl $0, %eax
|
||||
movl %ecx, 24(%ebx)
|
||||
.L016aw_end:
|
||||
popl %edi
|
||||
popl %esi
|
||||
popl %ebx
|
||||
popl %ebp
|
||||
ret
|
||||
.bn_sub_words_end:
|
||||
.size bn_sub_words,.bn_sub_words_end-bn_sub_words
|
||||
.ident "bn_sub_words"
|
||||
@@ -1,971 +0,0 @@
|
||||
# $FreeBSD$
|
||||
# Dont even think of reading this code
|
||||
# It was automatically generated by cast-586.pl
|
||||
# Which is a perl program used to generate the x86 assember for
|
||||
# any of elf, a.out, BSDI, Win32, gaswin (for GNU as on Win32) or Solaris
|
||||
# eric <eay@cryptsoft.com>
|
||||
|
||||
.file "cast-586.s"
|
||||
.version "01.01"
|
||||
gcc2_compiled.:
|
||||
.text
|
||||
.align 16
|
||||
.globl CAST_encrypt
|
||||
.type CAST_encrypt,@function
|
||||
CAST_encrypt:
|
||||
|
||||
pushl %ebp
|
||||
pushl %ebx
|
||||
movl 12(%esp), %ebx
|
||||
movl 16(%esp), %ebp
|
||||
pushl %esi
|
||||
pushl %edi
|
||||
# Load the 2 words
|
||||
movl (%ebx), %edi
|
||||
movl 4(%ebx), %esi
|
||||
# Get short key flag
|
||||
movl 128(%ebp), %eax
|
||||
pushl %eax
|
||||
xorl %eax, %eax
|
||||
# round 0
|
||||
movl (%ebp), %edx
|
||||
movl 4(%ebp), %ecx
|
||||
addl %esi, %edx
|
||||
roll %cl, %edx
|
||||
movl %edx, %ebx
|
||||
xorl %ecx, %ecx
|
||||
movb %dh, %cl
|
||||
andl $255, %ebx
|
||||
shrl $16, %edx
|
||||
xorl %eax, %eax
|
||||
movb %dh, %al
|
||||
andl $255, %edx
|
||||
movl CAST_S_table0(,%ecx,4),%ecx
|
||||
movl CAST_S_table1(,%ebx,4),%ebx
|
||||
xorl %ebx, %ecx
|
||||
movl CAST_S_table2(,%eax,4),%ebx
|
||||
subl %ebx, %ecx
|
||||
movl CAST_S_table3(,%edx,4),%ebx
|
||||
addl %ebx, %ecx
|
||||
xorl %ecx, %edi
|
||||
# round 1
|
||||
movl 8(%ebp), %edx
|
||||
movl 12(%ebp), %ecx
|
||||
xorl %edi, %edx
|
||||
roll %cl, %edx
|
||||
movl %edx, %ebx
|
||||
xorl %ecx, %ecx
|
||||
movb %dh, %cl
|
||||
andl $255, %ebx
|
||||
shrl $16, %edx
|
||||
xorl %eax, %eax
|
||||
movb %dh, %al
|
||||
andl $255, %edx
|
||||
movl CAST_S_table0(,%ecx,4),%ecx
|
||||
movl CAST_S_table1(,%ebx,4),%ebx
|
||||
subl %ebx, %ecx
|
||||
movl CAST_S_table2(,%eax,4),%ebx
|
||||
addl %ebx, %ecx
|
||||
movl CAST_S_table3(,%edx,4),%ebx
|
||||
xorl %ebx, %ecx
|
||||
xorl %ecx, %esi
|
||||
# round 2
|
||||
movl 16(%ebp), %edx
|
||||
movl 20(%ebp), %ecx
|
||||
subl %esi, %edx
|
||||
roll %cl, %edx
|
||||
movl %edx, %ebx
|
||||
xorl %ecx, %ecx
|
||||
movb %dh, %cl
|
||||
andl $255, %ebx
|
||||
shrl $16, %edx
|
||||
xorl %eax, %eax
|
||||
movb %dh, %al
|
||||
andl $255, %edx
|
||||
movl CAST_S_table0(,%ecx,4),%ecx
|
||||
movl CAST_S_table1(,%ebx,4),%ebx
|
||||
addl %ebx, %ecx
|
||||
movl CAST_S_table2(,%eax,4),%ebx
|
||||
xorl %ebx, %ecx
|
||||
movl CAST_S_table3(,%edx,4),%ebx
|
||||
subl %ebx, %ecx
|
||||
xorl %ecx, %edi
|
||||
# round 3
|
||||
movl 24(%ebp), %edx
|
||||
movl 28(%ebp), %ecx
|
||||
addl %edi, %edx
|
||||
roll %cl, %edx
|
||||
movl %edx, %ebx
|
||||
xorl %ecx, %ecx
|
||||
movb %dh, %cl
|
||||
andl $255, %ebx
|
||||
shrl $16, %edx
|
||||
xorl %eax, %eax
|
||||
movb %dh, %al
|
||||
andl $255, %edx
|
||||
movl CAST_S_table0(,%ecx,4),%ecx
|
||||
movl CAST_S_table1(,%ebx,4),%ebx
|
||||
xorl %ebx, %ecx
|
||||
movl CAST_S_table2(,%eax,4),%ebx
|
||||
subl %ebx, %ecx
|
||||
movl CAST_S_table3(,%edx,4),%ebx
|
||||
addl %ebx, %ecx
|
||||
xorl %ecx, %esi
|
||||
# round 4
|
||||
movl 32(%ebp), %edx
|
||||
movl 36(%ebp), %ecx
|
||||
xorl %esi, %edx
|
||||
roll %cl, %edx
|
||||
movl %edx, %ebx
|
||||
xorl %ecx, %ecx
|
||||
movb %dh, %cl
|
||||
andl $255, %ebx
|
||||
shrl $16, %edx
|
||||
xorl %eax, %eax
|
||||
movb %dh, %al
|
||||
andl $255, %edx
|
||||
movl CAST_S_table0(,%ecx,4),%ecx
|
||||
movl CAST_S_table1(,%ebx,4),%ebx
|
||||
subl %ebx, %ecx
|
||||
movl CAST_S_table2(,%eax,4),%ebx
|
||||
addl %ebx, %ecx
|
||||
movl CAST_S_table3(,%edx,4),%ebx
|
||||
xorl %ebx, %ecx
|
||||
xorl %ecx, %edi
|
||||
# round 5
|
||||
movl 40(%ebp), %edx
|
||||
movl 44(%ebp), %ecx
|
||||
subl %edi, %edx
|
||||
roll %cl, %edx
|
||||
movl %edx, %ebx
|
||||
xorl %ecx, %ecx
|
||||
movb %dh, %cl
|
||||
andl $255, %ebx
|
||||
shrl $16, %edx
|
||||
xorl %eax, %eax
|
||||
movb %dh, %al
|
||||
andl $255, %edx
|
||||
movl CAST_S_table0(,%ecx,4),%ecx
|
||||
movl CAST_S_table1(,%ebx,4),%ebx
|
||||
addl %ebx, %ecx
|
||||
movl CAST_S_table2(,%eax,4),%ebx
|
||||
xorl %ebx, %ecx
|
||||
movl CAST_S_table3(,%edx,4),%ebx
|
||||
subl %ebx, %ecx
|
||||
xorl %ecx, %esi
|
||||
# round 6
|
||||
movl 48(%ebp), %edx
|
||||
movl 52(%ebp), %ecx
|
||||
addl %esi, %edx
|
||||
roll %cl, %edx
|
||||
movl %edx, %ebx
|
||||
xorl %ecx, %ecx
|
||||
movb %dh, %cl
|
||||
andl $255, %ebx
|
||||
shrl $16, %edx
|
||||
xorl %eax, %eax
|
||||
movb %dh, %al
|
||||
andl $255, %edx
|
||||
movl CAST_S_table0(,%ecx,4),%ecx
|
||||
movl CAST_S_table1(,%ebx,4),%ebx
|
||||
xorl %ebx, %ecx
|
||||
movl CAST_S_table2(,%eax,4),%ebx
|
||||
subl %ebx, %ecx
|
||||
movl CAST_S_table3(,%edx,4),%ebx
|
||||
addl %ebx, %ecx
|
||||
xorl %ecx, %edi
|
||||
# round 7
|
||||
movl 56(%ebp), %edx
|
||||
movl 60(%ebp), %ecx
|
||||
xorl %edi, %edx
|
||||
roll %cl, %edx
|
||||
movl %edx, %ebx
|
||||
xorl %ecx, %ecx
|
||||
movb %dh, %cl
|
||||
andl $255, %ebx
|
||||
shrl $16, %edx
|
||||
xorl %eax, %eax
|
||||
movb %dh, %al
|
||||
andl $255, %edx
|
||||
movl CAST_S_table0(,%ecx,4),%ecx
|
||||
movl CAST_S_table1(,%ebx,4),%ebx
|
||||
subl %ebx, %ecx
|
||||
movl CAST_S_table2(,%eax,4),%ebx
|
||||
addl %ebx, %ecx
|
||||
movl CAST_S_table3(,%edx,4),%ebx
|
||||
xorl %ebx, %ecx
|
||||
xorl %ecx, %esi
|
||||
# round 8
|
||||
movl 64(%ebp), %edx
|
||||
movl 68(%ebp), %ecx
|
||||
subl %esi, %edx
|
||||
roll %cl, %edx
|
||||
movl %edx, %ebx
|
||||
xorl %ecx, %ecx
|
||||
movb %dh, %cl
|
||||
andl $255, %ebx
|
||||
shrl $16, %edx
|
||||
xorl %eax, %eax
|
||||
movb %dh, %al
|
||||
andl $255, %edx
|
||||
movl CAST_S_table0(,%ecx,4),%ecx
|
||||
movl CAST_S_table1(,%ebx,4),%ebx
|
||||
addl %ebx, %ecx
|
||||
movl CAST_S_table2(,%eax,4),%ebx
|
||||
xorl %ebx, %ecx
|
||||
movl CAST_S_table3(,%edx,4),%ebx
|
||||
subl %ebx, %ecx
|
||||
xorl %ecx, %edi
|
||||
# round 9
|
||||
movl 72(%ebp), %edx
|
||||
movl 76(%ebp), %ecx
|
||||
addl %edi, %edx
|
||||
roll %cl, %edx
|
||||
movl %edx, %ebx
|
||||
xorl %ecx, %ecx
|
||||
movb %dh, %cl
|
||||
andl $255, %ebx
|
||||
shrl $16, %edx
|
||||
xorl %eax, %eax
|
||||
movb %dh, %al
|
||||
andl $255, %edx
|
||||
movl CAST_S_table0(,%ecx,4),%ecx
|
||||
movl CAST_S_table1(,%ebx,4),%ebx
|
||||
xorl %ebx, %ecx
|
||||
movl CAST_S_table2(,%eax,4),%ebx
|
||||
subl %ebx, %ecx
|
||||
movl CAST_S_table3(,%edx,4),%ebx
|
||||
addl %ebx, %ecx
|
||||
xorl %ecx, %esi
|
||||
# round 10
|
||||
movl 80(%ebp), %edx
|
||||
movl 84(%ebp), %ecx
|
||||
xorl %esi, %edx
|
||||
roll %cl, %edx
|
||||
movl %edx, %ebx
|
||||
xorl %ecx, %ecx
|
||||
movb %dh, %cl
|
||||
andl $255, %ebx
|
||||
shrl $16, %edx
|
||||
xorl %eax, %eax
|
||||
movb %dh, %al
|
||||
andl $255, %edx
|
||||
movl CAST_S_table0(,%ecx,4),%ecx
|
||||
movl CAST_S_table1(,%ebx,4),%ebx
|
||||
subl %ebx, %ecx
|
||||
movl CAST_S_table2(,%eax,4),%ebx
|
||||
addl %ebx, %ecx
|
||||
movl CAST_S_table3(,%edx,4),%ebx
|
||||
xorl %ebx, %ecx
|
||||
xorl %ecx, %edi
|
||||
# round 11
|
||||
movl 88(%ebp), %edx
|
||||
movl 92(%ebp), %ecx
|
||||
subl %edi, %edx
|
||||
roll %cl, %edx
|
||||
movl %edx, %ebx
|
||||
xorl %ecx, %ecx
|
||||
movb %dh, %cl
|
||||
andl $255, %ebx
|
||||
shrl $16, %edx
|
||||
xorl %eax, %eax
|
||||
movb %dh, %al
|
||||
andl $255, %edx
|
||||
movl CAST_S_table0(,%ecx,4),%ecx
|
||||
movl CAST_S_table1(,%ebx,4),%ebx
|
||||
addl %ebx, %ecx
|
||||
movl CAST_S_table2(,%eax,4),%ebx
|
||||
xorl %ebx, %ecx
|
||||
movl CAST_S_table3(,%edx,4),%ebx
|
||||
subl %ebx, %ecx
|
||||
xorl %ecx, %esi
|
||||
# test short key flag
|
||||
popl %edx
|
||||
orl %edx, %edx
|
||||
jnz .L000cast_enc_done
|
||||
# round 12
|
||||
movl 96(%ebp), %edx
|
||||
movl 100(%ebp), %ecx
|
||||
addl %esi, %edx
|
||||
roll %cl, %edx
|
||||
movl %edx, %ebx
|
||||
xorl %ecx, %ecx
|
||||
movb %dh, %cl
|
||||
andl $255, %ebx
|
||||
shrl $16, %edx
|
||||
xorl %eax, %eax
|
||||
movb %dh, %al
|
||||
andl $255, %edx
|
||||
movl CAST_S_table0(,%ecx,4),%ecx
|
||||
movl CAST_S_table1(,%ebx,4),%ebx
|
||||
xorl %ebx, %ecx
|
||||
movl CAST_S_table2(,%eax,4),%ebx
|
||||
subl %ebx, %ecx
|
||||
movl CAST_S_table3(,%edx,4),%ebx
|
||||
addl %ebx, %ecx
|
||||
xorl %ecx, %edi
|
||||
# round 13
|
||||
movl 104(%ebp), %edx
|
||||
movl 108(%ebp), %ecx
|
||||
xorl %edi, %edx
|
||||
roll %cl, %edx
|
||||
movl %edx, %ebx
|
||||
xorl %ecx, %ecx
|
||||
movb %dh, %cl
|
||||
andl $255, %ebx
|
||||
shrl $16, %edx
|
||||
xorl %eax, %eax
|
||||
movb %dh, %al
|
||||
andl $255, %edx
|
||||
movl CAST_S_table0(,%ecx,4),%ecx
|
||||
movl CAST_S_table1(,%ebx,4),%ebx
|
||||
subl %ebx, %ecx
|
||||
movl CAST_S_table2(,%eax,4),%ebx
|
||||
addl %ebx, %ecx
|
||||
movl CAST_S_table3(,%edx,4),%ebx
|
||||
xorl %ebx, %ecx
|
||||
xorl %ecx, %esi
|
||||
# round 14
|
||||
movl 112(%ebp), %edx
|
||||
movl 116(%ebp), %ecx
|
||||
subl %esi, %edx
|
||||
roll %cl, %edx
|
||||
movl %edx, %ebx
|
||||
xorl %ecx, %ecx
|
||||
movb %dh, %cl
|
||||
andl $255, %ebx
|
||||
shrl $16, %edx
|
||||
xorl %eax, %eax
|
||||
movb %dh, %al
|
||||
andl $255, %edx
|
||||
movl CAST_S_table0(,%ecx,4),%ecx
|
||||
movl CAST_S_table1(,%ebx,4),%ebx
|
||||
addl %ebx, %ecx
|
||||
movl CAST_S_table2(,%eax,4),%ebx
|
||||
xorl %ebx, %ecx
|
||||
movl CAST_S_table3(,%edx,4),%ebx
|
||||
subl %ebx, %ecx
|
||||
xorl %ecx, %edi
|
||||
# round 15
|
||||
movl 120(%ebp), %edx
|
||||
movl 124(%ebp), %ecx
|
||||
addl %edi, %edx
|
||||
roll %cl, %edx
|
||||
movl %edx, %ebx
|
||||
xorl %ecx, %ecx
|
||||
movb %dh, %cl
|
||||
andl $255, %ebx
|
||||
shrl $16, %edx
|
||||
xorl %eax, %eax
|
||||
movb %dh, %al
|
||||
andl $255, %edx
|
||||
movl CAST_S_table0(,%ecx,4),%ecx
|
||||
movl CAST_S_table1(,%ebx,4),%ebx
|
||||
xorl %ebx, %ecx
|
||||
movl CAST_S_table2(,%eax,4),%ebx
|
||||
subl %ebx, %ecx
|
||||
movl CAST_S_table3(,%edx,4),%ebx
|
||||
addl %ebx, %ecx
|
||||
xorl %ecx, %esi
|
||||
.L000cast_enc_done:
|
||||
nop
|
||||
movl 20(%esp), %eax
|
||||
movl %edi, 4(%eax)
|
||||
movl %esi, (%eax)
|
||||
popl %edi
|
||||
popl %esi
|
||||
popl %ebx
|
||||
popl %ebp
|
||||
ret
|
||||
.CAST_encrypt_end:
|
||||
.size CAST_encrypt,.CAST_encrypt_end-CAST_encrypt
|
||||
.ident "CAST_encrypt"
|
||||
.text
|
||||
.align 16
|
||||
.globl CAST_decrypt
|
||||
.type CAST_decrypt,@function
|
||||
CAST_decrypt:
|
||||
|
||||
pushl %ebp
|
||||
pushl %ebx
|
||||
movl 12(%esp), %ebx
|
||||
movl 16(%esp), %ebp
|
||||
pushl %esi
|
||||
pushl %edi
|
||||
# Load the 2 words
|
||||
movl (%ebx), %edi
|
||||
movl 4(%ebx), %esi
|
||||
# Get short key flag
|
||||
movl 128(%ebp), %eax
|
||||
orl %eax, %eax
|
||||
jnz .L001cast_dec_skip
|
||||
xorl %eax, %eax
|
||||
# round 15
|
||||
movl 120(%ebp), %edx
|
||||
movl 124(%ebp), %ecx
|
||||
addl %esi, %edx
|
||||
roll %cl, %edx
|
||||
movl %edx, %ebx
|
||||
xorl %ecx, %ecx
|
||||
movb %dh, %cl
|
||||
andl $255, %ebx
|
||||
shrl $16, %edx
|
||||
xorl %eax, %eax
|
||||
movb %dh, %al
|
||||
andl $255, %edx
|
||||
movl CAST_S_table0(,%ecx,4),%ecx
|
||||
movl CAST_S_table1(,%ebx,4),%ebx
|
||||
xorl %ebx, %ecx
|
||||
movl CAST_S_table2(,%eax,4),%ebx
|
||||
subl %ebx, %ecx
|
||||
movl CAST_S_table3(,%edx,4),%ebx
|
||||
addl %ebx, %ecx
|
||||
xorl %ecx, %edi
|
||||
# round 14
|
||||
movl 112(%ebp), %edx
|
||||
movl 116(%ebp), %ecx
|
||||
subl %edi, %edx
|
||||
roll %cl, %edx
|
||||
movl %edx, %ebx
|
||||
xorl %ecx, %ecx
|
||||
movb %dh, %cl
|
||||
andl $255, %ebx
|
||||
shrl $16, %edx
|
||||
xorl %eax, %eax
|
||||
movb %dh, %al
|
||||
andl $255, %edx
|
||||
movl CAST_S_table0(,%ecx,4),%ecx
|
||||
movl CAST_S_table1(,%ebx,4),%ebx
|
||||
addl %ebx, %ecx
|
||||
movl CAST_S_table2(,%eax,4),%ebx
|
||||
xorl %ebx, %ecx
|
||||
movl CAST_S_table3(,%edx,4),%ebx
|
||||
subl %ebx, %ecx
|
||||
xorl %ecx, %esi
|
||||
# round 13
|
||||
movl 104(%ebp), %edx
|
||||
movl 108(%ebp), %ecx
|
||||
xorl %esi, %edx
|
||||
roll %cl, %edx
|
||||
movl %edx, %ebx
|
||||
xorl %ecx, %ecx
|
||||
movb %dh, %cl
|
||||
andl $255, %ebx
|
||||
shrl $16, %edx
|
||||
xorl %eax, %eax
|
||||
movb %dh, %al
|
||||
andl $255, %edx
|
||||
movl CAST_S_table0(,%ecx,4),%ecx
|
||||
movl CAST_S_table1(,%ebx,4),%ebx
|
||||
subl %ebx, %ecx
|
||||
movl CAST_S_table2(,%eax,4),%ebx
|
||||
addl %ebx, %ecx
|
||||
movl CAST_S_table3(,%edx,4),%ebx
|
||||
xorl %ebx, %ecx
|
||||
xorl %ecx, %edi
|
||||
# round 12
|
||||
movl 96(%ebp), %edx
|
||||
movl 100(%ebp), %ecx
|
||||
addl %edi, %edx
|
||||
roll %cl, %edx
|
||||
movl %edx, %ebx
|
||||
xorl %ecx, %ecx
|
||||
movb %dh, %cl
|
||||
andl $255, %ebx
|
||||
shrl $16, %edx
|
||||
xorl %eax, %eax
|
||||
movb %dh, %al
|
||||
andl $255, %edx
|
||||
movl CAST_S_table0(,%ecx,4),%ecx
|
||||
movl CAST_S_table1(,%ebx,4),%ebx
|
||||
xorl %ebx, %ecx
|
||||
movl CAST_S_table2(,%eax,4),%ebx
|
||||
subl %ebx, %ecx
|
||||
movl CAST_S_table3(,%edx,4),%ebx
|
||||
addl %ebx, %ecx
|
||||
xorl %ecx, %esi
|
||||
.L001cast_dec_skip:
|
||||
# round 11
|
||||
movl 88(%ebp), %edx
|
||||
movl 92(%ebp), %ecx
|
||||
subl %esi, %edx
|
||||
roll %cl, %edx
|
||||
movl %edx, %ebx
|
||||
xorl %ecx, %ecx
|
||||
movb %dh, %cl
|
||||
andl $255, %ebx
|
||||
shrl $16, %edx
|
||||
xorl %eax, %eax
|
||||
movb %dh, %al
|
||||
andl $255, %edx
|
||||
movl CAST_S_table0(,%ecx,4),%ecx
|
||||
movl CAST_S_table1(,%ebx,4),%ebx
|
||||
addl %ebx, %ecx
|
||||
movl CAST_S_table2(,%eax,4),%ebx
|
||||
xorl %ebx, %ecx
|
||||
movl CAST_S_table3(,%edx,4),%ebx
|
||||
subl %ebx, %ecx
|
||||
xorl %ecx, %edi
|
||||
# round 10
|
||||
movl 80(%ebp), %edx
|
||||
movl 84(%ebp), %ecx
|
||||
xorl %edi, %edx
|
||||
roll %cl, %edx
|
||||
movl %edx, %ebx
|
||||
xorl %ecx, %ecx
|
||||
movb %dh, %cl
|
||||
andl $255, %ebx
|
||||
shrl $16, %edx
|
||||
xorl %eax, %eax
|
||||
movb %dh, %al
|
||||
andl $255, %edx
|
||||
movl CAST_S_table0(,%ecx,4),%ecx
|
||||
movl CAST_S_table1(,%ebx,4),%ebx
|
||||
subl %ebx, %ecx
|
||||
movl CAST_S_table2(,%eax,4),%ebx
|
||||
addl %ebx, %ecx
|
||||
movl CAST_S_table3(,%edx,4),%ebx
|
||||
xorl %ebx, %ecx
|
||||
xorl %ecx, %esi
|
||||
# round 9
|
||||
movl 72(%ebp), %edx
|
||||
movl 76(%ebp), %ecx
|
||||
addl %esi, %edx
|
||||
roll %cl, %edx
|
||||
movl %edx, %ebx
|
||||
xorl %ecx, %ecx
|
||||
movb %dh, %cl
|
||||
andl $255, %ebx
|
||||
shrl $16, %edx
|
||||
xorl %eax, %eax
|
||||
movb %dh, %al
|
||||
andl $255, %edx
|
||||
movl CAST_S_table0(,%ecx,4),%ecx
|
||||
movl CAST_S_table1(,%ebx,4),%ebx
|
||||
xorl %ebx, %ecx
|
||||
movl CAST_S_table2(,%eax,4),%ebx
|
||||
subl %ebx, %ecx
|
||||
movl CAST_S_table3(,%edx,4),%ebx
|
||||
addl %ebx, %ecx
|
||||
xorl %ecx, %edi
|
||||
# round 8
|
||||
movl 64(%ebp), %edx
|
||||
movl 68(%ebp), %ecx
|
||||
subl %edi, %edx
|
||||
roll %cl, %edx
|
||||
movl %edx, %ebx
|
||||
xorl %ecx, %ecx
|
||||
movb %dh, %cl
|
||||
andl $255, %ebx
|
||||
shrl $16, %edx
|
||||
xorl %eax, %eax
|
||||
movb %dh, %al
|
||||
andl $255, %edx
|
||||
movl CAST_S_table0(,%ecx,4),%ecx
|
||||
movl CAST_S_table1(,%ebx,4),%ebx
|
||||
addl %ebx, %ecx
|
||||
movl CAST_S_table2(,%eax,4),%ebx
|
||||
xorl %ebx, %ecx
|
||||
movl CAST_S_table3(,%edx,4),%ebx
|
||||
subl %ebx, %ecx
|
||||
xorl %ecx, %esi
|
||||
# round 7
|
||||
movl 56(%ebp), %edx
|
||||
movl 60(%ebp), %ecx
|
||||
xorl %esi, %edx
|
||||
roll %cl, %edx
|
||||
movl %edx, %ebx
|
||||
xorl %ecx, %ecx
|
||||
movb %dh, %cl
|
||||
andl $255, %ebx
|
||||
shrl $16, %edx
|
||||
xorl %eax, %eax
|
||||
movb %dh, %al
|
||||
andl $255, %edx
|
||||
movl CAST_S_table0(,%ecx,4),%ecx
|
||||
movl CAST_S_table1(,%ebx,4),%ebx
|
||||
subl %ebx, %ecx
|
||||
movl CAST_S_table2(,%eax,4),%ebx
|
||||
addl %ebx, %ecx
|
||||
movl CAST_S_table3(,%edx,4),%ebx
|
||||
xorl %ebx, %ecx
|
||||
xorl %ecx, %edi
|
||||
# round 6
|
||||
movl 48(%ebp), %edx
|
||||
movl 52(%ebp), %ecx
|
||||
addl %edi, %edx
|
||||
roll %cl, %edx
|
||||
movl %edx, %ebx
|
||||
xorl %ecx, %ecx
|
||||
movb %dh, %cl
|
||||
andl $255, %ebx
|
||||
shrl $16, %edx
|
||||
xorl %eax, %eax
|
||||
movb %dh, %al
|
||||
andl $255, %edx
|
||||
movl CAST_S_table0(,%ecx,4),%ecx
|
||||
movl CAST_S_table1(,%ebx,4),%ebx
|
||||
xorl %ebx, %ecx
|
||||
movl CAST_S_table2(,%eax,4),%ebx
|
||||
subl %ebx, %ecx
|
||||
movl CAST_S_table3(,%edx,4),%ebx
|
||||
addl %ebx, %ecx
|
||||
xorl %ecx, %esi
|
||||
# round 5
|
||||
movl 40(%ebp), %edx
|
||||
movl 44(%ebp), %ecx
|
||||
subl %esi, %edx
|
||||
roll %cl, %edx
|
||||
movl %edx, %ebx
|
||||
xorl %ecx, %ecx
|
||||
movb %dh, %cl
|
||||
andl $255, %ebx
|
||||
shrl $16, %edx
|
||||
xorl %eax, %eax
|
||||
movb %dh, %al
|
||||
andl $255, %edx
|
||||
movl CAST_S_table0(,%ecx,4),%ecx
|
||||
movl CAST_S_table1(,%ebx,4),%ebx
|
||||
addl %ebx, %ecx
|
||||
movl CAST_S_table2(,%eax,4),%ebx
|
||||
xorl %ebx, %ecx
|
||||
movl CAST_S_table3(,%edx,4),%ebx
|
||||
subl %ebx, %ecx
|
||||
xorl %ecx, %edi
|
||||
# round 4
|
||||
movl 32(%ebp), %edx
|
||||
movl 36(%ebp), %ecx
|
||||
xorl %edi, %edx
|
||||
roll %cl, %edx
|
||||
movl %edx, %ebx
|
||||
xorl %ecx, %ecx
|
||||
movb %dh, %cl
|
||||
andl $255, %ebx
|
||||
shrl $16, %edx
|
||||
xorl %eax, %eax
|
||||
movb %dh, %al
|
||||
andl $255, %edx
|
||||
movl CAST_S_table0(,%ecx,4),%ecx
|
||||
movl CAST_S_table1(,%ebx,4),%ebx
|
||||
subl %ebx, %ecx
|
||||
movl CAST_S_table2(,%eax,4),%ebx
|
||||
addl %ebx, %ecx
|
||||
movl CAST_S_table3(,%edx,4),%ebx
|
||||
xorl %ebx, %ecx
|
||||
xorl %ecx, %esi
|
||||
# round 3
|
||||
movl 24(%ebp), %edx
|
||||
movl 28(%ebp), %ecx
|
||||
addl %esi, %edx
|
||||
roll %cl, %edx
|
||||
movl %edx, %ebx
|
||||
xorl %ecx, %ecx
|
||||
movb %dh, %cl
|
||||
andl $255, %ebx
|
||||
shrl $16, %edx
|
||||
xorl %eax, %eax
|
||||
movb %dh, %al
|
||||
andl $255, %edx
|
||||
movl CAST_S_table0(,%ecx,4),%ecx
|
||||
movl CAST_S_table1(,%ebx,4),%ebx
|
||||
xorl %ebx, %ecx
|
||||
movl CAST_S_table2(,%eax,4),%ebx
|
||||
subl %ebx, %ecx
|
||||
movl CAST_S_table3(,%edx,4),%ebx
|
||||
addl %ebx, %ecx
|
||||
xorl %ecx, %edi
|
||||
# round 2
|
||||
movl 16(%ebp), %edx
|
||||
movl 20(%ebp), %ecx
|
||||
subl %edi, %edx
|
||||
roll %cl, %edx
|
||||
movl %edx, %ebx
|
||||
xorl %ecx, %ecx
|
||||
movb %dh, %cl
|
||||
andl $255, %ebx
|
||||
shrl $16, %edx
|
||||
xorl %eax, %eax
|
||||
movb %dh, %al
|
||||
andl $255, %edx
|
||||
movl CAST_S_table0(,%ecx,4),%ecx
|
||||
movl CAST_S_table1(,%ebx,4),%ebx
|
||||
addl %ebx, %ecx
|
||||
movl CAST_S_table2(,%eax,4),%ebx
|
||||
xorl %ebx, %ecx
|
||||
movl CAST_S_table3(,%edx,4),%ebx
|
||||
subl %ebx, %ecx
|
||||
xorl %ecx, %esi
|
||||
# round 1
|
||||
movl 8(%ebp), %edx
|
||||
movl 12(%ebp), %ecx
|
||||
xorl %esi, %edx
|
||||
roll %cl, %edx
|
||||
movl %edx, %ebx
|
||||
xorl %ecx, %ecx
|
||||
movb %dh, %cl
|
||||
andl $255, %ebx
|
||||
shrl $16, %edx
|
||||
xorl %eax, %eax
|
||||
movb %dh, %al
|
||||
andl $255, %edx
|
||||
movl CAST_S_table0(,%ecx,4),%ecx
|
||||
movl CAST_S_table1(,%ebx,4),%ebx
|
||||
subl %ebx, %ecx
|
||||
movl CAST_S_table2(,%eax,4),%ebx
|
||||
addl %ebx, %ecx
|
||||
movl CAST_S_table3(,%edx,4),%ebx
|
||||
xorl %ebx, %ecx
|
||||
xorl %ecx, %edi
|
||||
# round 0
|
||||
movl (%ebp), %edx
|
||||
movl 4(%ebp), %ecx
|
||||
addl %edi, %edx
|
||||
roll %cl, %edx
|
||||
movl %edx, %ebx
|
||||
xorl %ecx, %ecx
|
||||
movb %dh, %cl
|
||||
andl $255, %ebx
|
||||
shrl $16, %edx
|
||||
xorl %eax, %eax
|
||||
movb %dh, %al
|
||||
andl $255, %edx
|
||||
movl CAST_S_table0(,%ecx,4),%ecx
|
||||
movl CAST_S_table1(,%ebx,4),%ebx
|
||||
xorl %ebx, %ecx
|
||||
movl CAST_S_table2(,%eax,4),%ebx
|
||||
subl %ebx, %ecx
|
||||
movl CAST_S_table3(,%edx,4),%ebx
|
||||
addl %ebx, %ecx
|
||||
xorl %ecx, %esi
|
||||
nop
|
||||
movl 20(%esp), %eax
|
||||
movl %edi, 4(%eax)
|
||||
movl %esi, (%eax)
|
||||
popl %edi
|
||||
popl %esi
|
||||
popl %ebx
|
||||
popl %ebp
|
||||
ret
|
||||
.CAST_decrypt_end:
|
||||
.size CAST_decrypt,.CAST_decrypt_end-CAST_decrypt
|
||||
.ident "CAST_decrypt"
|
||||
.text
|
||||
.align 16
|
||||
.globl CAST_cbc_encrypt
|
||||
.type CAST_cbc_encrypt,@function
|
||||
CAST_cbc_encrypt:
|
||||
|
||||
pushl %ebp
|
||||
pushl %ebx
|
||||
pushl %esi
|
||||
pushl %edi
|
||||
movl 28(%esp), %ebp
|
||||
# getting iv ptr from parameter 4
|
||||
movl 36(%esp), %ebx
|
||||
movl (%ebx), %esi
|
||||
movl 4(%ebx), %edi
|
||||
pushl %edi
|
||||
pushl %esi
|
||||
pushl %edi
|
||||
pushl %esi
|
||||
movl %esp, %ebx
|
||||
movl 36(%esp), %esi
|
||||
movl 40(%esp), %edi
|
||||
# getting encrypt flag from parameter 5
|
||||
movl 56(%esp), %ecx
|
||||
# get and push parameter 3
|
||||
movl 48(%esp), %eax
|
||||
pushl %eax
|
||||
pushl %ebx
|
||||
cmpl $0, %ecx
|
||||
jz .L002decrypt
|
||||
andl $4294967288, %ebp
|
||||
movl 8(%esp), %eax
|
||||
movl 12(%esp), %ebx
|
||||
jz .L003encrypt_finish
|
||||
.L004encrypt_loop:
|
||||
movl (%esi), %ecx
|
||||
movl 4(%esi), %edx
|
||||
xorl %ecx, %eax
|
||||
xorl %edx, %ebx
|
||||
.byte 15
|
||||
.byte 200 # bswapl %eax
|
||||
.byte 15
|
||||
.byte 203 # bswapl %ebx
|
||||
movl %eax, 8(%esp)
|
||||
movl %ebx, 12(%esp)
|
||||
call CAST_encrypt
|
||||
movl 8(%esp), %eax
|
||||
movl 12(%esp), %ebx
|
||||
.byte 15
|
||||
.byte 200 # bswapl %eax
|
||||
.byte 15
|
||||
.byte 203 # bswapl %ebx
|
||||
movl %eax, (%edi)
|
||||
movl %ebx, 4(%edi)
|
||||
addl $8, %esi
|
||||
addl $8, %edi
|
||||
subl $8, %ebp
|
||||
jnz .L004encrypt_loop
|
||||
.L003encrypt_finish:
|
||||
movl 52(%esp), %ebp
|
||||
andl $7, %ebp
|
||||
jz .L005finish
|
||||
xorl %ecx, %ecx
|
||||
xorl %edx, %edx
|
||||
movl .L006cbc_enc_jmp_table(,%ebp,4),%ebp
|
||||
jmp *%ebp
|
||||
.L007ej7:
|
||||
xorl %edx, %edx
|
||||
movb 6(%esi), %dh
|
||||
sall $8, %edx
|
||||
.L008ej6:
|
||||
movb 5(%esi), %dh
|
||||
.L009ej5:
|
||||
movb 4(%esi), %dl
|
||||
.L010ej4:
|
||||
movl (%esi), %ecx
|
||||
jmp .L011ejend
|
||||
.L012ej3:
|
||||
movb 2(%esi), %ch
|
||||
xorl %ecx, %ecx
|
||||
sall $8, %ecx
|
||||
.L013ej2:
|
||||
movb 1(%esi), %ch
|
||||
.L014ej1:
|
||||
movb (%esi), %cl
|
||||
.L011ejend:
|
||||
xorl %ecx, %eax
|
||||
xorl %edx, %ebx
|
||||
.byte 15
|
||||
.byte 200 # bswapl %eax
|
||||
.byte 15
|
||||
.byte 203 # bswapl %ebx
|
||||
movl %eax, 8(%esp)
|
||||
movl %ebx, 12(%esp)
|
||||
call CAST_encrypt
|
||||
movl 8(%esp), %eax
|
||||
movl 12(%esp), %ebx
|
||||
.byte 15
|
||||
.byte 200 # bswapl %eax
|
||||
.byte 15
|
||||
.byte 203 # bswapl %ebx
|
||||
movl %eax, (%edi)
|
||||
movl %ebx, 4(%edi)
|
||||
jmp .L005finish
|
||||
.align 16
|
||||
.L002decrypt:
|
||||
andl $4294967288, %ebp
|
||||
movl 16(%esp), %eax
|
||||
movl 20(%esp), %ebx
|
||||
jz .L015decrypt_finish
|
||||
.L016decrypt_loop:
|
||||
movl (%esi), %eax
|
||||
movl 4(%esi), %ebx
|
||||
.byte 15
|
||||
.byte 200 # bswapl %eax
|
||||
.byte 15
|
||||
.byte 203 # bswapl %ebx
|
||||
movl %eax, 8(%esp)
|
||||
movl %ebx, 12(%esp)
|
||||
call CAST_decrypt
|
||||
movl 8(%esp), %eax
|
||||
movl 12(%esp), %ebx
|
||||
.byte 15
|
||||
.byte 200 # bswapl %eax
|
||||
.byte 15
|
||||
.byte 203 # bswapl %ebx
|
||||
movl 16(%esp), %ecx
|
||||
movl 20(%esp), %edx
|
||||
xorl %eax, %ecx
|
||||
xorl %ebx, %edx
|
||||
movl (%esi), %eax
|
||||
movl 4(%esi), %ebx
|
||||
movl %ecx, (%edi)
|
||||
movl %edx, 4(%edi)
|
||||
movl %eax, 16(%esp)
|
||||
movl %ebx, 20(%esp)
|
||||
addl $8, %esi
|
||||
addl $8, %edi
|
||||
subl $8, %ebp
|
||||
jnz .L016decrypt_loop
|
||||
.L015decrypt_finish:
|
||||
movl 52(%esp), %ebp
|
||||
andl $7, %ebp
|
||||
jz .L005finish
|
||||
movl (%esi), %eax
|
||||
movl 4(%esi), %ebx
|
||||
.byte 15
|
||||
.byte 200 # bswapl %eax
|
||||
.byte 15
|
||||
.byte 203 # bswapl %ebx
|
||||
movl %eax, 8(%esp)
|
||||
movl %ebx, 12(%esp)
|
||||
call CAST_decrypt
|
||||
movl 8(%esp), %eax
|
||||
movl 12(%esp), %ebx
|
||||
.byte 15
|
||||
.byte 200 # bswapl %eax
|
||||
.byte 15
|
||||
.byte 203 # bswapl %ebx
|
||||
movl 16(%esp), %ecx
|
||||
movl 20(%esp), %edx
|
||||
xorl %eax, %ecx
|
||||
xorl %ebx, %edx
|
||||
movl (%esi), %eax
|
||||
movl 4(%esi), %ebx
|
||||
.L017dj7:
|
||||
rorl $16, %edx
|
||||
movb %dl, 6(%edi)
|
||||
shrl $16, %edx
|
||||
.L018dj6:
|
||||
movb %dh, 5(%edi)
|
||||
.L019dj5:
|
||||
movb %dl, 4(%edi)
|
||||
.L020dj4:
|
||||
movl %ecx, (%edi)
|
||||
jmp .L021djend
|
||||
.L022dj3:
|
||||
rorl $16, %ecx
|
||||
movb %cl, 2(%edi)
|
||||
sall $16, %ecx
|
||||
.L023dj2:
|
||||
movb %ch, 1(%esi)
|
||||
.L024dj1:
|
||||
movb %cl, (%esi)
|
||||
.L021djend:
|
||||
jmp .L005finish
|
||||
.align 16
|
||||
.L005finish:
|
||||
movl 60(%esp), %ecx
|
||||
addl $24, %esp
|
||||
movl %eax, (%ecx)
|
||||
movl %ebx, 4(%ecx)
|
||||
popl %edi
|
||||
popl %esi
|
||||
popl %ebx
|
||||
popl %ebp
|
||||
ret
|
||||
.align 16
|
||||
.L006cbc_enc_jmp_table:
|
||||
.long 0
|
||||
.long .L014ej1
|
||||
.long .L013ej2
|
||||
.long .L012ej3
|
||||
.long .L010ej4
|
||||
.long .L009ej5
|
||||
.long .L008ej6
|
||||
.long .L007ej7
|
||||
.align 16
|
||||
.L025cbc_dec_jmp_table:
|
||||
.long 0
|
||||
.long .L024dj1
|
||||
.long .L023dj2
|
||||
.long .L022dj3
|
||||
.long .L020dj4
|
||||
.long .L019dj5
|
||||
.long .L018dj6
|
||||
.long .L017dj7
|
||||
.L_CAST_cbc_encrypt_end:
|
||||
.size CAST_cbc_encrypt,.L_CAST_cbc_encrypt_end-CAST_cbc_encrypt
|
||||
.ident "desasm.pl"
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,933 +0,0 @@
|
||||
# $FreeBSD$
|
||||
# Dont even think of reading this code
|
||||
# It was automatically generated by crypt586.pl
|
||||
# Which is a perl program used to generate the x86 assember for
|
||||
# any of elf, a.out, BSDI, Win32, gaswin (for GNU as on Win32) or Solaris
|
||||
# eric <eay@cryptsoft.com>
|
||||
|
||||
.file "crypt586.s"
|
||||
.version "01.01"
|
||||
gcc2_compiled.:
|
||||
.text
|
||||
.align 16
|
||||
.globl fcrypt_body
|
||||
.type fcrypt_body,@function
|
||||
fcrypt_body:
|
||||
pushl %ebp
|
||||
pushl %ebx
|
||||
pushl %esi
|
||||
pushl %edi
|
||||
|
||||
|
||||
# Load the 2 words
|
||||
xorl %edi, %edi
|
||||
xorl %esi, %esi
|
||||
movl 24(%esp), %ebp
|
||||
pushl $25
|
||||
.L000start:
|
||||
|
||||
# Round 0
|
||||
movl 32(%esp), %eax
|
||||
movl %esi, %edx
|
||||
shrl $16, %edx
|
||||
movl 36(%esp), %ecx
|
||||
xorl %esi, %edx
|
||||
andl %edx, %eax
|
||||
andl %ecx, %edx
|
||||
movl %eax, %ebx
|
||||
sall $16, %ebx
|
||||
movl %edx, %ecx
|
||||
sall $16, %ecx
|
||||
xorl %ebx, %eax
|
||||
xorl %ecx, %edx
|
||||
movl (%ebp), %ebx
|
||||
xorl %ebx, %eax
|
||||
movl 4(%ebp), %ecx
|
||||
xorl %esi, %eax
|
||||
xorl %esi, %edx
|
||||
xorl %ecx, %edx
|
||||
andl $0xfcfcfcfc, %eax
|
||||
xorl %ebx, %ebx
|
||||
andl $0xcfcfcfcf, %edx
|
||||
xorl %ecx, %ecx
|
||||
movb %al, %bl
|
||||
movb %ah, %cl
|
||||
rorl $4, %edx
|
||||
movl des_SPtrans(%ebx),%ebp
|
||||
movb %dl, %bl
|
||||
xorl %ebp, %edi
|
||||
movl 0x200+des_SPtrans(%ecx),%ebp
|
||||
xorl %ebp, %edi
|
||||
movb %dh, %cl
|
||||
shrl $16, %eax
|
||||
movl 0x100+des_SPtrans(%ebx),%ebp
|
||||
xorl %ebp, %edi
|
||||
movb %ah, %bl
|
||||
shrl $16, %edx
|
||||
movl 0x300+des_SPtrans(%ecx),%ebp
|
||||
xorl %ebp, %edi
|
||||
movl 28(%esp), %ebp
|
||||
movb %dh, %cl
|
||||
andl $0xff, %eax
|
||||
andl $0xff, %edx
|
||||
movl 0x600+des_SPtrans(%ebx),%ebx
|
||||
xorl %ebx, %edi
|
||||
movl 0x700+des_SPtrans(%ecx),%ebx
|
||||
xorl %ebx, %edi
|
||||
movl 0x400+des_SPtrans(%eax),%ebx
|
||||
xorl %ebx, %edi
|
||||
movl 0x500+des_SPtrans(%edx),%ebx
|
||||
xorl %ebx, %edi
|
||||
|
||||
# Round 1
|
||||
movl 32(%esp), %eax
|
||||
movl %edi, %edx
|
||||
shrl $16, %edx
|
||||
movl 36(%esp), %ecx
|
||||
xorl %edi, %edx
|
||||
andl %edx, %eax
|
||||
andl %ecx, %edx
|
||||
movl %eax, %ebx
|
||||
sall $16, %ebx
|
||||
movl %edx, %ecx
|
||||
sall $16, %ecx
|
||||
xorl %ebx, %eax
|
||||
xorl %ecx, %edx
|
||||
movl 8(%ebp), %ebx
|
||||
xorl %ebx, %eax
|
||||
movl 12(%ebp), %ecx
|
||||
xorl %edi, %eax
|
||||
xorl %edi, %edx
|
||||
xorl %ecx, %edx
|
||||
andl $0xfcfcfcfc, %eax
|
||||
xorl %ebx, %ebx
|
||||
andl $0xcfcfcfcf, %edx
|
||||
xorl %ecx, %ecx
|
||||
movb %al, %bl
|
||||
movb %ah, %cl
|
||||
rorl $4, %edx
|
||||
movl des_SPtrans(%ebx),%ebp
|
||||
movb %dl, %bl
|
||||
xorl %ebp, %esi
|
||||
movl 0x200+des_SPtrans(%ecx),%ebp
|
||||
xorl %ebp, %esi
|
||||
movb %dh, %cl
|
||||
shrl $16, %eax
|
||||
movl 0x100+des_SPtrans(%ebx),%ebp
|
||||
xorl %ebp, %esi
|
||||
movb %ah, %bl
|
||||
shrl $16, %edx
|
||||
movl 0x300+des_SPtrans(%ecx),%ebp
|
||||
xorl %ebp, %esi
|
||||
movl 28(%esp), %ebp
|
||||
movb %dh, %cl
|
||||
andl $0xff, %eax
|
||||
andl $0xff, %edx
|
||||
movl 0x600+des_SPtrans(%ebx),%ebx
|
||||
xorl %ebx, %esi
|
||||
movl 0x700+des_SPtrans(%ecx),%ebx
|
||||
xorl %ebx, %esi
|
||||
movl 0x400+des_SPtrans(%eax),%ebx
|
||||
xorl %ebx, %esi
|
||||
movl 0x500+des_SPtrans(%edx),%ebx
|
||||
xorl %ebx, %esi
|
||||
|
||||
# Round 2
|
||||
movl 32(%esp), %eax
|
||||
movl %esi, %edx
|
||||
shrl $16, %edx
|
||||
movl 36(%esp), %ecx
|
||||
xorl %esi, %edx
|
||||
andl %edx, %eax
|
||||
andl %ecx, %edx
|
||||
movl %eax, %ebx
|
||||
sall $16, %ebx
|
||||
movl %edx, %ecx
|
||||
sall $16, %ecx
|
||||
xorl %ebx, %eax
|
||||
xorl %ecx, %edx
|
||||
movl 16(%ebp), %ebx
|
||||
xorl %ebx, %eax
|
||||
movl 20(%ebp), %ecx
|
||||
xorl %esi, %eax
|
||||
xorl %esi, %edx
|
||||
xorl %ecx, %edx
|
||||
andl $0xfcfcfcfc, %eax
|
||||
xorl %ebx, %ebx
|
||||
andl $0xcfcfcfcf, %edx
|
||||
xorl %ecx, %ecx
|
||||
movb %al, %bl
|
||||
movb %ah, %cl
|
||||
rorl $4, %edx
|
||||
movl des_SPtrans(%ebx),%ebp
|
||||
movb %dl, %bl
|
||||
xorl %ebp, %edi
|
||||
movl 0x200+des_SPtrans(%ecx),%ebp
|
||||
xorl %ebp, %edi
|
||||
movb %dh, %cl
|
||||
shrl $16, %eax
|
||||
movl 0x100+des_SPtrans(%ebx),%ebp
|
||||
xorl %ebp, %edi
|
||||
movb %ah, %bl
|
||||
shrl $16, %edx
|
||||
movl 0x300+des_SPtrans(%ecx),%ebp
|
||||
xorl %ebp, %edi
|
||||
movl 28(%esp), %ebp
|
||||
movb %dh, %cl
|
||||
andl $0xff, %eax
|
||||
andl $0xff, %edx
|
||||
movl 0x600+des_SPtrans(%ebx),%ebx
|
||||
xorl %ebx, %edi
|
||||
movl 0x700+des_SPtrans(%ecx),%ebx
|
||||
xorl %ebx, %edi
|
||||
movl 0x400+des_SPtrans(%eax),%ebx
|
||||
xorl %ebx, %edi
|
||||
movl 0x500+des_SPtrans(%edx),%ebx
|
||||
xorl %ebx, %edi
|
||||
|
||||
# Round 3
|
||||
movl 32(%esp), %eax
|
||||
movl %edi, %edx
|
||||
shrl $16, %edx
|
||||
movl 36(%esp), %ecx
|
||||
xorl %edi, %edx
|
||||
andl %edx, %eax
|
||||
andl %ecx, %edx
|
||||
movl %eax, %ebx
|
||||
sall $16, %ebx
|
||||
movl %edx, %ecx
|
||||
sall $16, %ecx
|
||||
xorl %ebx, %eax
|
||||
xorl %ecx, %edx
|
||||
movl 24(%ebp), %ebx
|
||||
xorl %ebx, %eax
|
||||
movl 28(%ebp), %ecx
|
||||
xorl %edi, %eax
|
||||
xorl %edi, %edx
|
||||
xorl %ecx, %edx
|
||||
andl $0xfcfcfcfc, %eax
|
||||
xorl %ebx, %ebx
|
||||
andl $0xcfcfcfcf, %edx
|
||||
xorl %ecx, %ecx
|
||||
movb %al, %bl
|
||||
movb %ah, %cl
|
||||
rorl $4, %edx
|
||||
movl des_SPtrans(%ebx),%ebp
|
||||
movb %dl, %bl
|
||||
xorl %ebp, %esi
|
||||
movl 0x200+des_SPtrans(%ecx),%ebp
|
||||
xorl %ebp, %esi
|
||||
movb %dh, %cl
|
||||
shrl $16, %eax
|
||||
movl 0x100+des_SPtrans(%ebx),%ebp
|
||||
xorl %ebp, %esi
|
||||
movb %ah, %bl
|
||||
shrl $16, %edx
|
||||
movl 0x300+des_SPtrans(%ecx),%ebp
|
||||
xorl %ebp, %esi
|
||||
movl 28(%esp), %ebp
|
||||
movb %dh, %cl
|
||||
andl $0xff, %eax
|
||||
andl $0xff, %edx
|
||||
movl 0x600+des_SPtrans(%ebx),%ebx
|
||||
xorl %ebx, %esi
|
||||
movl 0x700+des_SPtrans(%ecx),%ebx
|
||||
xorl %ebx, %esi
|
||||
movl 0x400+des_SPtrans(%eax),%ebx
|
||||
xorl %ebx, %esi
|
||||
movl 0x500+des_SPtrans(%edx),%ebx
|
||||
xorl %ebx, %esi
|
||||
|
||||
# Round 4
|
||||
movl 32(%esp), %eax
|
||||
movl %esi, %edx
|
||||
shrl $16, %edx
|
||||
movl 36(%esp), %ecx
|
||||
xorl %esi, %edx
|
||||
andl %edx, %eax
|
||||
andl %ecx, %edx
|
||||
movl %eax, %ebx
|
||||
sall $16, %ebx
|
||||
movl %edx, %ecx
|
||||
sall $16, %ecx
|
||||
xorl %ebx, %eax
|
||||
xorl %ecx, %edx
|
||||
movl 32(%ebp), %ebx
|
||||
xorl %ebx, %eax
|
||||
movl 36(%ebp), %ecx
|
||||
xorl %esi, %eax
|
||||
xorl %esi, %edx
|
||||
xorl %ecx, %edx
|
||||
andl $0xfcfcfcfc, %eax
|
||||
xorl %ebx, %ebx
|
||||
andl $0xcfcfcfcf, %edx
|
||||
xorl %ecx, %ecx
|
||||
movb %al, %bl
|
||||
movb %ah, %cl
|
||||
rorl $4, %edx
|
||||
movl des_SPtrans(%ebx),%ebp
|
||||
movb %dl, %bl
|
||||
xorl %ebp, %edi
|
||||
movl 0x200+des_SPtrans(%ecx),%ebp
|
||||
xorl %ebp, %edi
|
||||
movb %dh, %cl
|
||||
shrl $16, %eax
|
||||
movl 0x100+des_SPtrans(%ebx),%ebp
|
||||
xorl %ebp, %edi
|
||||
movb %ah, %bl
|
||||
shrl $16, %edx
|
||||
movl 0x300+des_SPtrans(%ecx),%ebp
|
||||
xorl %ebp, %edi
|
||||
movl 28(%esp), %ebp
|
||||
movb %dh, %cl
|
||||
andl $0xff, %eax
|
||||
andl $0xff, %edx
|
||||
movl 0x600+des_SPtrans(%ebx),%ebx
|
||||
xorl %ebx, %edi
|
||||
movl 0x700+des_SPtrans(%ecx),%ebx
|
||||
xorl %ebx, %edi
|
||||
movl 0x400+des_SPtrans(%eax),%ebx
|
||||
xorl %ebx, %edi
|
||||
movl 0x500+des_SPtrans(%edx),%ebx
|
||||
xorl %ebx, %edi
|
||||
|
||||
# Round 5
|
||||
movl 32(%esp), %eax
|
||||
movl %edi, %edx
|
||||
shrl $16, %edx
|
||||
movl 36(%esp), %ecx
|
||||
xorl %edi, %edx
|
||||
andl %edx, %eax
|
||||
andl %ecx, %edx
|
||||
movl %eax, %ebx
|
||||
sall $16, %ebx
|
||||
movl %edx, %ecx
|
||||
sall $16, %ecx
|
||||
xorl %ebx, %eax
|
||||
xorl %ecx, %edx
|
||||
movl 40(%ebp), %ebx
|
||||
xorl %ebx, %eax
|
||||
movl 44(%ebp), %ecx
|
||||
xorl %edi, %eax
|
||||
xorl %edi, %edx
|
||||
xorl %ecx, %edx
|
||||
andl $0xfcfcfcfc, %eax
|
||||
xorl %ebx, %ebx
|
||||
andl $0xcfcfcfcf, %edx
|
||||
xorl %ecx, %ecx
|
||||
movb %al, %bl
|
||||
movb %ah, %cl
|
||||
rorl $4, %edx
|
||||
movl des_SPtrans(%ebx),%ebp
|
||||
movb %dl, %bl
|
||||
xorl %ebp, %esi
|
||||
movl 0x200+des_SPtrans(%ecx),%ebp
|
||||
xorl %ebp, %esi
|
||||
movb %dh, %cl
|
||||
shrl $16, %eax
|
||||
movl 0x100+des_SPtrans(%ebx),%ebp
|
||||
xorl %ebp, %esi
|
||||
movb %ah, %bl
|
||||
shrl $16, %edx
|
||||
movl 0x300+des_SPtrans(%ecx),%ebp
|
||||
xorl %ebp, %esi
|
||||
movl 28(%esp), %ebp
|
||||
movb %dh, %cl
|
||||
andl $0xff, %eax
|
||||
andl $0xff, %edx
|
||||
movl 0x600+des_SPtrans(%ebx),%ebx
|
||||
xorl %ebx, %esi
|
||||
movl 0x700+des_SPtrans(%ecx),%ebx
|
||||
xorl %ebx, %esi
|
||||
movl 0x400+des_SPtrans(%eax),%ebx
|
||||
xorl %ebx, %esi
|
||||
movl 0x500+des_SPtrans(%edx),%ebx
|
||||
xorl %ebx, %esi
|
||||
|
||||
# Round 6
|
||||
movl 32(%esp), %eax
|
||||
movl %esi, %edx
|
||||
shrl $16, %edx
|
||||
movl 36(%esp), %ecx
|
||||
xorl %esi, %edx
|
||||
andl %edx, %eax
|
||||
andl %ecx, %edx
|
||||
movl %eax, %ebx
|
||||
sall $16, %ebx
|
||||
movl %edx, %ecx
|
||||
sall $16, %ecx
|
||||
xorl %ebx, %eax
|
||||
xorl %ecx, %edx
|
||||
movl 48(%ebp), %ebx
|
||||
xorl %ebx, %eax
|
||||
movl 52(%ebp), %ecx
|
||||
xorl %esi, %eax
|
||||
xorl %esi, %edx
|
||||
xorl %ecx, %edx
|
||||
andl $0xfcfcfcfc, %eax
|
||||
xorl %ebx, %ebx
|
||||
andl $0xcfcfcfcf, %edx
|
||||
xorl %ecx, %ecx
|
||||
movb %al, %bl
|
||||
movb %ah, %cl
|
||||
rorl $4, %edx
|
||||
movl des_SPtrans(%ebx),%ebp
|
||||
movb %dl, %bl
|
||||
xorl %ebp, %edi
|
||||
movl 0x200+des_SPtrans(%ecx),%ebp
|
||||
xorl %ebp, %edi
|
||||
movb %dh, %cl
|
||||
shrl $16, %eax
|
||||
movl 0x100+des_SPtrans(%ebx),%ebp
|
||||
xorl %ebp, %edi
|
||||
movb %ah, %bl
|
||||
shrl $16, %edx
|
||||
movl 0x300+des_SPtrans(%ecx),%ebp
|
||||
xorl %ebp, %edi
|
||||
movl 28(%esp), %ebp
|
||||
movb %dh, %cl
|
||||
andl $0xff, %eax
|
||||
andl $0xff, %edx
|
||||
movl 0x600+des_SPtrans(%ebx),%ebx
|
||||
xorl %ebx, %edi
|
||||
movl 0x700+des_SPtrans(%ecx),%ebx
|
||||
xorl %ebx, %edi
|
||||
movl 0x400+des_SPtrans(%eax),%ebx
|
||||
xorl %ebx, %edi
|
||||
movl 0x500+des_SPtrans(%edx),%ebx
|
||||
xorl %ebx, %edi
|
||||
|
||||
# Round 7
|
||||
movl 32(%esp), %eax
|
||||
movl %edi, %edx
|
||||
shrl $16, %edx
|
||||
movl 36(%esp), %ecx
|
||||
xorl %edi, %edx
|
||||
andl %edx, %eax
|
||||
andl %ecx, %edx
|
||||
movl %eax, %ebx
|
||||
sall $16, %ebx
|
||||
movl %edx, %ecx
|
||||
sall $16, %ecx
|
||||
xorl %ebx, %eax
|
||||
xorl %ecx, %edx
|
||||
movl 56(%ebp), %ebx
|
||||
xorl %ebx, %eax
|
||||
movl 60(%ebp), %ecx
|
||||
xorl %edi, %eax
|
||||
xorl %edi, %edx
|
||||
xorl %ecx, %edx
|
||||
andl $0xfcfcfcfc, %eax
|
||||
xorl %ebx, %ebx
|
||||
andl $0xcfcfcfcf, %edx
|
||||
xorl %ecx, %ecx
|
||||
movb %al, %bl
|
||||
movb %ah, %cl
|
||||
rorl $4, %edx
|
||||
movl des_SPtrans(%ebx),%ebp
|
||||
movb %dl, %bl
|
||||
xorl %ebp, %esi
|
||||
movl 0x200+des_SPtrans(%ecx),%ebp
|
||||
xorl %ebp, %esi
|
||||
movb %dh, %cl
|
||||
shrl $16, %eax
|
||||
movl 0x100+des_SPtrans(%ebx),%ebp
|
||||
xorl %ebp, %esi
|
||||
movb %ah, %bl
|
||||
shrl $16, %edx
|
||||
movl 0x300+des_SPtrans(%ecx),%ebp
|
||||
xorl %ebp, %esi
|
||||
movl 28(%esp), %ebp
|
||||
movb %dh, %cl
|
||||
andl $0xff, %eax
|
||||
andl $0xff, %edx
|
||||
movl 0x600+des_SPtrans(%ebx),%ebx
|
||||
xorl %ebx, %esi
|
||||
movl 0x700+des_SPtrans(%ecx),%ebx
|
||||
xorl %ebx, %esi
|
||||
movl 0x400+des_SPtrans(%eax),%ebx
|
||||
xorl %ebx, %esi
|
||||
movl 0x500+des_SPtrans(%edx),%ebx
|
||||
xorl %ebx, %esi
|
||||
|
||||
# Round 8
|
||||
movl 32(%esp), %eax
|
||||
movl %esi, %edx
|
||||
shrl $16, %edx
|
||||
movl 36(%esp), %ecx
|
||||
xorl %esi, %edx
|
||||
andl %edx, %eax
|
||||
andl %ecx, %edx
|
||||
movl %eax, %ebx
|
||||
sall $16, %ebx
|
||||
movl %edx, %ecx
|
||||
sall $16, %ecx
|
||||
xorl %ebx, %eax
|
||||
xorl %ecx, %edx
|
||||
movl 64(%ebp), %ebx
|
||||
xorl %ebx, %eax
|
||||
movl 68(%ebp), %ecx
|
||||
xorl %esi, %eax
|
||||
xorl %esi, %edx
|
||||
xorl %ecx, %edx
|
||||
andl $0xfcfcfcfc, %eax
|
||||
xorl %ebx, %ebx
|
||||
andl $0xcfcfcfcf, %edx
|
||||
xorl %ecx, %ecx
|
||||
movb %al, %bl
|
||||
movb %ah, %cl
|
||||
rorl $4, %edx
|
||||
movl des_SPtrans(%ebx),%ebp
|
||||
movb %dl, %bl
|
||||
xorl %ebp, %edi
|
||||
movl 0x200+des_SPtrans(%ecx),%ebp
|
||||
xorl %ebp, %edi
|
||||
movb %dh, %cl
|
||||
shrl $16, %eax
|
||||
movl 0x100+des_SPtrans(%ebx),%ebp
|
||||
xorl %ebp, %edi
|
||||
movb %ah, %bl
|
||||
shrl $16, %edx
|
||||
movl 0x300+des_SPtrans(%ecx),%ebp
|
||||
xorl %ebp, %edi
|
||||
movl 28(%esp), %ebp
|
||||
movb %dh, %cl
|
||||
andl $0xff, %eax
|
||||
andl $0xff, %edx
|
||||
movl 0x600+des_SPtrans(%ebx),%ebx
|
||||
xorl %ebx, %edi
|
||||
movl 0x700+des_SPtrans(%ecx),%ebx
|
||||
xorl %ebx, %edi
|
||||
movl 0x400+des_SPtrans(%eax),%ebx
|
||||
xorl %ebx, %edi
|
||||
movl 0x500+des_SPtrans(%edx),%ebx
|
||||
xorl %ebx, %edi
|
||||
|
||||
# Round 9
|
||||
movl 32(%esp), %eax
|
||||
movl %edi, %edx
|
||||
shrl $16, %edx
|
||||
movl 36(%esp), %ecx
|
||||
xorl %edi, %edx
|
||||
andl %edx, %eax
|
||||
andl %ecx, %edx
|
||||
movl %eax, %ebx
|
||||
sall $16, %ebx
|
||||
movl %edx, %ecx
|
||||
sall $16, %ecx
|
||||
xorl %ebx, %eax
|
||||
xorl %ecx, %edx
|
||||
movl 72(%ebp), %ebx
|
||||
xorl %ebx, %eax
|
||||
movl 76(%ebp), %ecx
|
||||
xorl %edi, %eax
|
||||
xorl %edi, %edx
|
||||
xorl %ecx, %edx
|
||||
andl $0xfcfcfcfc, %eax
|
||||
xorl %ebx, %ebx
|
||||
andl $0xcfcfcfcf, %edx
|
||||
xorl %ecx, %ecx
|
||||
movb %al, %bl
|
||||
movb %ah, %cl
|
||||
rorl $4, %edx
|
||||
movl des_SPtrans(%ebx),%ebp
|
||||
movb %dl, %bl
|
||||
xorl %ebp, %esi
|
||||
movl 0x200+des_SPtrans(%ecx),%ebp
|
||||
xorl %ebp, %esi
|
||||
movb %dh, %cl
|
||||
shrl $16, %eax
|
||||
movl 0x100+des_SPtrans(%ebx),%ebp
|
||||
xorl %ebp, %esi
|
||||
movb %ah, %bl
|
||||
shrl $16, %edx
|
||||
movl 0x300+des_SPtrans(%ecx),%ebp
|
||||
xorl %ebp, %esi
|
||||
movl 28(%esp), %ebp
|
||||
movb %dh, %cl
|
||||
andl $0xff, %eax
|
||||
andl $0xff, %edx
|
||||
movl 0x600+des_SPtrans(%ebx),%ebx
|
||||
xorl %ebx, %esi
|
||||
movl 0x700+des_SPtrans(%ecx),%ebx
|
||||
xorl %ebx, %esi
|
||||
movl 0x400+des_SPtrans(%eax),%ebx
|
||||
xorl %ebx, %esi
|
||||
movl 0x500+des_SPtrans(%edx),%ebx
|
||||
xorl %ebx, %esi
|
||||
|
||||
# Round 10
|
||||
movl 32(%esp), %eax
|
||||
movl %esi, %edx
|
||||
shrl $16, %edx
|
||||
movl 36(%esp), %ecx
|
||||
xorl %esi, %edx
|
||||
andl %edx, %eax
|
||||
andl %ecx, %edx
|
||||
movl %eax, %ebx
|
||||
sall $16, %ebx
|
||||
movl %edx, %ecx
|
||||
sall $16, %ecx
|
||||
xorl %ebx, %eax
|
||||
xorl %ecx, %edx
|
||||
movl 80(%ebp), %ebx
|
||||
xorl %ebx, %eax
|
||||
movl 84(%ebp), %ecx
|
||||
xorl %esi, %eax
|
||||
xorl %esi, %edx
|
||||
xorl %ecx, %edx
|
||||
andl $0xfcfcfcfc, %eax
|
||||
xorl %ebx, %ebx
|
||||
andl $0xcfcfcfcf, %edx
|
||||
xorl %ecx, %ecx
|
||||
movb %al, %bl
|
||||
movb %ah, %cl
|
||||
rorl $4, %edx
|
||||
movl des_SPtrans(%ebx),%ebp
|
||||
movb %dl, %bl
|
||||
xorl %ebp, %edi
|
||||
movl 0x200+des_SPtrans(%ecx),%ebp
|
||||
xorl %ebp, %edi
|
||||
movb %dh, %cl
|
||||
shrl $16, %eax
|
||||
movl 0x100+des_SPtrans(%ebx),%ebp
|
||||
xorl %ebp, %edi
|
||||
movb %ah, %bl
|
||||
shrl $16, %edx
|
||||
movl 0x300+des_SPtrans(%ecx),%ebp
|
||||
xorl %ebp, %edi
|
||||
movl 28(%esp), %ebp
|
||||
movb %dh, %cl
|
||||
andl $0xff, %eax
|
||||
andl $0xff, %edx
|
||||
movl 0x600+des_SPtrans(%ebx),%ebx
|
||||
xorl %ebx, %edi
|
||||
movl 0x700+des_SPtrans(%ecx),%ebx
|
||||
xorl %ebx, %edi
|
||||
movl 0x400+des_SPtrans(%eax),%ebx
|
||||
xorl %ebx, %edi
|
||||
movl 0x500+des_SPtrans(%edx),%ebx
|
||||
xorl %ebx, %edi
|
||||
|
||||
# Round 11
|
||||
movl 32(%esp), %eax
|
||||
movl %edi, %edx
|
||||
shrl $16, %edx
|
||||
movl 36(%esp), %ecx
|
||||
xorl %edi, %edx
|
||||
andl %edx, %eax
|
||||
andl %ecx, %edx
|
||||
movl %eax, %ebx
|
||||
sall $16, %ebx
|
||||
movl %edx, %ecx
|
||||
sall $16, %ecx
|
||||
xorl %ebx, %eax
|
||||
xorl %ecx, %edx
|
||||
movl 88(%ebp), %ebx
|
||||
xorl %ebx, %eax
|
||||
movl 92(%ebp), %ecx
|
||||
xorl %edi, %eax
|
||||
xorl %edi, %edx
|
||||
xorl %ecx, %edx
|
||||
andl $0xfcfcfcfc, %eax
|
||||
xorl %ebx, %ebx
|
||||
andl $0xcfcfcfcf, %edx
|
||||
xorl %ecx, %ecx
|
||||
movb %al, %bl
|
||||
movb %ah, %cl
|
||||
rorl $4, %edx
|
||||
movl des_SPtrans(%ebx),%ebp
|
||||
movb %dl, %bl
|
||||
xorl %ebp, %esi
|
||||
movl 0x200+des_SPtrans(%ecx),%ebp
|
||||
xorl %ebp, %esi
|
||||
movb %dh, %cl
|
||||
shrl $16, %eax
|
||||
movl 0x100+des_SPtrans(%ebx),%ebp
|
||||
xorl %ebp, %esi
|
||||
movb %ah, %bl
|
||||
shrl $16, %edx
|
||||
movl 0x300+des_SPtrans(%ecx),%ebp
|
||||
xorl %ebp, %esi
|
||||
movl 28(%esp), %ebp
|
||||
movb %dh, %cl
|
||||
andl $0xff, %eax
|
||||
andl $0xff, %edx
|
||||
movl 0x600+des_SPtrans(%ebx),%ebx
|
||||
xorl %ebx, %esi
|
||||
movl 0x700+des_SPtrans(%ecx),%ebx
|
||||
xorl %ebx, %esi
|
||||
movl 0x400+des_SPtrans(%eax),%ebx
|
||||
xorl %ebx, %esi
|
||||
movl 0x500+des_SPtrans(%edx),%ebx
|
||||
xorl %ebx, %esi
|
||||
|
||||
# Round 12
|
||||
movl 32(%esp), %eax
|
||||
movl %esi, %edx
|
||||
shrl $16, %edx
|
||||
movl 36(%esp), %ecx
|
||||
xorl %esi, %edx
|
||||
andl %edx, %eax
|
||||
andl %ecx, %edx
|
||||
movl %eax, %ebx
|
||||
sall $16, %ebx
|
||||
movl %edx, %ecx
|
||||
sall $16, %ecx
|
||||
xorl %ebx, %eax
|
||||
xorl %ecx, %edx
|
||||
movl 96(%ebp), %ebx
|
||||
xorl %ebx, %eax
|
||||
movl 100(%ebp), %ecx
|
||||
xorl %esi, %eax
|
||||
xorl %esi, %edx
|
||||
xorl %ecx, %edx
|
||||
andl $0xfcfcfcfc, %eax
|
||||
xorl %ebx, %ebx
|
||||
andl $0xcfcfcfcf, %edx
|
||||
xorl %ecx, %ecx
|
||||
movb %al, %bl
|
||||
movb %ah, %cl
|
||||
rorl $4, %edx
|
||||
movl des_SPtrans(%ebx),%ebp
|
||||
movb %dl, %bl
|
||||
xorl %ebp, %edi
|
||||
movl 0x200+des_SPtrans(%ecx),%ebp
|
||||
xorl %ebp, %edi
|
||||
movb %dh, %cl
|
||||
shrl $16, %eax
|
||||
movl 0x100+des_SPtrans(%ebx),%ebp
|
||||
xorl %ebp, %edi
|
||||
movb %ah, %bl
|
||||
shrl $16, %edx
|
||||
movl 0x300+des_SPtrans(%ecx),%ebp
|
||||
xorl %ebp, %edi
|
||||
movl 28(%esp), %ebp
|
||||
movb %dh, %cl
|
||||
andl $0xff, %eax
|
||||
andl $0xff, %edx
|
||||
movl 0x600+des_SPtrans(%ebx),%ebx
|
||||
xorl %ebx, %edi
|
||||
movl 0x700+des_SPtrans(%ecx),%ebx
|
||||
xorl %ebx, %edi
|
||||
movl 0x400+des_SPtrans(%eax),%ebx
|
||||
xorl %ebx, %edi
|
||||
movl 0x500+des_SPtrans(%edx),%ebx
|
||||
xorl %ebx, %edi
|
||||
|
||||
# Round 13
|
||||
movl 32(%esp), %eax
|
||||
movl %edi, %edx
|
||||
shrl $16, %edx
|
||||
movl 36(%esp), %ecx
|
||||
xorl %edi, %edx
|
||||
andl %edx, %eax
|
||||
andl %ecx, %edx
|
||||
movl %eax, %ebx
|
||||
sall $16, %ebx
|
||||
movl %edx, %ecx
|
||||
sall $16, %ecx
|
||||
xorl %ebx, %eax
|
||||
xorl %ecx, %edx
|
||||
movl 104(%ebp), %ebx
|
||||
xorl %ebx, %eax
|
||||
movl 108(%ebp), %ecx
|
||||
xorl %edi, %eax
|
||||
xorl %edi, %edx
|
||||
xorl %ecx, %edx
|
||||
andl $0xfcfcfcfc, %eax
|
||||
xorl %ebx, %ebx
|
||||
andl $0xcfcfcfcf, %edx
|
||||
xorl %ecx, %ecx
|
||||
movb %al, %bl
|
||||
movb %ah, %cl
|
||||
rorl $4, %edx
|
||||
movl des_SPtrans(%ebx),%ebp
|
||||
movb %dl, %bl
|
||||
xorl %ebp, %esi
|
||||
movl 0x200+des_SPtrans(%ecx),%ebp
|
||||
xorl %ebp, %esi
|
||||
movb %dh, %cl
|
||||
shrl $16, %eax
|
||||
movl 0x100+des_SPtrans(%ebx),%ebp
|
||||
xorl %ebp, %esi
|
||||
movb %ah, %bl
|
||||
shrl $16, %edx
|
||||
movl 0x300+des_SPtrans(%ecx),%ebp
|
||||
xorl %ebp, %esi
|
||||
movl 28(%esp), %ebp
|
||||
movb %dh, %cl
|
||||
andl $0xff, %eax
|
||||
andl $0xff, %edx
|
||||
movl 0x600+des_SPtrans(%ebx),%ebx
|
||||
xorl %ebx, %esi
|
||||
movl 0x700+des_SPtrans(%ecx),%ebx
|
||||
xorl %ebx, %esi
|
||||
movl 0x400+des_SPtrans(%eax),%ebx
|
||||
xorl %ebx, %esi
|
||||
movl 0x500+des_SPtrans(%edx),%ebx
|
||||
xorl %ebx, %esi
|
||||
|
||||
# Round 14
|
||||
movl 32(%esp), %eax
|
||||
movl %esi, %edx
|
||||
shrl $16, %edx
|
||||
movl 36(%esp), %ecx
|
||||
xorl %esi, %edx
|
||||
andl %edx, %eax
|
||||
andl %ecx, %edx
|
||||
movl %eax, %ebx
|
||||
sall $16, %ebx
|
||||
movl %edx, %ecx
|
||||
sall $16, %ecx
|
||||
xorl %ebx, %eax
|
||||
xorl %ecx, %edx
|
||||
movl 112(%ebp), %ebx
|
||||
xorl %ebx, %eax
|
||||
movl 116(%ebp), %ecx
|
||||
xorl %esi, %eax
|
||||
xorl %esi, %edx
|
||||
xorl %ecx, %edx
|
||||
andl $0xfcfcfcfc, %eax
|
||||
xorl %ebx, %ebx
|
||||
andl $0xcfcfcfcf, %edx
|
||||
xorl %ecx, %ecx
|
||||
movb %al, %bl
|
||||
movb %ah, %cl
|
||||
rorl $4, %edx
|
||||
movl des_SPtrans(%ebx),%ebp
|
||||
movb %dl, %bl
|
||||
xorl %ebp, %edi
|
||||
movl 0x200+des_SPtrans(%ecx),%ebp
|
||||
xorl %ebp, %edi
|
||||
movb %dh, %cl
|
||||
shrl $16, %eax
|
||||
movl 0x100+des_SPtrans(%ebx),%ebp
|
||||
xorl %ebp, %edi
|
||||
movb %ah, %bl
|
||||
shrl $16, %edx
|
||||
movl 0x300+des_SPtrans(%ecx),%ebp
|
||||
xorl %ebp, %edi
|
||||
movl 28(%esp), %ebp
|
||||
movb %dh, %cl
|
||||
andl $0xff, %eax
|
||||
andl $0xff, %edx
|
||||
movl 0x600+des_SPtrans(%ebx),%ebx
|
||||
xorl %ebx, %edi
|
||||
movl 0x700+des_SPtrans(%ecx),%ebx
|
||||
xorl %ebx, %edi
|
||||
movl 0x400+des_SPtrans(%eax),%ebx
|
||||
xorl %ebx, %edi
|
||||
movl 0x500+des_SPtrans(%edx),%ebx
|
||||
xorl %ebx, %edi
|
||||
|
||||
# Round 15
|
||||
movl 32(%esp), %eax
|
||||
movl %edi, %edx
|
||||
shrl $16, %edx
|
||||
movl 36(%esp), %ecx
|
||||
xorl %edi, %edx
|
||||
andl %edx, %eax
|
||||
andl %ecx, %edx
|
||||
movl %eax, %ebx
|
||||
sall $16, %ebx
|
||||
movl %edx, %ecx
|
||||
sall $16, %ecx
|
||||
xorl %ebx, %eax
|
||||
xorl %ecx, %edx
|
||||
movl 120(%ebp), %ebx
|
||||
xorl %ebx, %eax
|
||||
movl 124(%ebp), %ecx
|
||||
xorl %edi, %eax
|
||||
xorl %edi, %edx
|
||||
xorl %ecx, %edx
|
||||
andl $0xfcfcfcfc, %eax
|
||||
xorl %ebx, %ebx
|
||||
andl $0xcfcfcfcf, %edx
|
||||
xorl %ecx, %ecx
|
||||
movb %al, %bl
|
||||
movb %ah, %cl
|
||||
rorl $4, %edx
|
||||
movl des_SPtrans(%ebx),%ebp
|
||||
movb %dl, %bl
|
||||
xorl %ebp, %esi
|
||||
movl 0x200+des_SPtrans(%ecx),%ebp
|
||||
xorl %ebp, %esi
|
||||
movb %dh, %cl
|
||||
shrl $16, %eax
|
||||
movl 0x100+des_SPtrans(%ebx),%ebp
|
||||
xorl %ebp, %esi
|
||||
movb %ah, %bl
|
||||
shrl $16, %edx
|
||||
movl 0x300+des_SPtrans(%ecx),%ebp
|
||||
xorl %ebp, %esi
|
||||
movl 28(%esp), %ebp
|
||||
movb %dh, %cl
|
||||
andl $0xff, %eax
|
||||
andl $0xff, %edx
|
||||
movl 0x600+des_SPtrans(%ebx),%ebx
|
||||
xorl %ebx, %esi
|
||||
movl 0x700+des_SPtrans(%ecx),%ebx
|
||||
xorl %ebx, %esi
|
||||
movl 0x400+des_SPtrans(%eax),%ebx
|
||||
xorl %ebx, %esi
|
||||
movl 0x500+des_SPtrans(%edx),%ebx
|
||||
xorl %ebx, %esi
|
||||
movl (%esp), %ebx
|
||||
movl %edi, %eax
|
||||
decl %ebx
|
||||
movl %esi, %edi
|
||||
movl %eax, %esi
|
||||
movl %ebx, (%esp)
|
||||
jnz .L000start
|
||||
|
||||
# FP
|
||||
movl 24(%esp), %edx
|
||||
.byte 209
|
||||
.byte 207 # rorl $1 %edi
|
||||
movl %esi, %eax
|
||||
xorl %edi, %esi
|
||||
andl $0xaaaaaaaa, %esi
|
||||
xorl %esi, %eax
|
||||
xorl %esi, %edi
|
||||
|
||||
roll $23, %eax
|
||||
movl %eax, %esi
|
||||
xorl %edi, %eax
|
||||
andl $0x03fc03fc, %eax
|
||||
xorl %eax, %esi
|
||||
xorl %eax, %edi
|
||||
|
||||
roll $10, %esi
|
||||
movl %esi, %eax
|
||||
xorl %edi, %esi
|
||||
andl $0x33333333, %esi
|
||||
xorl %esi, %eax
|
||||
xorl %esi, %edi
|
||||
|
||||
roll $18, %edi
|
||||
movl %edi, %esi
|
||||
xorl %eax, %edi
|
||||
andl $0xfff0000f, %edi
|
||||
xorl %edi, %esi
|
||||
xorl %edi, %eax
|
||||
|
||||
roll $12, %esi
|
||||
movl %esi, %edi
|
||||
xorl %eax, %esi
|
||||
andl $0xf0f0f0f0, %esi
|
||||
xorl %esi, %edi
|
||||
xorl %esi, %eax
|
||||
|
||||
rorl $4, %eax
|
||||
movl %eax, (%edx)
|
||||
movl %edi, 4(%edx)
|
||||
popl %ecx
|
||||
popl %edi
|
||||
popl %esi
|
||||
popl %ebx
|
||||
popl %ebp
|
||||
ret
|
||||
.fcrypt_body_end:
|
||||
.size fcrypt_body,.fcrypt_body_end-fcrypt_body
|
||||
.ident "fcrypt_body"
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,689 +0,0 @@
|
||||
# $FreeBSD$
|
||||
# Dont even think of reading this code
|
||||
# It was automatically generated by md5-586.pl
|
||||
# Which is a perl program used to generate the x86 assember for
|
||||
# any of elf, a.out, BSDI, Win32, gaswin (for GNU as on Win32) or Solaris
|
||||
# eric <eay@cryptsoft.com>
|
||||
|
||||
.file "md5-586.s"
|
||||
.version "01.01"
|
||||
gcc2_compiled.:
|
||||
.text
|
||||
.align 16
|
||||
.globl md5_block_asm_host_order
|
||||
.type md5_block_asm_host_order,@function
|
||||
md5_block_asm_host_order:
|
||||
pushl %esi
|
||||
pushl %edi
|
||||
movl 12(%esp), %edi
|
||||
movl 16(%esp), %esi
|
||||
movl 20(%esp), %ecx
|
||||
pushl %ebp
|
||||
sall $6, %ecx
|
||||
pushl %ebx
|
||||
addl %esi, %ecx
|
||||
subl $64, %ecx
|
||||
movl (%edi), %eax
|
||||
pushl %ecx
|
||||
movl 4(%edi), %ebx
|
||||
movl 8(%edi), %ecx
|
||||
movl 12(%edi), %edx
|
||||
.L000start:
|
||||
|
||||
# R0 section
|
||||
movl %ecx, %edi
|
||||
movl (%esi), %ebp
|
||||
# R0 0
|
||||
xorl %edx, %edi
|
||||
andl %ebx, %edi
|
||||
leal 3614090360(%eax,%ebp,1),%eax
|
||||
xorl %edx, %edi
|
||||
addl %edi, %eax
|
||||
movl %ebx, %edi
|
||||
roll $7, %eax
|
||||
movl 4(%esi), %ebp
|
||||
addl %ebx, %eax
|
||||
# R0 1
|
||||
xorl %ecx, %edi
|
||||
andl %eax, %edi
|
||||
leal 3905402710(%edx,%ebp,1),%edx
|
||||
xorl %ecx, %edi
|
||||
addl %edi, %edx
|
||||
movl %eax, %edi
|
||||
roll $12, %edx
|
||||
movl 8(%esi), %ebp
|
||||
addl %eax, %edx
|
||||
# R0 2
|
||||
xorl %ebx, %edi
|
||||
andl %edx, %edi
|
||||
leal 606105819(%ecx,%ebp,1),%ecx
|
||||
xorl %ebx, %edi
|
||||
addl %edi, %ecx
|
||||
movl %edx, %edi
|
||||
roll $17, %ecx
|
||||
movl 12(%esi), %ebp
|
||||
addl %edx, %ecx
|
||||
# R0 3
|
||||
xorl %eax, %edi
|
||||
andl %ecx, %edi
|
||||
leal 3250441966(%ebx,%ebp,1),%ebx
|
||||
xorl %eax, %edi
|
||||
addl %edi, %ebx
|
||||
movl %ecx, %edi
|
||||
roll $22, %ebx
|
||||
movl 16(%esi), %ebp
|
||||
addl %ecx, %ebx
|
||||
# R0 4
|
||||
xorl %edx, %edi
|
||||
andl %ebx, %edi
|
||||
leal 4118548399(%eax,%ebp,1),%eax
|
||||
xorl %edx, %edi
|
||||
addl %edi, %eax
|
||||
movl %ebx, %edi
|
||||
roll $7, %eax
|
||||
movl 20(%esi), %ebp
|
||||
addl %ebx, %eax
|
||||
# R0 5
|
||||
xorl %ecx, %edi
|
||||
andl %eax, %edi
|
||||
leal 1200080426(%edx,%ebp,1),%edx
|
||||
xorl %ecx, %edi
|
||||
addl %edi, %edx
|
||||
movl %eax, %edi
|
||||
roll $12, %edx
|
||||
movl 24(%esi), %ebp
|
||||
addl %eax, %edx
|
||||
# R0 6
|
||||
xorl %ebx, %edi
|
||||
andl %edx, %edi
|
||||
leal 2821735955(%ecx,%ebp,1),%ecx
|
||||
xorl %ebx, %edi
|
||||
addl %edi, %ecx
|
||||
movl %edx, %edi
|
||||
roll $17, %ecx
|
||||
movl 28(%esi), %ebp
|
||||
addl %edx, %ecx
|
||||
# R0 7
|
||||
xorl %eax, %edi
|
||||
andl %ecx, %edi
|
||||
leal 4249261313(%ebx,%ebp,1),%ebx
|
||||
xorl %eax, %edi
|
||||
addl %edi, %ebx
|
||||
movl %ecx, %edi
|
||||
roll $22, %ebx
|
||||
movl 32(%esi), %ebp
|
||||
addl %ecx, %ebx
|
||||
# R0 8
|
||||
xorl %edx, %edi
|
||||
andl %ebx, %edi
|
||||
leal 1770035416(%eax,%ebp,1),%eax
|
||||
xorl %edx, %edi
|
||||
addl %edi, %eax
|
||||
movl %ebx, %edi
|
||||
roll $7, %eax
|
||||
movl 36(%esi), %ebp
|
||||
addl %ebx, %eax
|
||||
# R0 9
|
||||
xorl %ecx, %edi
|
||||
andl %eax, %edi
|
||||
leal 2336552879(%edx,%ebp,1),%edx
|
||||
xorl %ecx, %edi
|
||||
addl %edi, %edx
|
||||
movl %eax, %edi
|
||||
roll $12, %edx
|
||||
movl 40(%esi), %ebp
|
||||
addl %eax, %edx
|
||||
# R0 10
|
||||
xorl %ebx, %edi
|
||||
andl %edx, %edi
|
||||
leal 4294925233(%ecx,%ebp,1),%ecx
|
||||
xorl %ebx, %edi
|
||||
addl %edi, %ecx
|
||||
movl %edx, %edi
|
||||
roll $17, %ecx
|
||||
movl 44(%esi), %ebp
|
||||
addl %edx, %ecx
|
||||
# R0 11
|
||||
xorl %eax, %edi
|
||||
andl %ecx, %edi
|
||||
leal 2304563134(%ebx,%ebp,1),%ebx
|
||||
xorl %eax, %edi
|
||||
addl %edi, %ebx
|
||||
movl %ecx, %edi
|
||||
roll $22, %ebx
|
||||
movl 48(%esi), %ebp
|
||||
addl %ecx, %ebx
|
||||
# R0 12
|
||||
xorl %edx, %edi
|
||||
andl %ebx, %edi
|
||||
leal 1804603682(%eax,%ebp,1),%eax
|
||||
xorl %edx, %edi
|
||||
addl %edi, %eax
|
||||
movl %ebx, %edi
|
||||
roll $7, %eax
|
||||
movl 52(%esi), %ebp
|
||||
addl %ebx, %eax
|
||||
# R0 13
|
||||
xorl %ecx, %edi
|
||||
andl %eax, %edi
|
||||
leal 4254626195(%edx,%ebp,1),%edx
|
||||
xorl %ecx, %edi
|
||||
addl %edi, %edx
|
||||
movl %eax, %edi
|
||||
roll $12, %edx
|
||||
movl 56(%esi), %ebp
|
||||
addl %eax, %edx
|
||||
# R0 14
|
||||
xorl %ebx, %edi
|
||||
andl %edx, %edi
|
||||
leal 2792965006(%ecx,%ebp,1),%ecx
|
||||
xorl %ebx, %edi
|
||||
addl %edi, %ecx
|
||||
movl %edx, %edi
|
||||
roll $17, %ecx
|
||||
movl 60(%esi), %ebp
|
||||
addl %edx, %ecx
|
||||
# R0 15
|
||||
xorl %eax, %edi
|
||||
andl %ecx, %edi
|
||||
leal 1236535329(%ebx,%ebp,1),%ebx
|
||||
xorl %eax, %edi
|
||||
addl %edi, %ebx
|
||||
movl %ecx, %edi
|
||||
roll $22, %ebx
|
||||
movl 4(%esi), %ebp
|
||||
addl %ecx, %ebx
|
||||
|
||||
# R1 section
|
||||
# R1 16
|
||||
leal 4129170786(%eax,%ebp,1),%eax
|
||||
xorl %ebx, %edi
|
||||
andl %edx, %edi
|
||||
movl 24(%esi), %ebp
|
||||
xorl %ecx, %edi
|
||||
addl %edi, %eax
|
||||
movl %ebx, %edi
|
||||
roll $5, %eax
|
||||
addl %ebx, %eax
|
||||
# R1 17
|
||||
leal 3225465664(%edx,%ebp,1),%edx
|
||||
xorl %eax, %edi
|
||||
andl %ecx, %edi
|
||||
movl 44(%esi), %ebp
|
||||
xorl %ebx, %edi
|
||||
addl %edi, %edx
|
||||
movl %eax, %edi
|
||||
roll $9, %edx
|
||||
addl %eax, %edx
|
||||
# R1 18
|
||||
leal 643717713(%ecx,%ebp,1),%ecx
|
||||
xorl %edx, %edi
|
||||
andl %ebx, %edi
|
||||
movl (%esi), %ebp
|
||||
xorl %eax, %edi
|
||||
addl %edi, %ecx
|
||||
movl %edx, %edi
|
||||
roll $14, %ecx
|
||||
addl %edx, %ecx
|
||||
# R1 19
|
||||
leal 3921069994(%ebx,%ebp,1),%ebx
|
||||
xorl %ecx, %edi
|
||||
andl %eax, %edi
|
||||
movl 20(%esi), %ebp
|
||||
xorl %edx, %edi
|
||||
addl %edi, %ebx
|
||||
movl %ecx, %edi
|
||||
roll $20, %ebx
|
||||
addl %ecx, %ebx
|
||||
# R1 20
|
||||
leal 3593408605(%eax,%ebp,1),%eax
|
||||
xorl %ebx, %edi
|
||||
andl %edx, %edi
|
||||
movl 40(%esi), %ebp
|
||||
xorl %ecx, %edi
|
||||
addl %edi, %eax
|
||||
movl %ebx, %edi
|
||||
roll $5, %eax
|
||||
addl %ebx, %eax
|
||||
# R1 21
|
||||
leal 38016083(%edx,%ebp,1),%edx
|
||||
xorl %eax, %edi
|
||||
andl %ecx, %edi
|
||||
movl 60(%esi), %ebp
|
||||
xorl %ebx, %edi
|
||||
addl %edi, %edx
|
||||
movl %eax, %edi
|
||||
roll $9, %edx
|
||||
addl %eax, %edx
|
||||
# R1 22
|
||||
leal 3634488961(%ecx,%ebp,1),%ecx
|
||||
xorl %edx, %edi
|
||||
andl %ebx, %edi
|
||||
movl 16(%esi), %ebp
|
||||
xorl %eax, %edi
|
||||
addl %edi, %ecx
|
||||
movl %edx, %edi
|
||||
roll $14, %ecx
|
||||
addl %edx, %ecx
|
||||
# R1 23
|
||||
leal 3889429448(%ebx,%ebp,1),%ebx
|
||||
xorl %ecx, %edi
|
||||
andl %eax, %edi
|
||||
movl 36(%esi), %ebp
|
||||
xorl %edx, %edi
|
||||
addl %edi, %ebx
|
||||
movl %ecx, %edi
|
||||
roll $20, %ebx
|
||||
addl %ecx, %ebx
|
||||
# R1 24
|
||||
leal 568446438(%eax,%ebp,1),%eax
|
||||
xorl %ebx, %edi
|
||||
andl %edx, %edi
|
||||
movl 56(%esi), %ebp
|
||||
xorl %ecx, %edi
|
||||
addl %edi, %eax
|
||||
movl %ebx, %edi
|
||||
roll $5, %eax
|
||||
addl %ebx, %eax
|
||||
# R1 25
|
||||
leal 3275163606(%edx,%ebp,1),%edx
|
||||
xorl %eax, %edi
|
||||
andl %ecx, %edi
|
||||
movl 12(%esi), %ebp
|
||||
xorl %ebx, %edi
|
||||
addl %edi, %edx
|
||||
movl %eax, %edi
|
||||
roll $9, %edx
|
||||
addl %eax, %edx
|
||||
# R1 26
|
||||
leal 4107603335(%ecx,%ebp,1),%ecx
|
||||
xorl %edx, %edi
|
||||
andl %ebx, %edi
|
||||
movl 32(%esi), %ebp
|
||||
xorl %eax, %edi
|
||||
addl %edi, %ecx
|
||||
movl %edx, %edi
|
||||
roll $14, %ecx
|
||||
addl %edx, %ecx
|
||||
# R1 27
|
||||
leal 1163531501(%ebx,%ebp,1),%ebx
|
||||
xorl %ecx, %edi
|
||||
andl %eax, %edi
|
||||
movl 52(%esi), %ebp
|
||||
xorl %edx, %edi
|
||||
addl %edi, %ebx
|
||||
movl %ecx, %edi
|
||||
roll $20, %ebx
|
||||
addl %ecx, %ebx
|
||||
# R1 28
|
||||
leal 2850285829(%eax,%ebp,1),%eax
|
||||
xorl %ebx, %edi
|
||||
andl %edx, %edi
|
||||
movl 8(%esi), %ebp
|
||||
xorl %ecx, %edi
|
||||
addl %edi, %eax
|
||||
movl %ebx, %edi
|
||||
roll $5, %eax
|
||||
addl %ebx, %eax
|
||||
# R1 29
|
||||
leal 4243563512(%edx,%ebp,1),%edx
|
||||
xorl %eax, %edi
|
||||
andl %ecx, %edi
|
||||
movl 28(%esi), %ebp
|
||||
xorl %ebx, %edi
|
||||
addl %edi, %edx
|
||||
movl %eax, %edi
|
||||
roll $9, %edx
|
||||
addl %eax, %edx
|
||||
# R1 30
|
||||
leal 1735328473(%ecx,%ebp,1),%ecx
|
||||
xorl %edx, %edi
|
||||
andl %ebx, %edi
|
||||
movl 48(%esi), %ebp
|
||||
xorl %eax, %edi
|
||||
addl %edi, %ecx
|
||||
movl %edx, %edi
|
||||
roll $14, %ecx
|
||||
addl %edx, %ecx
|
||||
# R1 31
|
||||
leal 2368359562(%ebx,%ebp,1),%ebx
|
||||
xorl %ecx, %edi
|
||||
andl %eax, %edi
|
||||
movl 20(%esi), %ebp
|
||||
xorl %edx, %edi
|
||||
addl %edi, %ebx
|
||||
movl %ecx, %edi
|
||||
roll $20, %ebx
|
||||
addl %ecx, %ebx
|
||||
|
||||
# R2 section
|
||||
# R2 32
|
||||
xorl %edx, %edi
|
||||
xorl %ebx, %edi
|
||||
leal 4294588738(%eax,%ebp,1),%eax
|
||||
addl %edi, %eax
|
||||
roll $4, %eax
|
||||
movl 32(%esi), %ebp
|
||||
movl %ebx, %edi
|
||||
# R2 33
|
||||
leal 2272392833(%edx,%ebp,1),%edx
|
||||
addl %ebx, %eax
|
||||
xorl %ecx, %edi
|
||||
xorl %eax, %edi
|
||||
movl 44(%esi), %ebp
|
||||
addl %edi, %edx
|
||||
movl %eax, %edi
|
||||
roll $11, %edx
|
||||
addl %eax, %edx
|
||||
# R2 34
|
||||
xorl %ebx, %edi
|
||||
xorl %edx, %edi
|
||||
leal 1839030562(%ecx,%ebp,1),%ecx
|
||||
addl %edi, %ecx
|
||||
roll $16, %ecx
|
||||
movl 56(%esi), %ebp
|
||||
movl %edx, %edi
|
||||
# R2 35
|
||||
leal 4259657740(%ebx,%ebp,1),%ebx
|
||||
addl %edx, %ecx
|
||||
xorl %eax, %edi
|
||||
xorl %ecx, %edi
|
||||
movl 4(%esi), %ebp
|
||||
addl %edi, %ebx
|
||||
movl %ecx, %edi
|
||||
roll $23, %ebx
|
||||
addl %ecx, %ebx
|
||||
# R2 36
|
||||
xorl %edx, %edi
|
||||
xorl %ebx, %edi
|
||||
leal 2763975236(%eax,%ebp,1),%eax
|
||||
addl %edi, %eax
|
||||
roll $4, %eax
|
||||
movl 16(%esi), %ebp
|
||||
movl %ebx, %edi
|
||||
# R2 37
|
||||
leal 1272893353(%edx,%ebp,1),%edx
|
||||
addl %ebx, %eax
|
||||
xorl %ecx, %edi
|
||||
xorl %eax, %edi
|
||||
movl 28(%esi), %ebp
|
||||
addl %edi, %edx
|
||||
movl %eax, %edi
|
||||
roll $11, %edx
|
||||
addl %eax, %edx
|
||||
# R2 38
|
||||
xorl %ebx, %edi
|
||||
xorl %edx, %edi
|
||||
leal 4139469664(%ecx,%ebp,1),%ecx
|
||||
addl %edi, %ecx
|
||||
roll $16, %ecx
|
||||
movl 40(%esi), %ebp
|
||||
movl %edx, %edi
|
||||
# R2 39
|
||||
leal 3200236656(%ebx,%ebp,1),%ebx
|
||||
addl %edx, %ecx
|
||||
xorl %eax, %edi
|
||||
xorl %ecx, %edi
|
||||
movl 52(%esi), %ebp
|
||||
addl %edi, %ebx
|
||||
movl %ecx, %edi
|
||||
roll $23, %ebx
|
||||
addl %ecx, %ebx
|
||||
# R2 40
|
||||
xorl %edx, %edi
|
||||
xorl %ebx, %edi
|
||||
leal 681279174(%eax,%ebp,1),%eax
|
||||
addl %edi, %eax
|
||||
roll $4, %eax
|
||||
movl (%esi), %ebp
|
||||
movl %ebx, %edi
|
||||
# R2 41
|
||||
leal 3936430074(%edx,%ebp,1),%edx
|
||||
addl %ebx, %eax
|
||||
xorl %ecx, %edi
|
||||
xorl %eax, %edi
|
||||
movl 12(%esi), %ebp
|
||||
addl %edi, %edx
|
||||
movl %eax, %edi
|
||||
roll $11, %edx
|
||||
addl %eax, %edx
|
||||
# R2 42
|
||||
xorl %ebx, %edi
|
||||
xorl %edx, %edi
|
||||
leal 3572445317(%ecx,%ebp,1),%ecx
|
||||
addl %edi, %ecx
|
||||
roll $16, %ecx
|
||||
movl 24(%esi), %ebp
|
||||
movl %edx, %edi
|
||||
# R2 43
|
||||
leal 76029189(%ebx,%ebp,1),%ebx
|
||||
addl %edx, %ecx
|
||||
xorl %eax, %edi
|
||||
xorl %ecx, %edi
|
||||
movl 36(%esi), %ebp
|
||||
addl %edi, %ebx
|
||||
movl %ecx, %edi
|
||||
roll $23, %ebx
|
||||
addl %ecx, %ebx
|
||||
# R2 44
|
||||
xorl %edx, %edi
|
||||
xorl %ebx, %edi
|
||||
leal 3654602809(%eax,%ebp,1),%eax
|
||||
addl %edi, %eax
|
||||
roll $4, %eax
|
||||
movl 48(%esi), %ebp
|
||||
movl %ebx, %edi
|
||||
# R2 45
|
||||
leal 3873151461(%edx,%ebp,1),%edx
|
||||
addl %ebx, %eax
|
||||
xorl %ecx, %edi
|
||||
xorl %eax, %edi
|
||||
movl 60(%esi), %ebp
|
||||
addl %edi, %edx
|
||||
movl %eax, %edi
|
||||
roll $11, %edx
|
||||
addl %eax, %edx
|
||||
# R2 46
|
||||
xorl %ebx, %edi
|
||||
xorl %edx, %edi
|
||||
leal 530742520(%ecx,%ebp,1),%ecx
|
||||
addl %edi, %ecx
|
||||
roll $16, %ecx
|
||||
movl 8(%esi), %ebp
|
||||
movl %edx, %edi
|
||||
# R2 47
|
||||
leal 3299628645(%ebx,%ebp,1),%ebx
|
||||
addl %edx, %ecx
|
||||
xorl %eax, %edi
|
||||
xorl %ecx, %edi
|
||||
movl (%esi), %ebp
|
||||
addl %edi, %ebx
|
||||
movl $-1, %edi
|
||||
roll $23, %ebx
|
||||
addl %ecx, %ebx
|
||||
|
||||
# R3 section
|
||||
# R3 48
|
||||
xorl %edx, %edi
|
||||
orl %ebx, %edi
|
||||
leal 4096336452(%eax,%ebp,1),%eax
|
||||
xorl %ecx, %edi
|
||||
movl 28(%esi), %ebp
|
||||
addl %edi, %eax
|
||||
movl $-1, %edi
|
||||
roll $6, %eax
|
||||
xorl %ecx, %edi
|
||||
addl %ebx, %eax
|
||||
# R3 49
|
||||
orl %eax, %edi
|
||||
leal 1126891415(%edx,%ebp,1),%edx
|
||||
xorl %ebx, %edi
|
||||
movl 56(%esi), %ebp
|
||||
addl %edi, %edx
|
||||
movl $-1, %edi
|
||||
roll $10, %edx
|
||||
xorl %ebx, %edi
|
||||
addl %eax, %edx
|
||||
# R3 50
|
||||
orl %edx, %edi
|
||||
leal 2878612391(%ecx,%ebp,1),%ecx
|
||||
xorl %eax, %edi
|
||||
movl 20(%esi), %ebp
|
||||
addl %edi, %ecx
|
||||
movl $-1, %edi
|
||||
roll $15, %ecx
|
||||
xorl %eax, %edi
|
||||
addl %edx, %ecx
|
||||
# R3 51
|
||||
orl %ecx, %edi
|
||||
leal 4237533241(%ebx,%ebp,1),%ebx
|
||||
xorl %edx, %edi
|
||||
movl 48(%esi), %ebp
|
||||
addl %edi, %ebx
|
||||
movl $-1, %edi
|
||||
roll $21, %ebx
|
||||
xorl %edx, %edi
|
||||
addl %ecx, %ebx
|
||||
# R3 52
|
||||
orl %ebx, %edi
|
||||
leal 1700485571(%eax,%ebp,1),%eax
|
||||
xorl %ecx, %edi
|
||||
movl 12(%esi), %ebp
|
||||
addl %edi, %eax
|
||||
movl $-1, %edi
|
||||
roll $6, %eax
|
||||
xorl %ecx, %edi
|
||||
addl %ebx, %eax
|
||||
# R3 53
|
||||
orl %eax, %edi
|
||||
leal 2399980690(%edx,%ebp,1),%edx
|
||||
xorl %ebx, %edi
|
||||
movl 40(%esi), %ebp
|
||||
addl %edi, %edx
|
||||
movl $-1, %edi
|
||||
roll $10, %edx
|
||||
xorl %ebx, %edi
|
||||
addl %eax, %edx
|
||||
# R3 54
|
||||
orl %edx, %edi
|
||||
leal 4293915773(%ecx,%ebp,1),%ecx
|
||||
xorl %eax, %edi
|
||||
movl 4(%esi), %ebp
|
||||
addl %edi, %ecx
|
||||
movl $-1, %edi
|
||||
roll $15, %ecx
|
||||
xorl %eax, %edi
|
||||
addl %edx, %ecx
|
||||
# R3 55
|
||||
orl %ecx, %edi
|
||||
leal 2240044497(%ebx,%ebp,1),%ebx
|
||||
xorl %edx, %edi
|
||||
movl 32(%esi), %ebp
|
||||
addl %edi, %ebx
|
||||
movl $-1, %edi
|
||||
roll $21, %ebx
|
||||
xorl %edx, %edi
|
||||
addl %ecx, %ebx
|
||||
# R3 56
|
||||
orl %ebx, %edi
|
||||
leal 1873313359(%eax,%ebp,1),%eax
|
||||
xorl %ecx, %edi
|
||||
movl 60(%esi), %ebp
|
||||
addl %edi, %eax
|
||||
movl $-1, %edi
|
||||
roll $6, %eax
|
||||
xorl %ecx, %edi
|
||||
addl %ebx, %eax
|
||||
# R3 57
|
||||
orl %eax, %edi
|
||||
leal 4264355552(%edx,%ebp,1),%edx
|
||||
xorl %ebx, %edi
|
||||
movl 24(%esi), %ebp
|
||||
addl %edi, %edx
|
||||
movl $-1, %edi
|
||||
roll $10, %edx
|
||||
xorl %ebx, %edi
|
||||
addl %eax, %edx
|
||||
# R3 58
|
||||
orl %edx, %edi
|
||||
leal 2734768916(%ecx,%ebp,1),%ecx
|
||||
xorl %eax, %edi
|
||||
movl 52(%esi), %ebp
|
||||
addl %edi, %ecx
|
||||
movl $-1, %edi
|
||||
roll $15, %ecx
|
||||
xorl %eax, %edi
|
||||
addl %edx, %ecx
|
||||
# R3 59
|
||||
orl %ecx, %edi
|
||||
leal 1309151649(%ebx,%ebp,1),%ebx
|
||||
xorl %edx, %edi
|
||||
movl 16(%esi), %ebp
|
||||
addl %edi, %ebx
|
||||
movl $-1, %edi
|
||||
roll $21, %ebx
|
||||
xorl %edx, %edi
|
||||
addl %ecx, %ebx
|
||||
# R3 60
|
||||
orl %ebx, %edi
|
||||
leal 4149444226(%eax,%ebp,1),%eax
|
||||
xorl %ecx, %edi
|
||||
movl 44(%esi), %ebp
|
||||
addl %edi, %eax
|
||||
movl $-1, %edi
|
||||
roll $6, %eax
|
||||
xorl %ecx, %edi
|
||||
addl %ebx, %eax
|
||||
# R3 61
|
||||
orl %eax, %edi
|
||||
leal 3174756917(%edx,%ebp,1),%edx
|
||||
xorl %ebx, %edi
|
||||
movl 8(%esi), %ebp
|
||||
addl %edi, %edx
|
||||
movl $-1, %edi
|
||||
roll $10, %edx
|
||||
xorl %ebx, %edi
|
||||
addl %eax, %edx
|
||||
# R3 62
|
||||
orl %edx, %edi
|
||||
leal 718787259(%ecx,%ebp,1),%ecx
|
||||
xorl %eax, %edi
|
||||
movl 36(%esi), %ebp
|
||||
addl %edi, %ecx
|
||||
movl $-1, %edi
|
||||
roll $15, %ecx
|
||||
xorl %eax, %edi
|
||||
addl %edx, %ecx
|
||||
# R3 63
|
||||
orl %ecx, %edi
|
||||
leal 3951481745(%ebx,%ebp,1),%ebx
|
||||
xorl %edx, %edi
|
||||
movl 24(%esp), %ebp
|
||||
addl %edi, %ebx
|
||||
addl $64, %esi
|
||||
roll $21, %ebx
|
||||
movl (%ebp), %edi
|
||||
addl %ecx, %ebx
|
||||
addl %edi, %eax
|
||||
movl 4(%ebp), %edi
|
||||
addl %edi, %ebx
|
||||
movl 8(%ebp), %edi
|
||||
addl %edi, %ecx
|
||||
movl 12(%ebp), %edi
|
||||
addl %edi, %edx
|
||||
movl %eax, (%ebp)
|
||||
movl %ebx, 4(%ebp)
|
||||
movl (%esp), %edi
|
||||
movl %ecx, 8(%ebp)
|
||||
movl %edx, 12(%ebp)
|
||||
cmpl %esi, %edi
|
||||
jge .L000start
|
||||
popl %eax
|
||||
popl %ebx
|
||||
popl %ebp
|
||||
popl %edi
|
||||
popl %esi
|
||||
ret
|
||||
.L_md5_block_asm_host_order_end:
|
||||
.size md5_block_asm_host_order,.L_md5_block_asm_host_order_end-md5_block_asm_host_order
|
||||
.ident "desasm.pl"
|
||||
@@ -1,316 +0,0 @@
|
||||
# $FreeBSD$
|
||||
# Dont even think of reading this code
|
||||
# It was automatically generated by rc4-586.pl
|
||||
# Which is a perl program used to generate the x86 assember for
|
||||
# any of elf, a.out, BSDI, Win32, gaswin (for GNU as on Win32) or Solaris
|
||||
# eric <eay@cryptsoft.com>
|
||||
|
||||
.file "rc4-586.s"
|
||||
.version "01.01"
|
||||
gcc2_compiled.:
|
||||
.text
|
||||
.align 16
|
||||
.globl RC4
|
||||
.type RC4,@function
|
||||
RC4:
|
||||
|
||||
pushl %ebp
|
||||
pushl %ebx
|
||||
movl 12(%esp), %ebp
|
||||
movl 16(%esp), %ebx
|
||||
pushl %esi
|
||||
pushl %edi
|
||||
movl (%ebp), %ecx
|
||||
movl 4(%ebp), %edx
|
||||
movl 28(%esp), %esi
|
||||
incl %ecx
|
||||
subl $12, %esp
|
||||
addl $8, %ebp
|
||||
andl $255, %ecx
|
||||
leal -8(%ebx,%esi), %ebx
|
||||
movl 44(%esp), %edi
|
||||
movl %ebx, 8(%esp)
|
||||
movl (%ebp,%ecx,4), %eax
|
||||
cmpl %esi, %ebx
|
||||
jl .L000end
|
||||
.L001start:
|
||||
addl $8, %esi
|
||||
# Round 0
|
||||
addl %eax, %edx
|
||||
andl $255, %edx
|
||||
incl %ecx
|
||||
movl (%ebp,%edx,4), %ebx
|
||||
movl %ebx, -4(%ebp,%ecx,4)
|
||||
addl %eax, %ebx
|
||||
andl $255, %ecx
|
||||
andl $255, %ebx
|
||||
movl %eax, (%ebp,%edx,4)
|
||||
nop
|
||||
movl (%ebp,%ebx,4), %ebx
|
||||
movl (%ebp,%ecx,4), %eax
|
||||
movb %bl, (%esp)
|
||||
# Round 1
|
||||
addl %eax, %edx
|
||||
andl $255, %edx
|
||||
incl %ecx
|
||||
movl (%ebp,%edx,4), %ebx
|
||||
movl %ebx, -4(%ebp,%ecx,4)
|
||||
addl %eax, %ebx
|
||||
andl $255, %ecx
|
||||
andl $255, %ebx
|
||||
movl %eax, (%ebp,%edx,4)
|
||||
nop
|
||||
movl (%ebp,%ebx,4), %ebx
|
||||
movl (%ebp,%ecx,4), %eax
|
||||
movb %bl, 1(%esp)
|
||||
# Round 2
|
||||
addl %eax, %edx
|
||||
andl $255, %edx
|
||||
incl %ecx
|
||||
movl (%ebp,%edx,4), %ebx
|
||||
movl %ebx, -4(%ebp,%ecx,4)
|
||||
addl %eax, %ebx
|
||||
andl $255, %ecx
|
||||
andl $255, %ebx
|
||||
movl %eax, (%ebp,%edx,4)
|
||||
nop
|
||||
movl (%ebp,%ebx,4), %ebx
|
||||
movl (%ebp,%ecx,4), %eax
|
||||
movb %bl, 2(%esp)
|
||||
# Round 3
|
||||
addl %eax, %edx
|
||||
andl $255, %edx
|
||||
incl %ecx
|
||||
movl (%ebp,%edx,4), %ebx
|
||||
movl %ebx, -4(%ebp,%ecx,4)
|
||||
addl %eax, %ebx
|
||||
andl $255, %ecx
|
||||
andl $255, %ebx
|
||||
movl %eax, (%ebp,%edx,4)
|
||||
nop
|
||||
movl (%ebp,%ebx,4), %ebx
|
||||
movl (%ebp,%ecx,4), %eax
|
||||
movb %bl, 3(%esp)
|
||||
# Round 4
|
||||
addl %eax, %edx
|
||||
andl $255, %edx
|
||||
incl %ecx
|
||||
movl (%ebp,%edx,4), %ebx
|
||||
movl %ebx, -4(%ebp,%ecx,4)
|
||||
addl %eax, %ebx
|
||||
andl $255, %ecx
|
||||
andl $255, %ebx
|
||||
movl %eax, (%ebp,%edx,4)
|
||||
nop
|
||||
movl (%ebp,%ebx,4), %ebx
|
||||
movl (%ebp,%ecx,4), %eax
|
||||
movb %bl, 4(%esp)
|
||||
# Round 5
|
||||
addl %eax, %edx
|
||||
andl $255, %edx
|
||||
incl %ecx
|
||||
movl (%ebp,%edx,4), %ebx
|
||||
movl %ebx, -4(%ebp,%ecx,4)
|
||||
addl %eax, %ebx
|
||||
andl $255, %ecx
|
||||
andl $255, %ebx
|
||||
movl %eax, (%ebp,%edx,4)
|
||||
nop
|
||||
movl (%ebp,%ebx,4), %ebx
|
||||
movl (%ebp,%ecx,4), %eax
|
||||
movb %bl, 5(%esp)
|
||||
# Round 6
|
||||
addl %eax, %edx
|
||||
andl $255, %edx
|
||||
incl %ecx
|
||||
movl (%ebp,%edx,4), %ebx
|
||||
movl %ebx, -4(%ebp,%ecx,4)
|
||||
addl %eax, %ebx
|
||||
andl $255, %ecx
|
||||
andl $255, %ebx
|
||||
movl %eax, (%ebp,%edx,4)
|
||||
nop
|
||||
movl (%ebp,%ebx,4), %ebx
|
||||
movl (%ebp,%ecx,4), %eax
|
||||
movb %bl, 6(%esp)
|
||||
# Round 7
|
||||
addl %eax, %edx
|
||||
andl $255, %edx
|
||||
incl %ecx
|
||||
movl (%ebp,%edx,4), %ebx
|
||||
movl %ebx, -4(%ebp,%ecx,4)
|
||||
addl %eax, %ebx
|
||||
andl $255, %ecx
|
||||
andl $255, %ebx
|
||||
movl %eax, (%ebp,%edx,4)
|
||||
nop
|
||||
movl (%ebp,%ebx,4), %ebx
|
||||
addl $8, %edi
|
||||
movb %bl, 7(%esp)
|
||||
# apply the cipher text
|
||||
movl (%esp), %eax
|
||||
movl -8(%esi), %ebx
|
||||
xorl %ebx, %eax
|
||||
movl -4(%esi), %ebx
|
||||
movl %eax, -8(%edi)
|
||||
movl 4(%esp), %eax
|
||||
xorl %ebx, %eax
|
||||
movl 8(%esp), %ebx
|
||||
movl %eax, -4(%edi)
|
||||
movl (%ebp,%ecx,4), %eax
|
||||
cmpl %ebx, %esi
|
||||
jle .L001start
|
||||
.L000end:
|
||||
# Round 0
|
||||
addl $8, %ebx
|
||||
incl %esi
|
||||
cmpl %esi, %ebx
|
||||
jl .L002finished
|
||||
movl %ebx, 8(%esp)
|
||||
addl %eax, %edx
|
||||
andl $255, %edx
|
||||
incl %ecx
|
||||
movl (%ebp,%edx,4), %ebx
|
||||
movl %ebx, -4(%ebp,%ecx,4)
|
||||
addl %eax, %ebx
|
||||
andl $255, %ecx
|
||||
andl $255, %ebx
|
||||
movl %eax, (%ebp,%edx,4)
|
||||
nop
|
||||
movl (%ebp,%ebx,4), %ebx
|
||||
movl (%ebp,%ecx,4), %eax
|
||||
movb -1(%esi), %bh
|
||||
xorb %bh, %bl
|
||||
movb %bl, (%edi)
|
||||
# Round 1
|
||||
movl 8(%esp), %ebx
|
||||
cmpl %esi, %ebx
|
||||
jle .L002finished
|
||||
incl %esi
|
||||
addl %eax, %edx
|
||||
andl $255, %edx
|
||||
incl %ecx
|
||||
movl (%ebp,%edx,4), %ebx
|
||||
movl %ebx, -4(%ebp,%ecx,4)
|
||||
addl %eax, %ebx
|
||||
andl $255, %ecx
|
||||
andl $255, %ebx
|
||||
movl %eax, (%ebp,%edx,4)
|
||||
nop
|
||||
movl (%ebp,%ebx,4), %ebx
|
||||
movl (%ebp,%ecx,4), %eax
|
||||
movb -1(%esi), %bh
|
||||
xorb %bh, %bl
|
||||
movb %bl, 1(%edi)
|
||||
# Round 2
|
||||
movl 8(%esp), %ebx
|
||||
cmpl %esi, %ebx
|
||||
jle .L002finished
|
||||
incl %esi
|
||||
addl %eax, %edx
|
||||
andl $255, %edx
|
||||
incl %ecx
|
||||
movl (%ebp,%edx,4), %ebx
|
||||
movl %ebx, -4(%ebp,%ecx,4)
|
||||
addl %eax, %ebx
|
||||
andl $255, %ecx
|
||||
andl $255, %ebx
|
||||
movl %eax, (%ebp,%edx,4)
|
||||
nop
|
||||
movl (%ebp,%ebx,4), %ebx
|
||||
movl (%ebp,%ecx,4), %eax
|
||||
movb -1(%esi), %bh
|
||||
xorb %bh, %bl
|
||||
movb %bl, 2(%edi)
|
||||
# Round 3
|
||||
movl 8(%esp), %ebx
|
||||
cmpl %esi, %ebx
|
||||
jle .L002finished
|
||||
incl %esi
|
||||
addl %eax, %edx
|
||||
andl $255, %edx
|
||||
incl %ecx
|
||||
movl (%ebp,%edx,4), %ebx
|
||||
movl %ebx, -4(%ebp,%ecx,4)
|
||||
addl %eax, %ebx
|
||||
andl $255, %ecx
|
||||
andl $255, %ebx
|
||||
movl %eax, (%ebp,%edx,4)
|
||||
nop
|
||||
movl (%ebp,%ebx,4), %ebx
|
||||
movl (%ebp,%ecx,4), %eax
|
||||
movb -1(%esi), %bh
|
||||
xorb %bh, %bl
|
||||
movb %bl, 3(%edi)
|
||||
# Round 4
|
||||
movl 8(%esp), %ebx
|
||||
cmpl %esi, %ebx
|
||||
jle .L002finished
|
||||
incl %esi
|
||||
addl %eax, %edx
|
||||
andl $255, %edx
|
||||
incl %ecx
|
||||
movl (%ebp,%edx,4), %ebx
|
||||
movl %ebx, -4(%ebp,%ecx,4)
|
||||
addl %eax, %ebx
|
||||
andl $255, %ecx
|
||||
andl $255, %ebx
|
||||
movl %eax, (%ebp,%edx,4)
|
||||
nop
|
||||
movl (%ebp,%ebx,4), %ebx
|
||||
movl (%ebp,%ecx,4), %eax
|
||||
movb -1(%esi), %bh
|
||||
xorb %bh, %bl
|
||||
movb %bl, 4(%edi)
|
||||
# Round 5
|
||||
movl 8(%esp), %ebx
|
||||
cmpl %esi, %ebx
|
||||
jle .L002finished
|
||||
incl %esi
|
||||
addl %eax, %edx
|
||||
andl $255, %edx
|
||||
incl %ecx
|
||||
movl (%ebp,%edx,4), %ebx
|
||||
movl %ebx, -4(%ebp,%ecx,4)
|
||||
addl %eax, %ebx
|
||||
andl $255, %ecx
|
||||
andl $255, %ebx
|
||||
movl %eax, (%ebp,%edx,4)
|
||||
nop
|
||||
movl (%ebp,%ebx,4), %ebx
|
||||
movl (%ebp,%ecx,4), %eax
|
||||
movb -1(%esi), %bh
|
||||
xorb %bh, %bl
|
||||
movb %bl, 5(%edi)
|
||||
# Round 6
|
||||
movl 8(%esp), %ebx
|
||||
cmpl %esi, %ebx
|
||||
jle .L002finished
|
||||
incl %esi
|
||||
addl %eax, %edx
|
||||
andl $255, %edx
|
||||
incl %ecx
|
||||
movl (%ebp,%edx,4), %ebx
|
||||
movl %ebx, -4(%ebp,%ecx,4)
|
||||
addl %eax, %ebx
|
||||
andl $255, %ecx
|
||||
andl $255, %ebx
|
||||
movl %eax, (%ebp,%edx,4)
|
||||
nop
|
||||
movl (%ebp,%ebx,4), %ebx
|
||||
movb -1(%esi), %bh
|
||||
xorb %bh, %bl
|
||||
movb %bl, 6(%edi)
|
||||
.L002finished:
|
||||
decl %ecx
|
||||
addl $12, %esp
|
||||
movl %edx, -4(%ebp)
|
||||
movb %cl, -8(%ebp)
|
||||
popl %edi
|
||||
popl %esi
|
||||
popl %ebx
|
||||
popl %ebp
|
||||
ret
|
||||
.RC4_end:
|
||||
.size RC4,.RC4_end-RC4
|
||||
.ident "RC4"
|
||||
@@ -1,584 +0,0 @@
|
||||
# $FreeBSD$
|
||||
# Dont even think of reading this code
|
||||
# It was automatically generated by rc5-586.pl
|
||||
# Which is a perl program used to generate the x86 assember for
|
||||
# any of elf, a.out, BSDI, Win32, gaswin (for GNU as on Win32) or Solaris
|
||||
# eric <eay@cryptsoft.com>
|
||||
|
||||
.file "rc5-586.s"
|
||||
.version "01.01"
|
||||
gcc2_compiled.:
|
||||
.text
|
||||
.align 16
|
||||
.globl RC5_32_encrypt
|
||||
.type RC5_32_encrypt,@function
|
||||
RC5_32_encrypt:
|
||||
|
||||
pushl %ebp
|
||||
pushl %esi
|
||||
pushl %edi
|
||||
movl 16(%esp), %edx
|
||||
movl 20(%esp), %ebp
|
||||
# Load the 2 words
|
||||
movl (%edx), %edi
|
||||
movl 4(%edx), %esi
|
||||
pushl %ebx
|
||||
movl (%ebp), %ebx
|
||||
addl 4(%ebp), %edi
|
||||
addl 8(%ebp), %esi
|
||||
xorl %esi, %edi
|
||||
movl 12(%ebp), %eax
|
||||
movl %esi, %ecx
|
||||
roll %cl, %edi
|
||||
addl %eax, %edi
|
||||
xorl %edi, %esi
|
||||
movl 16(%ebp), %eax
|
||||
movl %edi, %ecx
|
||||
roll %cl, %esi
|
||||
addl %eax, %esi
|
||||
xorl %esi, %edi
|
||||
movl 20(%ebp), %eax
|
||||
movl %esi, %ecx
|
||||
roll %cl, %edi
|
||||
addl %eax, %edi
|
||||
xorl %edi, %esi
|
||||
movl 24(%ebp), %eax
|
||||
movl %edi, %ecx
|
||||
roll %cl, %esi
|
||||
addl %eax, %esi
|
||||
xorl %esi, %edi
|
||||
movl 28(%ebp), %eax
|
||||
movl %esi, %ecx
|
||||
roll %cl, %edi
|
||||
addl %eax, %edi
|
||||
xorl %edi, %esi
|
||||
movl 32(%ebp), %eax
|
||||
movl %edi, %ecx
|
||||
roll %cl, %esi
|
||||
addl %eax, %esi
|
||||
xorl %esi, %edi
|
||||
movl 36(%ebp), %eax
|
||||
movl %esi, %ecx
|
||||
roll %cl, %edi
|
||||
addl %eax, %edi
|
||||
xorl %edi, %esi
|
||||
movl 40(%ebp), %eax
|
||||
movl %edi, %ecx
|
||||
roll %cl, %esi
|
||||
addl %eax, %esi
|
||||
xorl %esi, %edi
|
||||
movl 44(%ebp), %eax
|
||||
movl %esi, %ecx
|
||||
roll %cl, %edi
|
||||
addl %eax, %edi
|
||||
xorl %edi, %esi
|
||||
movl 48(%ebp), %eax
|
||||
movl %edi, %ecx
|
||||
roll %cl, %esi
|
||||
addl %eax, %esi
|
||||
xorl %esi, %edi
|
||||
movl 52(%ebp), %eax
|
||||
movl %esi, %ecx
|
||||
roll %cl, %edi
|
||||
addl %eax, %edi
|
||||
xorl %edi, %esi
|
||||
movl 56(%ebp), %eax
|
||||
movl %edi, %ecx
|
||||
roll %cl, %esi
|
||||
addl %eax, %esi
|
||||
xorl %esi, %edi
|
||||
movl 60(%ebp), %eax
|
||||
movl %esi, %ecx
|
||||
roll %cl, %edi
|
||||
addl %eax, %edi
|
||||
xorl %edi, %esi
|
||||
movl 64(%ebp), %eax
|
||||
movl %edi, %ecx
|
||||
roll %cl, %esi
|
||||
addl %eax, %esi
|
||||
xorl %esi, %edi
|
||||
movl 68(%ebp), %eax
|
||||
movl %esi, %ecx
|
||||
roll %cl, %edi
|
||||
addl %eax, %edi
|
||||
xorl %edi, %esi
|
||||
movl 72(%ebp), %eax
|
||||
movl %edi, %ecx
|
||||
roll %cl, %esi
|
||||
addl %eax, %esi
|
||||
cmpl $8, %ebx
|
||||
je .L000rc5_exit
|
||||
xorl %esi, %edi
|
||||
movl 76(%ebp), %eax
|
||||
movl %esi, %ecx
|
||||
roll %cl, %edi
|
||||
addl %eax, %edi
|
||||
xorl %edi, %esi
|
||||
movl 80(%ebp), %eax
|
||||
movl %edi, %ecx
|
||||
roll %cl, %esi
|
||||
addl %eax, %esi
|
||||
xorl %esi, %edi
|
||||
movl 84(%ebp), %eax
|
||||
movl %esi, %ecx
|
||||
roll %cl, %edi
|
||||
addl %eax, %edi
|
||||
xorl %edi, %esi
|
||||
movl 88(%ebp), %eax
|
||||
movl %edi, %ecx
|
||||
roll %cl, %esi
|
||||
addl %eax, %esi
|
||||
xorl %esi, %edi
|
||||
movl 92(%ebp), %eax
|
||||
movl %esi, %ecx
|
||||
roll %cl, %edi
|
||||
addl %eax, %edi
|
||||
xorl %edi, %esi
|
||||
movl 96(%ebp), %eax
|
||||
movl %edi, %ecx
|
||||
roll %cl, %esi
|
||||
addl %eax, %esi
|
||||
xorl %esi, %edi
|
||||
movl 100(%ebp), %eax
|
||||
movl %esi, %ecx
|
||||
roll %cl, %edi
|
||||
addl %eax, %edi
|
||||
xorl %edi, %esi
|
||||
movl 104(%ebp), %eax
|
||||
movl %edi, %ecx
|
||||
roll %cl, %esi
|
||||
addl %eax, %esi
|
||||
cmpl $12, %ebx
|
||||
je .L000rc5_exit
|
||||
xorl %esi, %edi
|
||||
movl 108(%ebp), %eax
|
||||
movl %esi, %ecx
|
||||
roll %cl, %edi
|
||||
addl %eax, %edi
|
||||
xorl %edi, %esi
|
||||
movl 112(%ebp), %eax
|
||||
movl %edi, %ecx
|
||||
roll %cl, %esi
|
||||
addl %eax, %esi
|
||||
xorl %esi, %edi
|
||||
movl 116(%ebp), %eax
|
||||
movl %esi, %ecx
|
||||
roll %cl, %edi
|
||||
addl %eax, %edi
|
||||
xorl %edi, %esi
|
||||
movl 120(%ebp), %eax
|
||||
movl %edi, %ecx
|
||||
roll %cl, %esi
|
||||
addl %eax, %esi
|
||||
xorl %esi, %edi
|
||||
movl 124(%ebp), %eax
|
||||
movl %esi, %ecx
|
||||
roll %cl, %edi
|
||||
addl %eax, %edi
|
||||
xorl %edi, %esi
|
||||
movl 128(%ebp), %eax
|
||||
movl %edi, %ecx
|
||||
roll %cl, %esi
|
||||
addl %eax, %esi
|
||||
xorl %esi, %edi
|
||||
movl 132(%ebp), %eax
|
||||
movl %esi, %ecx
|
||||
roll %cl, %edi
|
||||
addl %eax, %edi
|
||||
xorl %edi, %esi
|
||||
movl 136(%ebp), %eax
|
||||
movl %edi, %ecx
|
||||
roll %cl, %esi
|
||||
addl %eax, %esi
|
||||
.L000rc5_exit:
|
||||
movl %edi, (%edx)
|
||||
movl %esi, 4(%edx)
|
||||
popl %ebx
|
||||
popl %edi
|
||||
popl %esi
|
||||
popl %ebp
|
||||
ret
|
||||
.L_RC5_32_encrypt_end:
|
||||
.size RC5_32_encrypt,.L_RC5_32_encrypt_end-RC5_32_encrypt
|
||||
.ident "desasm.pl"
|
||||
.text
|
||||
.align 16
|
||||
.globl RC5_32_decrypt
|
||||
.type RC5_32_decrypt,@function
|
||||
RC5_32_decrypt:
|
||||
|
||||
pushl %ebp
|
||||
pushl %esi
|
||||
pushl %edi
|
||||
movl 16(%esp), %edx
|
||||
movl 20(%esp), %ebp
|
||||
# Load the 2 words
|
||||
movl (%edx), %edi
|
||||
movl 4(%edx), %esi
|
||||
pushl %ebx
|
||||
movl (%ebp), %ebx
|
||||
cmpl $12, %ebx
|
||||
je .L001rc5_dec_12
|
||||
cmpl $8, %ebx
|
||||
je .L002rc5_dec_8
|
||||
movl 136(%ebp), %eax
|
||||
subl %eax, %esi
|
||||
movl %edi, %ecx
|
||||
rorl %cl, %esi
|
||||
xorl %edi, %esi
|
||||
movl 132(%ebp), %eax
|
||||
subl %eax, %edi
|
||||
movl %esi, %ecx
|
||||
rorl %cl, %edi
|
||||
xorl %esi, %edi
|
||||
movl 128(%ebp), %eax
|
||||
subl %eax, %esi
|
||||
movl %edi, %ecx
|
||||
rorl %cl, %esi
|
||||
xorl %edi, %esi
|
||||
movl 124(%ebp), %eax
|
||||
subl %eax, %edi
|
||||
movl %esi, %ecx
|
||||
rorl %cl, %edi
|
||||
xorl %esi, %edi
|
||||
movl 120(%ebp), %eax
|
||||
subl %eax, %esi
|
||||
movl %edi, %ecx
|
||||
rorl %cl, %esi
|
||||
xorl %edi, %esi
|
||||
movl 116(%ebp), %eax
|
||||
subl %eax, %edi
|
||||
movl %esi, %ecx
|
||||
rorl %cl, %edi
|
||||
xorl %esi, %edi
|
||||
movl 112(%ebp), %eax
|
||||
subl %eax, %esi
|
||||
movl %edi, %ecx
|
||||
rorl %cl, %esi
|
||||
xorl %edi, %esi
|
||||
movl 108(%ebp), %eax
|
||||
subl %eax, %edi
|
||||
movl %esi, %ecx
|
||||
rorl %cl, %edi
|
||||
xorl %esi, %edi
|
||||
.L001rc5_dec_12:
|
||||
movl 104(%ebp), %eax
|
||||
subl %eax, %esi
|
||||
movl %edi, %ecx
|
||||
rorl %cl, %esi
|
||||
xorl %edi, %esi
|
||||
movl 100(%ebp), %eax
|
||||
subl %eax, %edi
|
||||
movl %esi, %ecx
|
||||
rorl %cl, %edi
|
||||
xorl %esi, %edi
|
||||
movl 96(%ebp), %eax
|
||||
subl %eax, %esi
|
||||
movl %edi, %ecx
|
||||
rorl %cl, %esi
|
||||
xorl %edi, %esi
|
||||
movl 92(%ebp), %eax
|
||||
subl %eax, %edi
|
||||
movl %esi, %ecx
|
||||
rorl %cl, %edi
|
||||
xorl %esi, %edi
|
||||
movl 88(%ebp), %eax
|
||||
subl %eax, %esi
|
||||
movl %edi, %ecx
|
||||
rorl %cl, %esi
|
||||
xorl %edi, %esi
|
||||
movl 84(%ebp), %eax
|
||||
subl %eax, %edi
|
||||
movl %esi, %ecx
|
||||
rorl %cl, %edi
|
||||
xorl %esi, %edi
|
||||
movl 80(%ebp), %eax
|
||||
subl %eax, %esi
|
||||
movl %edi, %ecx
|
||||
rorl %cl, %esi
|
||||
xorl %edi, %esi
|
||||
movl 76(%ebp), %eax
|
||||
subl %eax, %edi
|
||||
movl %esi, %ecx
|
||||
rorl %cl, %edi
|
||||
xorl %esi, %edi
|
||||
.L002rc5_dec_8:
|
||||
movl 72(%ebp), %eax
|
||||
subl %eax, %esi
|
||||
movl %edi, %ecx
|
||||
rorl %cl, %esi
|
||||
xorl %edi, %esi
|
||||
movl 68(%ebp), %eax
|
||||
subl %eax, %edi
|
||||
movl %esi, %ecx
|
||||
rorl %cl, %edi
|
||||
xorl %esi, %edi
|
||||
movl 64(%ebp), %eax
|
||||
subl %eax, %esi
|
||||
movl %edi, %ecx
|
||||
rorl %cl, %esi
|
||||
xorl %edi, %esi
|
||||
movl 60(%ebp), %eax
|
||||
subl %eax, %edi
|
||||
movl %esi, %ecx
|
||||
rorl %cl, %edi
|
||||
xorl %esi, %edi
|
||||
movl 56(%ebp), %eax
|
||||
subl %eax, %esi
|
||||
movl %edi, %ecx
|
||||
rorl %cl, %esi
|
||||
xorl %edi, %esi
|
||||
movl 52(%ebp), %eax
|
||||
subl %eax, %edi
|
||||
movl %esi, %ecx
|
||||
rorl %cl, %edi
|
||||
xorl %esi, %edi
|
||||
movl 48(%ebp), %eax
|
||||
subl %eax, %esi
|
||||
movl %edi, %ecx
|
||||
rorl %cl, %esi
|
||||
xorl %edi, %esi
|
||||
movl 44(%ebp), %eax
|
||||
subl %eax, %edi
|
||||
movl %esi, %ecx
|
||||
rorl %cl, %edi
|
||||
xorl %esi, %edi
|
||||
movl 40(%ebp), %eax
|
||||
subl %eax, %esi
|
||||
movl %edi, %ecx
|
||||
rorl %cl, %esi
|
||||
xorl %edi, %esi
|
||||
movl 36(%ebp), %eax
|
||||
subl %eax, %edi
|
||||
movl %esi, %ecx
|
||||
rorl %cl, %edi
|
||||
xorl %esi, %edi
|
||||
movl 32(%ebp), %eax
|
||||
subl %eax, %esi
|
||||
movl %edi, %ecx
|
||||
rorl %cl, %esi
|
||||
xorl %edi, %esi
|
||||
movl 28(%ebp), %eax
|
||||
subl %eax, %edi
|
||||
movl %esi, %ecx
|
||||
rorl %cl, %edi
|
||||
xorl %esi, %edi
|
||||
movl 24(%ebp), %eax
|
||||
subl %eax, %esi
|
||||
movl %edi, %ecx
|
||||
rorl %cl, %esi
|
||||
xorl %edi, %esi
|
||||
movl 20(%ebp), %eax
|
||||
subl %eax, %edi
|
||||
movl %esi, %ecx
|
||||
rorl %cl, %edi
|
||||
xorl %esi, %edi
|
||||
movl 16(%ebp), %eax
|
||||
subl %eax, %esi
|
||||
movl %edi, %ecx
|
||||
rorl %cl, %esi
|
||||
xorl %edi, %esi
|
||||
movl 12(%ebp), %eax
|
||||
subl %eax, %edi
|
||||
movl %esi, %ecx
|
||||
rorl %cl, %edi
|
||||
xorl %esi, %edi
|
||||
subl 8(%ebp), %esi
|
||||
subl 4(%ebp), %edi
|
||||
.L003rc5_exit:
|
||||
movl %edi, (%edx)
|
||||
movl %esi, 4(%edx)
|
||||
popl %ebx
|
||||
popl %edi
|
||||
popl %esi
|
||||
popl %ebp
|
||||
ret
|
||||
.L_RC5_32_decrypt_end:
|
||||
.size RC5_32_decrypt,.L_RC5_32_decrypt_end-RC5_32_decrypt
|
||||
.ident "desasm.pl"
|
||||
.text
|
||||
.align 16
|
||||
.globl RC5_32_cbc_encrypt
|
||||
.type RC5_32_cbc_encrypt,@function
|
||||
RC5_32_cbc_encrypt:
|
||||
|
||||
pushl %ebp
|
||||
pushl %ebx
|
||||
pushl %esi
|
||||
pushl %edi
|
||||
movl 28(%esp), %ebp
|
||||
# getting iv ptr from parameter 4
|
||||
movl 36(%esp), %ebx
|
||||
movl (%ebx), %esi
|
||||
movl 4(%ebx), %edi
|
||||
pushl %edi
|
||||
pushl %esi
|
||||
pushl %edi
|
||||
pushl %esi
|
||||
movl %esp, %ebx
|
||||
movl 36(%esp), %esi
|
||||
movl 40(%esp), %edi
|
||||
# getting encrypt flag from parameter 5
|
||||
movl 56(%esp), %ecx
|
||||
# get and push parameter 3
|
||||
movl 48(%esp), %eax
|
||||
pushl %eax
|
||||
pushl %ebx
|
||||
cmpl $0, %ecx
|
||||
jz .L004decrypt
|
||||
andl $4294967288, %ebp
|
||||
movl 8(%esp), %eax
|
||||
movl 12(%esp), %ebx
|
||||
jz .L005encrypt_finish
|
||||
.L006encrypt_loop:
|
||||
movl (%esi), %ecx
|
||||
movl 4(%esi), %edx
|
||||
xorl %ecx, %eax
|
||||
xorl %edx, %ebx
|
||||
movl %eax, 8(%esp)
|
||||
movl %ebx, 12(%esp)
|
||||
call RC5_32_encrypt
|
||||
movl 8(%esp), %eax
|
||||
movl 12(%esp), %ebx
|
||||
movl %eax, (%edi)
|
||||
movl %ebx, 4(%edi)
|
||||
addl $8, %esi
|
||||
addl $8, %edi
|
||||
subl $8, %ebp
|
||||
jnz .L006encrypt_loop
|
||||
.L005encrypt_finish:
|
||||
movl 52(%esp), %ebp
|
||||
andl $7, %ebp
|
||||
jz .L007finish
|
||||
xorl %ecx, %ecx
|
||||
xorl %edx, %edx
|
||||
movl .L008cbc_enc_jmp_table(,%ebp,4),%ebp
|
||||
jmp *%ebp
|
||||
.L009ej7:
|
||||
movb 6(%esi), %dh
|
||||
sall $8, %edx
|
||||
.L010ej6:
|
||||
movb 5(%esi), %dh
|
||||
.L011ej5:
|
||||
movb 4(%esi), %dl
|
||||
.L012ej4:
|
||||
movl (%esi), %ecx
|
||||
jmp .L013ejend
|
||||
.L014ej3:
|
||||
movb 2(%esi), %ch
|
||||
sall $8, %ecx
|
||||
.L015ej2:
|
||||
movb 1(%esi), %ch
|
||||
.L016ej1:
|
||||
movb (%esi), %cl
|
||||
.L013ejend:
|
||||
xorl %ecx, %eax
|
||||
xorl %edx, %ebx
|
||||
movl %eax, 8(%esp)
|
||||
movl %ebx, 12(%esp)
|
||||
call RC5_32_encrypt
|
||||
movl 8(%esp), %eax
|
||||
movl 12(%esp), %ebx
|
||||
movl %eax, (%edi)
|
||||
movl %ebx, 4(%edi)
|
||||
jmp .L007finish
|
||||
.align 16
|
||||
.L004decrypt:
|
||||
andl $4294967288, %ebp
|
||||
movl 16(%esp), %eax
|
||||
movl 20(%esp), %ebx
|
||||
jz .L017decrypt_finish
|
||||
.L018decrypt_loop:
|
||||
movl (%esi), %eax
|
||||
movl 4(%esi), %ebx
|
||||
movl %eax, 8(%esp)
|
||||
movl %ebx, 12(%esp)
|
||||
call RC5_32_decrypt
|
||||
movl 8(%esp), %eax
|
||||
movl 12(%esp), %ebx
|
||||
movl 16(%esp), %ecx
|
||||
movl 20(%esp), %edx
|
||||
xorl %eax, %ecx
|
||||
xorl %ebx, %edx
|
||||
movl (%esi), %eax
|
||||
movl 4(%esi), %ebx
|
||||
movl %ecx, (%edi)
|
||||
movl %edx, 4(%edi)
|
||||
movl %eax, 16(%esp)
|
||||
movl %ebx, 20(%esp)
|
||||
addl $8, %esi
|
||||
addl $8, %edi
|
||||
subl $8, %ebp
|
||||
jnz .L018decrypt_loop
|
||||
.L017decrypt_finish:
|
||||
movl 52(%esp), %ebp
|
||||
andl $7, %ebp
|
||||
jz .L007finish
|
||||
movl (%esi), %eax
|
||||
movl 4(%esi), %ebx
|
||||
movl %eax, 8(%esp)
|
||||
movl %ebx, 12(%esp)
|
||||
call RC5_32_decrypt
|
||||
movl 8(%esp), %eax
|
||||
movl 12(%esp), %ebx
|
||||
movl 16(%esp), %ecx
|
||||
movl 20(%esp), %edx
|
||||
xorl %eax, %ecx
|
||||
xorl %ebx, %edx
|
||||
movl (%esi), %eax
|
||||
movl 4(%esi), %ebx
|
||||
.L019dj7:
|
||||
rorl $16, %edx
|
||||
movb %dl, 6(%edi)
|
||||
shrl $16, %edx
|
||||
.L020dj6:
|
||||
movb %dh, 5(%edi)
|
||||
.L021dj5:
|
||||
movb %dl, 4(%edi)
|
||||
.L022dj4:
|
||||
movl %ecx, (%edi)
|
||||
jmp .L023djend
|
||||
.L024dj3:
|
||||
rorl $16, %ecx
|
||||
movb %cl, 2(%edi)
|
||||
sall $16, %ecx
|
||||
.L025dj2:
|
||||
movb %ch, 1(%esi)
|
||||
.L026dj1:
|
||||
movb %cl, (%esi)
|
||||
.L023djend:
|
||||
jmp .L007finish
|
||||
.align 16
|
||||
.L007finish:
|
||||
movl 60(%esp), %ecx
|
||||
addl $24, %esp
|
||||
movl %eax, (%ecx)
|
||||
movl %ebx, 4(%ecx)
|
||||
popl %edi
|
||||
popl %esi
|
||||
popl %ebx
|
||||
popl %ebp
|
||||
ret
|
||||
.align 16
|
||||
.L008cbc_enc_jmp_table:
|
||||
.long 0
|
||||
.long .L016ej1
|
||||
.long .L015ej2
|
||||
.long .L014ej3
|
||||
.long .L012ej4
|
||||
.long .L011ej5
|
||||
.long .L010ej6
|
||||
.long .L009ej7
|
||||
.align 16
|
||||
.L027cbc_dec_jmp_table:
|
||||
.long 0
|
||||
.long .L026dj1
|
||||
.long .L025dj2
|
||||
.long .L024dj3
|
||||
.long .L022dj4
|
||||
.long .L021dj5
|
||||
.long .L020dj6
|
||||
.long .L019dj7
|
||||
.L_RC5_32_cbc_encrypt_end:
|
||||
.size RC5_32_cbc_encrypt,.L_RC5_32_cbc_encrypt_end-RC5_32_cbc_encrypt
|
||||
.ident "desasm.pl"
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -1,157 +0,0 @@
|
||||
.\" $NetBSD: awi.4,v 1.6 2000/03/22 11:24:33 onoe Exp $
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd October 31, 1999
|
||||
.Dt AWI 4
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm awi
|
||||
.Nd "AMD PCnetMobile IEEE 802.11 PCMCIA wireless network driver"
|
||||
.Sh SYNOPSIS
|
||||
.Cd "device awi"
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Nm
|
||||
driver supports various IEEE 802.11 wireless cards
|
||||
which run AMD PCnetMobile firmware based on AMD 79c930 controller
|
||||
with Intersil (formerly Harris) PRISM radio chipset.
|
||||
It provides access to 32kb of memory shared between the controller
|
||||
and the host.
|
||||
All host/device interaction is via this shared memory, which can be
|
||||
accessed either via PCMCIA memory space or I/O space.
|
||||
The
|
||||
.Nm
|
||||
driver encapsulates all IP and ARP traffic as 802.11 frames.
|
||||
.Pp
|
||||
The driver works both in infrastructure mode and in adhoc (independent
|
||||
BSS) mode.
|
||||
.Pp
|
||||
In infrastructure mode, it communicates with an Access Point
|
||||
which serves as a link-layer bridge between an Ethernet and
|
||||
the wireless network. An access point also provides roaming capability
|
||||
which allows wireless node to move between access points.
|
||||
.Pp
|
||||
In adhoc mode, it communicates peer to peer.
|
||||
Though it is more efficient to communicate between wireless nodes,
|
||||
the coverage is limited spatially due to lack of roaming capability.
|
||||
.Pp
|
||||
In addition to these two mode in IEEE 802.11 specification, the
|
||||
.Nm
|
||||
driver also supports a variant of adhoc mode out of spec for DS radio cards,
|
||||
which makes possible to communicate with adhoc mode of
|
||||
.Xr wi 8
|
||||
driver. The NWID doesn't affect in this mode.
|
||||
.Pp
|
||||
For more information on configuring this device, see
|
||||
.Xr ifconfig 8
|
||||
and
|
||||
.Xr ifmedia 4 .
|
||||
.Sh HARDWARE
|
||||
Cards supported by the
|
||||
.Nm
|
||||
driver include:
|
||||
.Pp
|
||||
.Bl -tag -width BayStack_650x -offset indent
|
||||
.It BayStack 650
|
||||
1Mbps Frequency Hopping PCCARD adapter
|
||||
.It BayStack 660
|
||||
2Mbps Direct Sequence PCCARD adapter
|
||||
.It Icom SL-200
|
||||
2Mbps Direct Sequence PCCARD adapter
|
||||
.It Melco WLI-PCM
|
||||
2Mbps Direct Sequence PCCARD adapter
|
||||
.It NEL SSMagic
|
||||
2Mbps Direct Sequence PCCARD adapter
|
||||
.It Netwave AirSurfer Plus
|
||||
1Mbps Frequency Hopping PCCARD adapter
|
||||
.It Netwave AirSurfer Pro
|
||||
2Mbps Direct Sequence PCCARD adapter
|
||||
.El
|
||||
.Pp
|
||||
The original Xircom Netwave AirSurfer is supported by the
|
||||
.Xr cnw 4
|
||||
driver.
|
||||
.Sh MEDIA SELECTION
|
||||
The DS cards support
|
||||
.Em DS1
|
||||
and
|
||||
.Em DS2
|
||||
media types, while the FH cards support
|
||||
.Em FH1
|
||||
media type. For each media type,
|
||||
.Em adhoc
|
||||
mediaopt can be used to indicate the driver to operate in adhoc mode.
|
||||
For DS radio cards,
|
||||
.Em adhoc , Ns Em flag0
|
||||
mediaopt can be used for
|
||||
.Xr wi 4
|
||||
compatible adhoc mode.
|
||||
.Sh DIAGNOSTICS
|
||||
.Bl -diag
|
||||
.It "awi0: unable to allocate memory space; using i/o only"
|
||||
Indicates that the driver was not able to allocate 32kb of PCMCIA bus
|
||||
address space into which to map the device; the driver will use the
|
||||
(slightly slower) i/o-space only access methods to read and write to
|
||||
the shared memory. Since by default,
|
||||
.Nx ,
|
||||
only allocates 16kb of
|
||||
address space per PCMCIA controller, this message is in some sense to
|
||||
be expected and should not be a cause for alarm.
|
||||
See
|
||||
.Xr pcmcia 4
|
||||
for information on how to increase the memory available to the PCMCIA
|
||||
controller.
|
||||
.It "awi0: failed to complete selftest (%s)"
|
||||
The device failed to complete its self test.
|
||||
.It "awi0: synced with no-bssid at channel %d"
|
||||
The device is ready to relay traffic at specified channel.
|
||||
.It "awi0: synced with %s ssid %s at channel %d"
|
||||
The device has successfully synchronized with at least one of the
|
||||
identified stations and is ready to relay traffic.
|
||||
.It "awi0: associated with %s ssid %s channel %d signal %d"
|
||||
The device has successfully synchronized with the identified Access
|
||||
Point and is ready to relay traffic.
|
||||
.It "awi0: authentication failed (reason %d)"
|
||||
.It "awi0: association failed (reason %d)"
|
||||
The access point refuses the association request from the device.
|
||||
.It "awi0: no recent beacons from %s; rescanning"
|
||||
The device has not heard a beacon from its currently associated Access
|
||||
Point recently, and is looking for a new access point.
|
||||
.It "awi0: transmit timeout"
|
||||
The device failed to generate an interrupt to acknowledge a
|
||||
transmitted packet.
|
||||
.It "awi0: failed to lock interrupt"
|
||||
The system was unable to obtain the lock to access shared memory.
|
||||
.It "awi0: command %d failed %x"
|
||||
The device failed to complete the request from the system.
|
||||
.El
|
||||
.Sh BUGS
|
||||
Doesn't create IBSS itself.
|
||||
.Sh SEE ALSO
|
||||
.Xr arp 4 ,
|
||||
.Xr cnw 4 ,
|
||||
.Xr ifmedia 4 ,
|
||||
.Xr netintro 4 ,
|
||||
.Xr pcmcia 4 ,
|
||||
.Xr wi 4 ,
|
||||
.Xr ifconfig 8
|
||||
.Rs
|
||||
.%T Am79C930 PCnet Mobile Single-Chip Wireless LAN Media Access Controller
|
||||
.%O http://www.amd.com
|
||||
.Re
|
||||
.Sh HISTORY
|
||||
The
|
||||
.Nm
|
||||
device driver first appeared in
|
||||
.Nx 1.5 .
|
||||
.Sh AUTHORS
|
||||
.An -nosplit
|
||||
The initial version of the
|
||||
.Nm
|
||||
driver was written by
|
||||
.An Bill Sommerfeld Aq [email protected] .
|
||||
Then the
|
||||
.Nm
|
||||
driver module completely rewritten to support cards with DS phy and
|
||||
to support adhoc mode by
|
||||
.An Atsushi Onoe Aq [email protected] .
|
||||
@@ -1,80 +0,0 @@
|
||||
.\" Copyright (c) 1983, 1991, 1993
|
||||
.\" The Regents of the University of California. All rights reserved.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, are permitted provided that the following conditions
|
||||
.\" are met:
|
||||
.\" 1. Redistributions of source code must retain the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer.
|
||||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer in the
|
||||
.\" documentation and/or other materials provided with the distribution.
|
||||
.\" 3. All advertising materials mentioning features or use of this software
|
||||
.\" must display the following acknowledgement:
|
||||
.\" This product includes software developed by the University of
|
||||
.\" California, Berkeley and its contributors.
|
||||
.\" 4. Neither the name of the University nor the names of its contributors
|
||||
.\" may be used to endorse or promote products derived from this software
|
||||
.\" without specific prior written permission.
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" From: @(#)lo.4 8.1 (Berkeley) 6/5/93
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd May 25, 2002
|
||||
.Dt DISC 4
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm disc
|
||||
.Nd software discard network interface
|
||||
.Sh SYNOPSIS
|
||||
.Cd "device disc"
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Nm
|
||||
interface is a software discard mechanism which may be
|
||||
used for performance analysis and/or software testing.
|
||||
As with other network interfaces, the discard interface must have
|
||||
network addresses assigned for each address family with which it is to be used.
|
||||
These addresses
|
||||
may be set or changed with the
|
||||
.Dv SIOCSIFADDR
|
||||
.Xr ioctl 2 .
|
||||
.Pp
|
||||
Each
|
||||
.Nm
|
||||
interface is created at runtime using interface cloning.
|
||||
This is
|
||||
most easily done with the
|
||||
.Xr ifconfig 8
|
||||
.Cm create
|
||||
command or using the
|
||||
.Va cloned_interfaces
|
||||
variable in
|
||||
.Xr rc.conf 5 .
|
||||
.Sh SEE ALSO
|
||||
.Xr inet 4 ,
|
||||
.Xr intro 4
|
||||
.\" .Xr ns 4
|
||||
.Sh HISTORY
|
||||
The
|
||||
.Nm
|
||||
device appears to have been derived from the
|
||||
.Xr lo 4
|
||||
device around the time of
|
||||
.Bx 4.4 .
|
||||
This manpage was adapted from
|
||||
.Xr lo 4
|
||||
and first appeared in
|
||||
.Fx 5.0 .
|
||||
@@ -1,89 +0,0 @@
|
||||
.\" Copyright (c) 1998-2002 Katsushi Kobayashi and Hidetoshi Shimokawa
|
||||
.\" All rights reserved.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, are permitted provided that the following conditions
|
||||
.\" are met:
|
||||
.\" 1. Redistributions of source code must retain the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer.
|
||||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer in the
|
||||
.\" documentation and/or other materials provided with the distribution.
|
||||
.\" 3. All advertising materials mentioning features or use of this software
|
||||
.\" must display the acknowledgement as bellow:
|
||||
.\"
|
||||
.\" This product includes software developed by K. Kobayashi and H. Shimokawa
|
||||
.\"
|
||||
.\" 4. The name of the author may not be used to endorse or promote products
|
||||
.\" derived from this software without specific prior written permission.
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
.\" DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
|
||||
.\" INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
.\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
.\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
.\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
.\" POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd May 23, 2002
|
||||
.Dt FIREWIRE 4
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm firewire
|
||||
.Nd IEEE1394 High-performance Serial Bus
|
||||
.Sh SYNOPSIS
|
||||
.Cd "device firewire"
|
||||
.Pp
|
||||
.In dev/firewire/firewire.h
|
||||
.Sh DESCRIPTION
|
||||
.Fx
|
||||
provides machine-independent bus support and row drivers for
|
||||
.Tn firewire
|
||||
interfaces.
|
||||
.Pp
|
||||
The
|
||||
.Nm
|
||||
driver consists of two layers: the controller and the
|
||||
bus layer.
|
||||
The controller attaches to a physical bus
|
||||
(like
|
||||
.Xr pci 4 ) .
|
||||
The
|
||||
.Tn firewire
|
||||
bus attaches to the controller. And the additional driver can be
|
||||
attached to the bus.
|
||||
.Pp
|
||||
Up to 63 devices, including the host itself, can be attached to
|
||||
a firewire bus. The root node is dynamically assigned with PHY
|
||||
device function. Also, the other firewire bus specific parameters
|
||||
e.g. node id, cycle master, isochronous resource manager and bus
|
||||
manager, are dynamically assigned, after bus rest is initiated.
|
||||
On firewire bus, every device is identified with EUI 64 address.
|
||||
|
||||
.Pp
|
||||
.El
|
||||
.Sh SEE ALSO
|
||||
.Xr fwohci 4 ,
|
||||
.Xr pci 4 ,
|
||||
.Xr sbp 4 ,
|
||||
.Sh HISTORY
|
||||
The
|
||||
.Nm
|
||||
driver first appeared in
|
||||
.Fx 5.0 .
|
||||
.Sh AUTHORS
|
||||
The
|
||||
.Nm
|
||||
driver was written by
|
||||
.An Katsushi Kobayashi
|
||||
and
|
||||
.An Hidetoshi Shimokawa
|
||||
for the
|
||||
.Nx
|
||||
project.
|
||||
@@ -1,73 +0,0 @@
|
||||
.\" Copyright (c) 1998,1999,2000 Katsushi Kobayashi and Hidetoshi Shimokawa
|
||||
.\" All rights reserved.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, are permitted provided that the following conditions
|
||||
.\" are met:
|
||||
.\" 1. Redistributions of source code must retain the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer.
|
||||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer in the
|
||||
.\" documentation and/or other materials provided with the distribution.
|
||||
.\" 3. All advertising materials mentioning features or use of this software
|
||||
.\" must display the acknowledgement as bellow:
|
||||
.\"
|
||||
.\" This product includes software developed by K. Kobayashi and H. Shimokawa
|
||||
.\"
|
||||
.\" 4. The name of the author may not be used to endorse or promote products
|
||||
.\" derived from this software without specific prior written permission.
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
.\" DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
|
||||
.\" INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
.\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
.\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
.\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
.\" POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.\"
|
||||
.Dd April 10, 2000
|
||||
.Dt FWOHCI 4
|
||||
.Os FreeBSD
|
||||
.Sh NAME
|
||||
.Nm fwohci
|
||||
.Nd
|
||||
OHCI firewire chipset device driver
|
||||
.Sh SYNOPSIS
|
||||
.Cd "device fwohci"
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Nm
|
||||
driver provides support for PCI firewire interface cards.
|
||||
The driver supports following OHCI chipsets.
|
||||
.Pp
|
||||
.Bl -tag -width xxxxxxxxxxxxxxxxxxxx
|
||||
.It uPD72861
|
||||
.It TI TSB12LV22,LV23,26 and TSB43AA22
|
||||
.It Sony CX3022
|
||||
.It VIA VT6306
|
||||
.It Ricoh R5C552
|
||||
.Pp
|
||||
.El
|
||||
.Sh SEE ALSO
|
||||
.Xr firewire 8 ,
|
||||
.Xr sbp 4
|
||||
.Sh HISTORY
|
||||
The
|
||||
.Nm
|
||||
device driver first appeared in
|
||||
.Fx 5.0 .
|
||||
.Sh AUTHORS
|
||||
The
|
||||
.Nm
|
||||
device driver was written by
|
||||
.An Katsushi Kobayashi .
|
||||
.Pp
|
||||
This manual page was written by
|
||||
.An Katsushi Kobayashi .
|
||||
@@ -1,279 +0,0 @@
|
||||
.\" $NetBSD: gre.4,v 1.28 2002/06/10 02:49:35 itojun Exp $
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.\" Copyright 1998 (c) The NetBSD Foundation, Inc.
|
||||
.\" All rights reserved.
|
||||
.\"
|
||||
.\" This code is derived from software contributed to The NetBSD Foundation
|
||||
.\" by Heiko W.Rupp <[email protected]>
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, are permitted provided that the following conditions
|
||||
.\" are met:
|
||||
.\" 1. Redistributions of source code must retain the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer.
|
||||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer in the
|
||||
.\" documentation and/or other materials provided with the distribution.
|
||||
.\" 3. All advertising materials mentioning features or use of this software
|
||||
.\" must display the following acknowledgement:
|
||||
.\" This product includes software developed by the NetBSD
|
||||
.\" Foundation, Inc. and its contributors.
|
||||
.\" 4. Neither the name of the The NetBSD Foundation nor the names of its
|
||||
.\" contributors may be used to endorse or promote products derived
|
||||
.\" from this software without specific prior written permission.
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
||||
.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
||||
.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
.\" POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.Dd June 9, 2002
|
||||
.Dt GRE 4
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm gre
|
||||
.Nd encapsulating network device
|
||||
.Sh SYNOPSIS
|
||||
.Cd pseudo-device gre
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Nm gre
|
||||
network interface pseudo device encapsulates datagrams
|
||||
into IP. These encapsulated datagrams are routed to a destination host,
|
||||
where they are decapsulated and further routed to their final destination.
|
||||
The
|
||||
.Dq tunnel
|
||||
appears to the inner datagrams as one hop.
|
||||
.Pp
|
||||
.Nm
|
||||
interfaces are dynamically created and destroyed with the
|
||||
.Xr ifconfig 8
|
||||
.Cm create
|
||||
and
|
||||
.Cm destroy
|
||||
subcommands.
|
||||
.Pp
|
||||
This driver currently supports the following modes of operation:
|
||||
.Bl -tag -width abc
|
||||
.It GRE encapsulation (IP protocol number 47)
|
||||
Encapsulated datagrams are
|
||||
prepended an outer datagram and a GRE header. The GRE header specifies
|
||||
the type of the encapsulated datagram and thus allows for tunneling other
|
||||
protocols than IP like e.g. AppleTalk. GRE mode is also the default tunnel
|
||||
mode on Cisco routers. This is also the default mode of operation of the
|
||||
.Sy gre Ns Ar X
|
||||
interfaces.
|
||||
.It MOBILE encapsulation (IP protocol number 55)
|
||||
Datagrams are
|
||||
encapsulated into IP, but with a shorter encapsulation. The original
|
||||
IP header is modified and the modifications are inserted between the
|
||||
so modified header and the original payload. Like
|
||||
.Xr gif 4 ,
|
||||
only for IP in IP encapsulation.
|
||||
.El
|
||||
.Pp
|
||||
The
|
||||
.Sy gre Ns Ar X
|
||||
interfaces support a number of
|
||||
.Xr ioctl 2 Ns s ,
|
||||
such as:
|
||||
.Bl -tag -width aaa
|
||||
.It GRESADDRS :
|
||||
Set the IP address of the local tunnel end. This is the source address
|
||||
set by or displayed by ifconfig for the
|
||||
.Sy gre Ns Ar X
|
||||
interface.
|
||||
.It GRESADDRD :
|
||||
Set the IP address of the remote tunnel end. This is the destination address
|
||||
set by or displayed by ifconfig for the
|
||||
.Sy gre Ns Ar X
|
||||
interface.
|
||||
.It GREGADDRS :
|
||||
Query the IP address that is set for the local tunnel end. This is the
|
||||
address the encapsulation header carries as local address (i.e. the real
|
||||
address of the tunnel start point.)
|
||||
.It GREGADDRD :
|
||||
Query the IP address that is set for the remote tunnel end. This is the
|
||||
address the encapsulated packets are sent to (i.e. the real address of
|
||||
the remote tunnel endpoint.)
|
||||
.It GRESPROTO :
|
||||
Set the operation mode to the specified IP protocol value. The
|
||||
protocol is passed to the interface in (struct ifreq)-\*[Gt]ifr_flags.
|
||||
The operation mode can also be given as
|
||||
.Bl -tag -width link0xxx
|
||||
.It link0
|
||||
IPPROTO_GRE
|
||||
.It -link0
|
||||
IPPROTO_MOBILE
|
||||
.El
|
||||
.Pp
|
||||
to
|
||||
.Xr ifconfig 8 .
|
||||
.Pp
|
||||
The link1 flag is not used to choose encapsulation, but to modify the
|
||||
internal route search for the remote tunnel endpoint, see the
|
||||
.Sx BUGS
|
||||
section below.
|
||||
.It GREGPROTO :
|
||||
Query operation mode.
|
||||
.El
|
||||
.Pp
|
||||
Note that the IP addresses of the tunnel endpoints may be the same as the
|
||||
ones defined with
|
||||
.Xr ifconfig 8
|
||||
for the interface (as if IP is encapsulated), but need not be, as e.g. when
|
||||
encapsulating AppleTalk.
|
||||
.Sh EXAMPLES
|
||||
Configuration example:
|
||||
.Bd -literal
|
||||
Host X-- Host A ----------------tunnel---------- cisco D------Host E
|
||||
\\ |
|
||||
\\ /
|
||||
+------Host B----------Host C----------+
|
||||
.Ed
|
||||
On host A
|
||||
.Ns ( Nx ) :
|
||||
.Bd -literal
|
||||
# route add default B
|
||||
# ifconfig greN create
|
||||
# ifconfig greN A D netmask 0xffffffff linkX up
|
||||
# ifconfig greN tunnel A D
|
||||
# route add E D
|
||||
.Ed
|
||||
On Host D (Cisco):
|
||||
.Bd -literal
|
||||
Interface TunnelX
|
||||
ip unnumbered D ! e.g. address from Ethernet interface
|
||||
tunnel source D ! e.g. address from Ethernet interface
|
||||
tunnel destination A
|
||||
ip route C \*[Lt]some interface and mask\*[Gt]
|
||||
ip route A mask C
|
||||
ip route X mask tunnelX
|
||||
.Ed
|
||||
OR
|
||||
On Host D
|
||||
.Ns ( Nx ) :
|
||||
.Bd -literal
|
||||
# route add default C
|
||||
# ifconfig greN create
|
||||
# ifconfig greN D A
|
||||
# ifconfig tunnel greN D A
|
||||
.Ed
|
||||
.Pp
|
||||
If all goes well, you should see packets flowing ;-)
|
||||
.Pp
|
||||
If you want to reach Host A over the tunnel (from Host D (Cisco)), then
|
||||
you have to have an alias on Host A for e.g. the Ethernet interface like:
|
||||
.Bd -literal
|
||||
ifconfig \*[Lt]etherif\*[Gt] alias Y
|
||||
.Ed
|
||||
and on the cisco
|
||||
.Bd -literal
|
||||
ip route Y mask tunnelX
|
||||
.Ed
|
||||
.Pp
|
||||
A similar setup can be used to create a link between two private networks
|
||||
(for example in the 192.168 subnet) over the Internet:
|
||||
.Bd -literal
|
||||
192.168.1.* --- Router A -------tunnel-------- Router B --- 192.168.2.*
|
||||
\\ /
|
||||
\\ /
|
||||
+----- the Internet ------+
|
||||
.Ed
|
||||
Assuming router A has the (external) IP address A and the internal address
|
||||
192.168.1.1, while router B has external address B and internal address
|
||||
192.168.2.1, the following commands will configure the tunnel:
|
||||
.Pp
|
||||
On router A:
|
||||
.Bd -literal
|
||||
# ifconfig greN create
|
||||
# ifconfig greN 192.168.1.1 192.168.2.1 link1
|
||||
# ifconfig greN tunnel A B
|
||||
# route add -net 192.168.2 -netmask 255.255.255.0 192.168.2.1
|
||||
.Ed
|
||||
.Pp
|
||||
On router B:
|
||||
.Bd -literal
|
||||
# ifconfig greN create
|
||||
# ifconfig greN 192.168.2.1 192.168.1.1 link1
|
||||
# ifconfig greN tunnel B A
|
||||
# route add -net 192.168.1 -netmask 255.255.255.0 192.168.1.1
|
||||
.Ed
|
||||
.Pp
|
||||
Note that this is a safe situation where the link1 flag (as discussed in the
|
||||
.Sx BUGS
|
||||
section below) may (and probably should) be set.
|
||||
.Sh NOTES
|
||||
The MTU of
|
||||
.Sy gre Ns Ar X
|
||||
interfaces is set to 1476 by default to match the value used by Cisco routers.
|
||||
This may not be an optimal value, depending on the link between the two tunnel
|
||||
endpoints. It can be adjusted via
|
||||
.Xr ifconfig 8 .
|
||||
.Pp
|
||||
For correct operation, the
|
||||
.Nm
|
||||
device needs a route to the destination that is less specific than the
|
||||
one over the tunnel.
|
||||
(Basically, there needs to be a route to the decapsulating host that
|
||||
does not run over the tunnel, as this would be a loop.)
|
||||
If the addresses are ambiguous, doing the
|
||||
.Xr ifconfig 8
|
||||
.Li tunnel
|
||||
step before the
|
||||
.Xr ifconfig 8
|
||||
call to set the
|
||||
.Sy gre Ns Ar X
|
||||
IP addresses will help to find a route outside the tunnel.
|
||||
.Pp
|
||||
In order to tell
|
||||
.Xr ifconfig 8
|
||||
to actually mark the interface as up, the keyword
|
||||
.Dq up
|
||||
must be given last on its command line.
|
||||
.Pp
|
||||
The kernel must be set to forward datagrams by either option
|
||||
.Em GATEWAY
|
||||
in the kernel config file or by issuing the appropriate option to
|
||||
.Xr sysctl 8 .
|
||||
.Sh SEE ALSO
|
||||
.Xr atalk 4 ,
|
||||
.Xr gif 4 ,
|
||||
.Xr inet 4 ,
|
||||
.Xr ip 4 ,
|
||||
.Xr netintro 4 ,
|
||||
.Xr options 4 ,
|
||||
.Xr protocols 5 ,
|
||||
.Xr ifconfig 8 ,
|
||||
.Xr sysctl 8
|
||||
.Pp
|
||||
A description of GRE encapsulation can be found in RFC 1701 and RFC 1702.
|
||||
.Pp
|
||||
A description of MOBILE encapsulation can be found in RFC 2004.
|
||||
.Sh AUTHORS
|
||||
.An Heiko W.Rupp Aq [email protected]
|
||||
.Sh BUGS
|
||||
The compute_route() code in if_gre.c toggles the last bit of the
|
||||
IP-address to provoke the search for a less specific route than the
|
||||
one directly over the tunnel to prevent loops. This is possibly not
|
||||
the best solution.
|
||||
.Pp
|
||||
To avoid the address munging described above, turn on the link1 flag
|
||||
on the
|
||||
.Xr ifconfig 8
|
||||
command line.
|
||||
This implies that the GRE packet destination and the ifconfig remote host
|
||||
are not the same IP addresses, and that the GRE destination does not route
|
||||
over the
|
||||
.Sy gre Ns Ar X
|
||||
interface itself.
|
||||
.Pp
|
||||
The GRE RFCs are not yet fully implemented (no GRE options).
|
||||
@@ -1,86 +0,0 @@
|
||||
.\" Copyright (c) 1998-2002 Katsushi Kobayashi and Hidetoshi Shimokawa
|
||||
.\" All rights reserved.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, are permitted provided that the following conditions
|
||||
.\" are met:
|
||||
.\" 1. Redistributions of source code must retain the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer.
|
||||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer in the
|
||||
.\" documentation and/or other materials provided with the distribution.
|
||||
.\" 3. All advertising materials mentioning features or use of this software
|
||||
.\" must display the acknowledgement as bellow:
|
||||
.\"
|
||||
.\" This product includes software developed by K. Kobayashi
|
||||
.\"
|
||||
.\" 4. The name of the author may not be used to endorse or promote products
|
||||
.\" derived from this software without specific prior written permission.
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
.\" DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
|
||||
.\" INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
.\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
.\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
.\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
.\" POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.\"
|
||||
.Dd May 20, 2002
|
||||
.Dt SBP 4
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm sbp
|
||||
.Nd Serial Bus Protocol 2 (SBP-2) Mass Storage Devices driver
|
||||
.Sh SYNOPSIS
|
||||
.Cd "device sbp"
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Nm
|
||||
driver provides support for SBP-2 devices that attach to the firewire (IEEE1394)
|
||||
port.
|
||||
Verified are
|
||||
.Pp
|
||||
.Bl -tag -compact -width xxxxxx
|
||||
.It Apple Macintosh G4 (target mode)
|
||||
.It Apple iPod
|
||||
.El
|
||||
.Pp
|
||||
.Nm firewire
|
||||
and
|
||||
.Nm fwohci
|
||||
must be configured in the kernel as well.
|
||||
Last but not least, support for
|
||||
SCSI drives,
|
||||
.Nm da
|
||||
.Sh EXAMPLES
|
||||
.Dl device sbp
|
||||
.Dl device scbus
|
||||
.Dl device da
|
||||
.Dl device pass
|
||||
.Pp
|
||||
Add the
|
||||
.Nm
|
||||
driver to the kernel.
|
||||
.Pp
|
||||
.Dl camcontrol rescan 0
|
||||
.Pp
|
||||
Rescan a SCSI drive that was added after boot.
|
||||
.\".Sh HISTORY
|
||||
.Sh AUTHORS
|
||||
.An -nosplit
|
||||
The
|
||||
.Nm
|
||||
driver was written by
|
||||
.An Katsushi Kobayashi
|
||||
and
|
||||
.An Hidetoshi Shimokawa .
|
||||
.Pp
|
||||
This manual page was written by
|
||||
.An Katsushi Kobayashi .
|
||||
@@ -1,53 +0,0 @@
|
||||
.\"
|
||||
.\" Copyright (c) 2000 Warner Losh
|
||||
.\" All rights reserved.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, are permitted provided that the following conditions
|
||||
.\" are met:
|
||||
.\" 1. Redistributions of source code must retain the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer.
|
||||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer in the
|
||||
.\" documentation and/or other materials provided with the distribution.
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd November 7, 2000
|
||||
.Dt SN 4
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm sn
|
||||
.Nd Ethernet driver for SMC91Cxx based cards
|
||||
.Sh SYNOPSIS
|
||||
.Cd "device sn"
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Nm
|
||||
device driver supports SMC9xxx based ISA and PCMCIA cards.
|
||||
.Sh SEE ALSO
|
||||
.Xr ed 4 ,
|
||||
.Xr el 4 ,
|
||||
.Xr ep 4 ,
|
||||
.Xr ie 4 ,
|
||||
.Xr intro 4 ,
|
||||
.Xr le 4 ,
|
||||
.Xr ng_ether 4 ,
|
||||
.Xr vx 4 ,
|
||||
.Xr ifconfig 8
|
||||
.Sh HISTORY
|
||||
The
|
||||
.Nm
|
||||
device driver appeared in
|
||||
.Fx 4.0 .
|
||||
@@ -1,80 +0,0 @@
|
||||
.\" $NetBSD: uftdi.4,v 1.5 2002/02/07 03:15:08 ross Exp $
|
||||
.\"
|
||||
.\" Copyright (c) 2000 The NetBSD Foundation, Inc.
|
||||
.\" All rights reserved.
|
||||
.\"
|
||||
.\" This code is derived from software contributed to The NetBSD Foundation
|
||||
.\" by Lennart Augustsson.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, are permitted provided that the following conditions
|
||||
.\" are met:
|
||||
.\" 1. Redistributions of source code must retain the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer.
|
||||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer in the
|
||||
.\" documentation and/or other materials provided with the distribution.
|
||||
.\" 3. All advertising materials mentioning features or use of this software
|
||||
.\" must display the following acknowledgement:
|
||||
.\" This product includes software developed by the NetBSD
|
||||
.\" Foundation, Inc. and its contributors.
|
||||
.\" 4. Neither the name of The NetBSD Foundation nor the names of its
|
||||
.\" contributors may be used to endorse or promote products derived
|
||||
.\" from this software without specific prior written permission.
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
||||
.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
||||
.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
.\" POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd April 13, 2000
|
||||
.Dt UFTDI 4
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm uftdi
|
||||
.Nd USB support for serial adapters based on the FT8U100AX and FT8U232AM
|
||||
.Sh SYNOPSIS
|
||||
.Cd "uftdi* at uhub?"
|
||||
.Cd "ucom* at uftdi?"
|
||||
.Sh HARDWARE
|
||||
The
|
||||
.Nm
|
||||
driver supports the following adapters:
|
||||
.Pp
|
||||
.Bl -item -offset indent -compact
|
||||
.It
|
||||
Inland UAS111
|
||||
.It
|
||||
QVS USC-1000
|
||||
.It
|
||||
HP USB-Serial adapter shipped with some HP laptops
|
||||
.El
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Nm
|
||||
driver provides support for various serial adapters based on the FTDI
|
||||
FT8U100AX and FT8U232AM chips.
|
||||
.Pp
|
||||
The device is accessed through the
|
||||
.Xr ucom 4
|
||||
driver which makes it behave like a
|
||||
.Xr tty 4 .
|
||||
.Sh SEE ALSO
|
||||
.Xr tty 4 ,
|
||||
.Xr ucom 4 ,
|
||||
.Xr usb 4
|
||||
.Sh HISTORY
|
||||
The
|
||||
.Nm
|
||||
driver
|
||||
appeared in
|
||||
.Nx 1.5 .
|
||||
@@ -135,14 +135,14 @@ FreeBSD 4.0 | | | | | NetBSD 1.4.2 | |
|
||||
*---FreeBSD 4.1 | | | | | | |
|
||||
| | | | (?) | | | |
|
||||
| FreeBSD 4.1.1 | | / | | | |
|
||||
| | | | / | v | |
|
||||
| | | | / | | | |
|
||||
| FreeBSD 4.2 Darwin/ | NetBSD 1.4.3 | |
|
||||
| | Mac OS X | | OpenBSD 2.8 BSD/OS 4.2
|
||||
| | | | v | |
|
||||
| | | | | |
|
||||
| | 10.0 NetBSD 1.5 | |
|
||||
| FreeBSD 4.3 | | | | v
|
||||
| | | | v OpenBSD 2.9
|
||||
| | | | | OpenBSD 2.9
|
||||
| | | | NetBSD 1.5.1 |
|
||||
| | | | | |
|
||||
| FreeBSD 4.4 | | NetBSD 1.5.2 |
|
||||
@@ -152,13 +152,13 @@ FreeBSD 4.0 | | | | | NetBSD 1.4.2 | |
|
||||
| | | | | |
|
||||
| FreeBSD 4.6 | | | OpenBSD 3.1
|
||||
| | | | NetBSD 1.5.3 |
|
||||
| FreeBSD 4.7 | | | |
|
||||
| | | | | |
|
||||
| v | | v |
|
||||
| | | |
|
||||
FreeBSD 5.0-current | NetBSD -current OpenBSD -current
|
||||
| | | |
|
||||
v | v v
|
||||
Mac OS X
|
||||
v Mac OS X v v
|
||||
10.1
|
||||
|
||||
Time
|
||||
@@ -357,7 +357,7 @@ FreeBSD 4.5 2002-01-29 [FBD]
|
||||
OpenBSD 3.1 2002-05-19 [OBD]
|
||||
FreeBSD 4.6 2002-06-15 [FBD]
|
||||
NetBSD 1.5.3 2002-07-22 [NBD] (patch release)
|
||||
|
||||
FreeBSD 4.7 2002-10-08 [FBD]
|
||||
|
||||
Bibliography
|
||||
------------------------
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@
|
||||
|
||||
TYPE="FreeBSD"
|
||||
REVISION="4.7"
|
||||
BRANCH="RC"
|
||||
BRANCH="RELEASE"
|
||||
RELEASE="${REVISION}-${BRANCH}"
|
||||
VERSION="${TYPE} ${RELEASE}"
|
||||
|
||||
|
||||
@@ -1,84 +0,0 @@
|
||||
/*-
|
||||
* Copyright (c) 2002 Scott Long
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Linux ioctl handler for the aac device driver
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/conf.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/file.h>
|
||||
#include <sys/proc.h>
|
||||
#include <machine/../linux/linux.h>
|
||||
#include <machine/../linux/linux_proto.h>
|
||||
#include <compat/linux/linux_ioctl.h>
|
||||
|
||||
/* There are multiple ioctl number ranges that need to be handled */
|
||||
#define AAC_LINUX_IOCTL_MIN 0x0000
|
||||
#define AAC_LINUX_IOCTL_MAX 0x21ff
|
||||
|
||||
static linux_ioctl_function_t aac_linux_ioctl;
|
||||
static struct linux_ioctl_handler aac_linux_handler = {aac_linux_ioctl,
|
||||
AAC_LINUX_IOCTL_MIN,
|
||||
AAC_LINUX_IOCTL_MAX};
|
||||
|
||||
SYSINIT (aac_linux_register, SI_SUB_KLD, SI_ORDER_MIDDLE,
|
||||
linux_ioctl_register_handler, &aac_linux_handler);
|
||||
SYSUNINIT(aac_linux_unregister, SI_SUB_KLD, SI_ORDER_MIDDLE,
|
||||
linux_ioctl_unregister_handler, &aac_linux_handler);
|
||||
|
||||
static int
|
||||
aac_linux_modevent(module_t mod, int type, void *data)
|
||||
{
|
||||
/* Do we care about any specific load/unload actions? */
|
||||
return (0);
|
||||
}
|
||||
|
||||
DEV_MODULE(aac_linux, aac_linux_modevent, NULL);
|
||||
MODULE_DEPEND(aac_linux, linux, 1, 1, 1);
|
||||
|
||||
static int
|
||||
aac_linux_ioctl(struct thread *td, struct linux_ioctl_args *args)
|
||||
{
|
||||
struct file *fp;
|
||||
u_long cmd;
|
||||
int error;
|
||||
|
||||
if ((error = fget(td, args->fd, &fp)) != 0)
|
||||
return (error);
|
||||
cmd = args->cmd;
|
||||
|
||||
/*
|
||||
* Pass the ioctl off to our standard handler.
|
||||
*/
|
||||
error = (fo_ioctl(fp, cmd, (caddr_t)args->arg, td->td_ucred, td));
|
||||
fdrop(fp, td);
|
||||
return (error);
|
||||
}
|
||||
@@ -1,106 +0,0 @@
|
||||
/*-
|
||||
* Copyright (c) 2001 Mitsuru IWASAKI
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
#include "acpi.h"
|
||||
#include <machine/cpufunc.h>
|
||||
#include <dev/acpica/acpica_support.h>
|
||||
|
||||
ACPI_MODULE_NAME("SUPPORT")
|
||||
|
||||
/*
|
||||
* Implement support code temporary here until officially merged into
|
||||
* Intel ACPI CA release.
|
||||
*/
|
||||
|
||||
#undef _COMPONENT
|
||||
#define _COMPONENT ACPI_HARDWARE
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiEnterSleepStateS4Bios
|
||||
*
|
||||
* PARAMETERS: None
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Enter a system sleep state S4BIOS
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiEnterSleepStateS4Bios (
|
||||
void)
|
||||
{
|
||||
ACPI_OBJECT_LIST ArgList;
|
||||
ACPI_OBJECT Arg;
|
||||
UINT32 Value;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE ("AcpiEnterSleepStateS4Bios");
|
||||
|
||||
/* run the _PTS and _GTS methods */
|
||||
|
||||
ACPI_MEMSET(&ArgList, 0, sizeof(ArgList));
|
||||
ArgList.Count = 1;
|
||||
ArgList.Pointer = &Arg;
|
||||
|
||||
ACPI_MEMSET(&Arg, 0, sizeof(Arg));
|
||||
Arg.Type = ACPI_TYPE_INTEGER;
|
||||
Arg.Integer.Value = ACPI_STATE_S4;
|
||||
|
||||
AcpiEvaluateObject (NULL, "\\_PTS", &ArgList, NULL);
|
||||
AcpiEvaluateObject (NULL, "\\_GTS", &ArgList, NULL);
|
||||
|
||||
/* clear wake status */
|
||||
|
||||
AcpiSetRegister (ACPI_BITREG_WAKE_STATUS, 1, ACPI_MTX_LOCK);
|
||||
|
||||
ACPI_DISABLE_IRQS ();
|
||||
|
||||
AcpiHwDisableNonWakeupGpes();
|
||||
|
||||
/* flush caches */
|
||||
|
||||
ACPI_FLUSH_CPU_CACHE ();
|
||||
|
||||
/* write the value to command port and wait until we enter sleep state */
|
||||
do
|
||||
{
|
||||
AcpiOsStall(1000000);
|
||||
AcpiOsWritePort (AcpiGbl_FADT->SmiCmd, AcpiGbl_FADT->S4BiosReq, 8);
|
||||
AcpiGetRegister (ACPI_BITREG_WAKE_STATUS, &Value, ACPI_MTX_LOCK);
|
||||
}
|
||||
while (!Value);
|
||||
|
||||
AcpiHwEnableNonWakeupGpes();
|
||||
|
||||
ACPI_ENABLE_IRQS ();
|
||||
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
/*-
|
||||
* Copyright (c) 2001 Mitsuru IWASAKI
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
#include "acpi.h"
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiEnterSleepStateS4Bios (
|
||||
void);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiSetDsdtTablePtr(
|
||||
ACPI_TABLE_HEADER *Ptr);
|
||||
|
||||
-11647
File diff suppressed because it is too large.
Load diff
@@ -1,44 +0,0 @@
|
||||
/* tdfx.h -- 3dfx DRM template customization -*- linux-c -*-
|
||||
* Created: Wed Feb 14 12:32:32 2001 by gareth@valinux.com
|
||||
*
|
||||
* Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
* OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* Authors:
|
||||
* Gareth Hughes <gareth@valinux.com>
|
||||
*
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
#ifndef __TDFX_H__
|
||||
#define __TDFX_H__
|
||||
|
||||
/* This remains constant for all DRM template files.
|
||||
*/
|
||||
#define DRM(x) tdfx_##x
|
||||
|
||||
/* General customization:
|
||||
*/
|
||||
#define __HAVE_MTRR 1
|
||||
#define __HAVE_CTX_BITMAP 1
|
||||
|
||||
#endif
|
||||
@@ -1,155 +0,0 @@
|
||||
$FreeBSD$
|
||||
|
||||
IEEE 1394 support for FreeBSD-5.X and 4.X.
|
||||
|
||||
1. Introduction
|
||||
|
||||
This tarball contains IEEE1394(FireWire) driver which is first
|
||||
written by Katsushi Kobayashi[1] <[email protected]> and
|
||||
modified by Hidetoshi Shimokawa <[email protected]>.
|
||||
Please note this driver is still under development.
|
||||
You can find latest snapshots under:
|
||||
http://people.freebsd.org/~simokawa/
|
||||
named firewire-2002XXXX.tar.gz
|
||||
|
||||
The driver consists of 6 parts:
|
||||
|
||||
- fwohci.c/fwohci_pci.c
|
||||
OHCI[2] driver
|
||||
- IEEE1394 link/phy chip control
|
||||
- firewire.c
|
||||
Chip independent driver
|
||||
- CSR
|
||||
- Transaction
|
||||
- Character devices for userland
|
||||
- fwmem.c
|
||||
/dev/fwmem0: physical memory of a remote node.
|
||||
- sbp.c
|
||||
SBP-II[3] (a.k.a. SCSI over FireWire) driver
|
||||
|
||||
- if_fwe.c
|
||||
NON-Standard implementation of Ethernet over FireWire.
|
||||
|
||||
- bus_mgm.c (userland)
|
||||
Bus management function for user.
|
||||
show topology map, change gap count, bus reset, etc.
|
||||
|
||||
2. Installation
|
||||
|
||||
Suppose you have kernel source at /sys.
|
||||
|
||||
- Extract tarball at root directory.
|
||||
- cd /sys/dev/firewire
|
||||
- make
|
||||
- make install
|
||||
- make load
|
||||
|
||||
For FreeBSD-4 user:
|
||||
|
||||
- ./MAKEDEV
|
||||
|
||||
3. SBP-II support (sbp)
|
||||
|
||||
- You need CAM(SCSI) support in your kernel.
|
||||
If you are using FreeBSD-5 before 2002/03/23 or FreeBSD-4 before
|
||||
2002/4/8, you need to apply CAM-patch in this archive
|
||||
to handle HDD's(T_RBC or T_DIRECT which doesn't support READ_6).
|
||||
|
||||
- If you connect a few firewire devices only, try the following to
|
||||
reduce gap overhead.
|
||||
|
||||
- ./bus_mgm -g 8
|
||||
|
||||
4. Ethernet over FireWire (if_fwe)
|
||||
|
||||
This is a sample driver for ethernet emulation. Please note this
|
||||
does NOT conform to any standards like IP over FireWire(RFC2734[4]).
|
||||
It just sends ethernet frames encapsulated in asynchronous stream
|
||||
packets. It doesn't scale because it does something like unicast over multicast, but it's easy to be implemented and you can use any
|
||||
facilities what ethernet can do. (ipv6, bridging, vlan etc.)
|
||||
|
||||
It also has DEVICE_POLLING[5] support. To enable it, edit your
|
||||
kernel config file and Makefile.fwe then rebuild kernel and if_fwe.ko.
|
||||
Note this driver checks kern.polling.enable only when enabling the
|
||||
interface. When you enable polling after the interface is up,
|
||||
try 'ifconfig fwe0 down;ifconfig fwe0 up'.
|
||||
|
||||
5. FireWire for Kernel Hackers
|
||||
|
||||
As you know, IEEE1394 is a bus and OHCI supports physical access
|
||||
to the host memory. This means that you can access the remote
|
||||
host over firewire without software support at the remote host.
|
||||
In other words, you can investigate remote host's physical memory
|
||||
whether its OS is alive or crashed or hangs up.
|
||||
|
||||
You need to apply KVMLIB-patch and rebuild libkvm then rebuild ps,
|
||||
dmesg and gdb those are statically linked.
|
||||
You may want to apply GDB-patch in this archive to get same behavior
|
||||
as gdb with /dev/mem or want to insert savectx(&dumppcb) into panic(),
|
||||
breakpoint() and so on to emulation crash dump.
|
||||
|
||||
You have to determine target node_id manually at this point.
|
||||
(guess using bus_mgm -t or dmesg)
|
||||
(Targets should be specified by EUI64 in the future)
|
||||
|
||||
# sysctl kern.firewire.fwmem_node=[node_id]
|
||||
|
||||
# ps -agx -M /dev/fwmem0 -N /sys/i386/compile/GENERIC/kernel
|
||||
# dmesg -M /dev/fwmem0 -N /sys/i386/compile/GENERIC/kernel
|
||||
# gdb -k -c /dev/fwmem0 /sys/i386/compile/GENERIC/kernel.debug
|
||||
# dd if=/dev/fwmem0 of=vmcore bs=1m count=[phys. memory in MB]
|
||||
|
||||
remote gdb at 400,000,000 bps :-)
|
||||
|
||||
|
||||
6. DV
|
||||
I have not tested yet.
|
||||
|
||||
7. Tested HW
|
||||
|
||||
OS
|
||||
- FreeBSD-4/i386
|
||||
- FreeBSD-4/alpha
|
||||
- FreeBSD-5/i386
|
||||
|
||||
* Not tested on SMP.
|
||||
* Not tested on big-endian machine...
|
||||
|
||||
OHCI
|
||||
- Texas Instruments TSB12LV26 (PCI)
|
||||
- Texas Instruments TSB43AA22 (PCI/Cardbus)
|
||||
|
||||
* There might be phy probing problem but most of the OHCI
|
||||
chips should work.
|
||||
* Tested with multiple firewire buses.
|
||||
|
||||
SBP-II
|
||||
- HDD: Logitec USB/FireWire LHD-P30FU
|
||||
- HDD: Yano A-dish 120GB
|
||||
- HDD: Yano B-Max 320GB
|
||||
The repository of cvsup2.jp.freebsd.org is on this device.
|
||||
- HDD: Personal Storage 3000XT 160GB
|
||||
The last sector of this drive cannot be accessed..
|
||||
- DVD-RAM: Panasonic LF-D340JD
|
||||
- SCSI-FireWire converter: Yano FWSCSI-01
|
||||
We can recognize only 1 device/lun at this point
|
||||
- HDD: iPod, PowerBook G4 (target mode)
|
||||
Reported by ikob
|
||||
- Scanner: Epson GT-9700F
|
||||
Now works!!
|
||||
Sane-backend needs a patch(SANE-patch in this archive).
|
||||
|
||||
if_fwe
|
||||
- IPv4, IPv6, bridging, vlan.
|
||||
- You need at least two FreeBSD machines with this driver to use.
|
||||
|
||||
References:
|
||||
[1] ftp://ftp.uec.ac.jp/pub/firewire/beta/
|
||||
[2] http://developer.intel.com/technology/1394/download/ohci_11.htm
|
||||
[3] http://www.t10.org/scsi-3.htm
|
||||
[4] http://www.faqs.org/rfcs/rfc2734.html
|
||||
[5] http://info.iet.unipi.it/~luigi/polling/
|
||||
|
||||
|
||||
Hidetoshi Shimokawa
|
||||
[email protected]
|
||||
@@ -1,571 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1998-2002 Katsushi Kobayashi and Hidetoshi Shimokawa
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the acknowledgement as bellow:
|
||||
*
|
||||
* This product includes software developed by K. Kobayashi and H. Shimokawa
|
||||
*
|
||||
* 4. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $FreeBSD$
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _FIREWIRE_H
|
||||
#define _FIREWIRE_H 1
|
||||
|
||||
#define DEV_DEF 0
|
||||
#define DEV_DV 2
|
||||
|
||||
struct dv_data{
|
||||
u_int32_t n_write;
|
||||
u_int32_t a_write;
|
||||
u_int32_t k_write;
|
||||
u_int32_t write_done;
|
||||
u_int32_t write_len[16];
|
||||
u_int32_t write_off[16];
|
||||
u_int32_t n_read;
|
||||
u_int32_t a_read;
|
||||
u_int32_t k_read;
|
||||
u_int32_t read_done;
|
||||
u_int32_t read_len[16];
|
||||
u_int32_t read_off[16];
|
||||
};
|
||||
|
||||
struct dv_data_req_t {
|
||||
unsigned long index;
|
||||
unsigned long len;
|
||||
unsigned long off;
|
||||
};
|
||||
|
||||
struct fw_isochreq {
|
||||
unsigned char ch:6,
|
||||
tag:2;
|
||||
};
|
||||
|
||||
struct fw_isobufreq {
|
||||
struct {
|
||||
unsigned int nchunk;
|
||||
unsigned int npacket;
|
||||
unsigned int psize;
|
||||
} tx, rx;
|
||||
};
|
||||
|
||||
struct fw_addr{
|
||||
unsigned long hi;
|
||||
unsigned long lo;
|
||||
};
|
||||
|
||||
struct fw_asybindreq {
|
||||
struct fw_addr start;
|
||||
unsigned long len;
|
||||
};
|
||||
|
||||
struct fw_reg_req_t{
|
||||
unsigned long addr;
|
||||
unsigned long data;
|
||||
};
|
||||
|
||||
#define FWPMAX_S400 (2048 + 20) /* MAXREC plus space for control data */
|
||||
#define FWMAXQUEUE 128
|
||||
|
||||
#define FWLOCALBUS 0xffc0
|
||||
|
||||
#define FWTCODE_WREQQ 0
|
||||
#define FWTCODE_WREQB 1
|
||||
#define FWTCODE_WRES 2
|
||||
#define FWTCODE_RREQQ 4
|
||||
#define FWTCODE_RREQB 5
|
||||
#define FWTCODE_RRESQ 6
|
||||
#define FWTCODE_RRESB 7
|
||||
#define FWTCODE_CYCS 8
|
||||
#define FWTCODE_LREQ 9
|
||||
#define FWTCODE_STREAM 0xa
|
||||
#define FWTCODE_LRES 0xb
|
||||
#define FWTCODE_PHY 0xe
|
||||
|
||||
#define FWRETRY_1 0
|
||||
#define FWRETRY_X 1
|
||||
#define FWRETRY_A 2
|
||||
#define FWRETRY_B 3
|
||||
|
||||
#define FWRCODE_COMPLETE 0
|
||||
#define FWRCODE_ER_CONFL 4
|
||||
#define FWRCODE_ER_DATA 5
|
||||
#define FWRCODE_ER_TYPE 6
|
||||
#define FWRCODE_ER_ADDR 7
|
||||
|
||||
#define FWSPD_S100 0
|
||||
#define FWSPD_S200 1
|
||||
#define FWSPD_S400 2
|
||||
|
||||
#define FWP_TL_VALID (1 << 7)
|
||||
|
||||
struct fw_isohdr{
|
||||
u_int32_t hdr[1];
|
||||
};
|
||||
struct fw_asyhdr{
|
||||
u_int32_t hdr[4];
|
||||
};
|
||||
#define FWPHYSIDSUBS(SID) (((SID) >> 23) & 1)
|
||||
#define FWPHYSIDNODE(SID) (((SID) >> 24) & 0x3f)
|
||||
#define FWPHYSIDLINK(SID) (((SID) >> 22) & 1)
|
||||
#define FWPHYSIDGAP(SID) (((SID) >> 16) & 0x3f)
|
||||
#define FWPHYSIDSPD(SID) (((SID) >> 14) & 0x3)
|
||||
#define FWPHYSIDDEL(SID) (((SID) >> 12) & 0x3)
|
||||
#define FWPHYSIDCON(SID) (((SID) >> 11) & 1)
|
||||
#define FWPHYSIDPWR(SID) (((SID) >> 8) & 0x7)
|
||||
#define FWPHYSIDP0(SID) (((SID) >> 6) & 0x3)
|
||||
#define FWPHYSIDP1(SID) (((SID) >> 4) & 0x3)
|
||||
#define FWPHYSIDP2(SID) (((SID) >> 2) & 0x3)
|
||||
#define FWPHYSIDIR(SID) (((SID) >> 1) & 1)
|
||||
#define FWPHYSIDMORE(SID) ((SID) & 1)
|
||||
#define FWPHYSIDSEQ(SID) (((SID) >> 20) & 0x7)
|
||||
#define FWPHYSIDPA(SID) (((SID) >> 16) & 0x3)
|
||||
#define FWPHYSIDPB(SID) (((SID) >> 14) & 0x3)
|
||||
#define FWPHYSIDPC(SID) (((SID) >> 12) & 0x3)
|
||||
#define FWPHYSIDPD(SID) (((SID) >> 10) & 0x3)
|
||||
#define FWPHYSIDPE(SID) (((SID) >> 8) & 0x3)
|
||||
#define FWPHYSIDPF(SID) (((SID) >> 6) & 0x3)
|
||||
#define FWPHYSIDPG(SID) (((SID) >> 4) & 0x3)
|
||||
#define FWPHYSIDPH(SID) (((SID) >> 2) & 0x3)
|
||||
struct fw_pkt{
|
||||
#if BYTE_ORDER == LITTLE_ENDIAN
|
||||
union{
|
||||
u_int32_t ld[0];
|
||||
struct {
|
||||
u_int32_t :28,
|
||||
tcode:4;
|
||||
}common;
|
||||
struct {
|
||||
u_int16_t len;
|
||||
u_int8_t chtag;
|
||||
u_int8_t sy:4,
|
||||
tcode:4;
|
||||
u_int32_t payload[0];
|
||||
}stream;
|
||||
struct {
|
||||
u_int16_t dst;
|
||||
u_int8_t tlrt;
|
||||
u_int8_t pri:4,
|
||||
tcode:4;
|
||||
u_int16_t src;
|
||||
}hdr;
|
||||
struct {
|
||||
u_int16_t dst;
|
||||
u_int8_t tlrt;
|
||||
u_int8_t pri:4,
|
||||
tcode:4;
|
||||
u_int16_t src;
|
||||
u_int16_t dest_hi;
|
||||
u_int32_t dest_lo;
|
||||
}rreqq;
|
||||
struct {
|
||||
u_int16_t dst;
|
||||
u_int8_t tlrt;
|
||||
u_int8_t pri:4,
|
||||
tcode:4;
|
||||
u_int16_t src;
|
||||
u_int16_t res1:4,
|
||||
rtcode:4,
|
||||
res2:8;
|
||||
u_int32_t res3;
|
||||
}wres;
|
||||
struct {
|
||||
u_int16_t dst;
|
||||
u_int8_t tlrt;
|
||||
u_int8_t pri:4,
|
||||
tcode:4;
|
||||
u_int16_t src;
|
||||
u_int16_t dest_hi;
|
||||
u_int32_t dest_lo;
|
||||
u_int16_t len;
|
||||
u_int16_t extcode:16;
|
||||
}rreqb;
|
||||
struct {
|
||||
u_int16_t dst;
|
||||
u_int8_t tlrt;
|
||||
u_int8_t pri:4,
|
||||
tcode:4;
|
||||
u_int16_t src;
|
||||
u_int16_t dest_hi:16;
|
||||
u_int32_t dest_lo;
|
||||
u_int32_t data;
|
||||
}wreqq;
|
||||
struct {
|
||||
u_int16_t dst;
|
||||
u_int8_t tlrt;
|
||||
u_int8_t pri:4,
|
||||
tcode:4;
|
||||
u_int16_t src;
|
||||
u_int16_t dest_hi;
|
||||
u_int32_t dest_lo;
|
||||
u_int32_t data;
|
||||
}cyc;
|
||||
struct {
|
||||
u_int16_t dst;
|
||||
u_int8_t tlrt;
|
||||
u_int8_t pri:4,
|
||||
tcode:4;
|
||||
u_int16_t src;
|
||||
u_int16_t res1:4,
|
||||
rtcode:4,
|
||||
res2:8;
|
||||
u_int32_t res3;
|
||||
u_int32_t data;
|
||||
}rresq;
|
||||
struct {
|
||||
u_int16_t dst;
|
||||
u_int8_t tlrt;
|
||||
u_int8_t pri:4,
|
||||
tcode:4;
|
||||
u_int16_t src;
|
||||
u_int16_t dest_hi;
|
||||
u_int32_t dest_lo;
|
||||
u_int16_t len;
|
||||
u_int16_t extcode;
|
||||
u_int32_t payload[0];
|
||||
}wreqb;
|
||||
struct {
|
||||
u_int16_t dst;
|
||||
u_int8_t tlrt;
|
||||
u_int8_t pri:4,
|
||||
tcode:4;
|
||||
u_int16_t src;
|
||||
u_int16_t dest_hi;
|
||||
u_int32_t dest_lo;
|
||||
u_int16_t len;
|
||||
u_int16_t extcode;
|
||||
#define FW_LREQ_MSKSWAP 1
|
||||
#define FW_LREQ_CMPSWAP 2
|
||||
#define FW_LREQ_FTADD 3
|
||||
#define FW_LREQ_LTADD 4
|
||||
#define FW_LREQ_BDADD 5
|
||||
#define FW_LREQ_WRADD 6
|
||||
u_int32_t payload[0];
|
||||
}lreq;
|
||||
struct {
|
||||
u_int16_t dst;
|
||||
u_int8_t tlrt;
|
||||
u_int8_t pri:4,
|
||||
tcode:4;
|
||||
u_int16_t src;
|
||||
u_int16_t res1:4,
|
||||
rtcode:4,
|
||||
res2:8;
|
||||
u_int32_t res3;
|
||||
u_int16_t len;
|
||||
u_int16_t extcode;
|
||||
u_int32_t payload[0];
|
||||
}rresb;
|
||||
struct {
|
||||
u_int16_t dst;
|
||||
u_int8_t tlrt;
|
||||
u_int8_t pri:4,
|
||||
tcode:4;
|
||||
u_int16_t src;
|
||||
u_int16_t res1:4,
|
||||
rtcode:4,
|
||||
res2:8;
|
||||
u_int32_t res3;
|
||||
u_int16_t len;
|
||||
u_int16_t extcode;
|
||||
u_int32_t payload[0];
|
||||
}lres;
|
||||
}mode;
|
||||
#else
|
||||
union{
|
||||
u_int32_t ld[0];
|
||||
struct {
|
||||
u_int32_t :4,
|
||||
tcode:4,
|
||||
:24;
|
||||
}common;
|
||||
struct {
|
||||
u_int8_t sy:4,
|
||||
tcode:4;
|
||||
u_int8_t chtag;
|
||||
u_int16_t len;
|
||||
u_int32_t payload[0];
|
||||
}stream;
|
||||
struct {
|
||||
u_int32_t pri:4,
|
||||
tcode:4,
|
||||
tlrt:8,
|
||||
dst:16;
|
||||
u_int32_t :16,
|
||||
src:16;
|
||||
}hdr;
|
||||
struct {
|
||||
u_int8_t pri:4,
|
||||
tcode:4;
|
||||
u_int8_t tlrt;
|
||||
u_int16_t dst;
|
||||
u_int16_t dest_hi;
|
||||
u_int16_t src;
|
||||
u_int32_t dest_lo;
|
||||
}rreqq;
|
||||
struct {
|
||||
u_int8_t pri:4,
|
||||
tcode:4;
|
||||
u_int8_t tlrt;
|
||||
u_int16_t dst;
|
||||
u_int16_t res1:12,
|
||||
rtcode:4;
|
||||
u_int16_t src;
|
||||
u_int32_t res3;
|
||||
}wres;
|
||||
struct {
|
||||
u_int8_t pri:4,
|
||||
tcode:4;
|
||||
u_int8_t tlrt;
|
||||
u_int16_t dst;
|
||||
u_int16_t dest_hi;
|
||||
u_int16_t src;
|
||||
u_int32_t dest_lo;
|
||||
u_int16_t extcode:16;
|
||||
u_int16_t len;
|
||||
}rreqb;
|
||||
struct {
|
||||
u_int8_t pri:4,
|
||||
tcode:4;
|
||||
u_int8_t tlrt;
|
||||
u_int16_t dst;
|
||||
u_int16_t dest_hi:16;
|
||||
u_int16_t src;
|
||||
u_int32_t dest_lo;
|
||||
u_int32_t data;
|
||||
}wreqq;
|
||||
struct {
|
||||
u_int8_t pri:4,
|
||||
tcode:4;
|
||||
u_int8_t tlrt;
|
||||
u_int16_t dst;
|
||||
u_int16_t dest_hi;
|
||||
u_int16_t src;
|
||||
u_int32_t dest_lo;
|
||||
u_int32_t data;
|
||||
}cyc;
|
||||
struct {
|
||||
u_int8_t pri:4,
|
||||
tcode:4;
|
||||
u_int8_t tlrt;
|
||||
u_int16_t dst;
|
||||
u_int16_t res1:12,
|
||||
rtcode:4;
|
||||
u_int16_t src;
|
||||
u_int32_t res3;
|
||||
u_int32_t data;
|
||||
}rresq;
|
||||
struct {
|
||||
u_int8_t pri:4,
|
||||
tcode:4;
|
||||
u_int8_t tlrt;
|
||||
u_int16_t dst;
|
||||
u_int16_t dest_hi;
|
||||
u_int16_t src;
|
||||
u_int32_t dest_lo;
|
||||
u_int16_t extcode;
|
||||
u_int16_t len;
|
||||
u_int32_t payload[0];
|
||||
}wreqb;
|
||||
struct {
|
||||
u_int8_t pri:4,
|
||||
tcode:4;
|
||||
u_int8_t tlrt;
|
||||
u_int16_t dst;
|
||||
u_int16_t dest_hi;
|
||||
u_int16_t src;
|
||||
u_int32_t dest_lo;
|
||||
u_int16_t extcode;
|
||||
u_int16_t len;
|
||||
#define FW_LREQ_MSKSWAP 1
|
||||
#define FW_LREQ_CMPSWAP 2
|
||||
#define FW_LREQ_FTADD 3
|
||||
#define FW_LREQ_LTADD 4
|
||||
#define FW_LREQ_BDADD 5
|
||||
#define FW_LREQ_WRADD 6
|
||||
u_int32_t payload[0];
|
||||
}lreq;
|
||||
struct {
|
||||
u_int8_t pri:4,
|
||||
tcode:4;
|
||||
u_int8_t tlrt;
|
||||
u_int16_t dst;
|
||||
u_int16_t res1:12,
|
||||
rtcode:4;
|
||||
u_int16_t src;
|
||||
u_int32_t res3;
|
||||
u_int16_t extcode;
|
||||
u_int16_t len;
|
||||
u_int32_t payload[0];
|
||||
}rresb;
|
||||
struct {
|
||||
u_int8_t pri:4,
|
||||
tcode:4;
|
||||
u_int8_t tlrt;
|
||||
u_int16_t dst;
|
||||
u_int16_t res1:12,
|
||||
rtcode:4;
|
||||
u_int16_t src;
|
||||
u_int32_t res3;
|
||||
u_int16_t extcode;
|
||||
u_int16_t len;
|
||||
u_int32_t payload[0];
|
||||
}lres;
|
||||
}mode;
|
||||
#endif
|
||||
};
|
||||
struct fw_eui64 {
|
||||
u_int32_t hi, lo;
|
||||
};
|
||||
struct fw_asyreq {
|
||||
struct fw_asyreq_t{
|
||||
unsigned char sped;
|
||||
unsigned int type;
|
||||
#define FWASREQNODE 0
|
||||
#define FWASREQEUI 1
|
||||
#define FWASRESTL 2
|
||||
#define FWASREQSTREAM 3
|
||||
unsigned short len;
|
||||
union {
|
||||
struct fw_eui64 eui;
|
||||
}dst;
|
||||
}req;
|
||||
struct fw_pkt pkt;
|
||||
u_int32_t data[512];
|
||||
};
|
||||
struct fw_devlstreq {
|
||||
int n;
|
||||
struct fw_eui64 eui[64];
|
||||
u_int16_t dst[64];
|
||||
u_int16_t status[64];
|
||||
};
|
||||
#define FW_SELF_ID_PORT_CONNECTED_TO_CHILD 3
|
||||
#define FW_SELF_ID_PORT_CONNECTED_TO_PARENT 2
|
||||
#define FW_SELF_ID_PORT_NOT_CONNECTED 1
|
||||
#define FW_SELF_ID_PORT_NOT_EXISTS 0
|
||||
union fw_self_id {
|
||||
struct {
|
||||
u_int32_t more_packets:1,
|
||||
initiated_reset:1,
|
||||
port2:2,
|
||||
port1:2,
|
||||
port0:2,
|
||||
power_class:3,
|
||||
contender:1,
|
||||
phy_delay:2,
|
||||
phy_speed:2,
|
||||
gap_count:6,
|
||||
link_active:1,
|
||||
sequel:1,
|
||||
phy_id:6,
|
||||
id:2;
|
||||
} p0;
|
||||
struct {
|
||||
u_int32_t more_packets:1,
|
||||
reserved1:1,
|
||||
porth:2,
|
||||
portg:2,
|
||||
portf:2,
|
||||
porte:2,
|
||||
portd:2,
|
||||
portc:2,
|
||||
portb:2,
|
||||
porta:2,
|
||||
reserved2:2,
|
||||
sequence_num:3,
|
||||
sequel:1,
|
||||
phy_id:6,
|
||||
id:2;
|
||||
} p1;
|
||||
};
|
||||
struct fw_topology_map {
|
||||
u_int32_t crc:16,
|
||||
crc_len:16;
|
||||
u_int32_t generation;
|
||||
u_int32_t self_id_count:16,
|
||||
node_count:16;
|
||||
union fw_self_id self_id[4*64];
|
||||
};
|
||||
struct fw_speed_map {
|
||||
u_int32_t crc:16,
|
||||
crc_len:16;
|
||||
u_int32_t generation;
|
||||
u_int8_t speed[64][64];
|
||||
};
|
||||
struct fw_map_buf {
|
||||
int len;
|
||||
void *ptr;
|
||||
};
|
||||
struct fw_crom_buf {
|
||||
struct fw_eui64 eui;
|
||||
int len;
|
||||
void *ptr;
|
||||
};
|
||||
#define FWSTMAXCHUNK 16
|
||||
/*
|
||||
* Firewire specific system requests.
|
||||
*/
|
||||
#define FW_SSTDV _IOWR('S', 85, unsigned int)
|
||||
#define FW_SSTBUF _IOWR('S', 86, struct fw_isobufreq)
|
||||
#define FW_GSTBUF _IOWR('S', 87, struct fw_isobufreq)
|
||||
#define FW_SRSTREAM _IOWR('S', 88, struct fw_isochreq)
|
||||
#define FW_GRSTREAM _IOWR('S', 89, struct fw_isochreq)
|
||||
#define FW_STSTREAM _IOWR('S', 90, struct fw_isochreq)
|
||||
#define FW_GTSTREAM _IOWR('S', 91, struct fw_isochreq)
|
||||
|
||||
#define FW_ASYREQ _IOWR('S', 92, struct fw_asyreq)
|
||||
#define FW_IBUSRST _IOR('S', 1, unsigned int)
|
||||
#define FW_GDEVLST _IOWR('S', 2, struct fw_devlstreq)
|
||||
#define FW_SBINDADDR _IOWR('S', 3, struct fw_asybindreq)
|
||||
#define FW_CBINDADDR _IOWR('S', 4, struct fw_asybindreq)
|
||||
#define FW_GTPMAP _IOR('S', 5, struct fw_topology_map)
|
||||
#define FW_GSPMAP _IOW('S', 6, struct fw_speed_map *)
|
||||
#define FW_GCROM _IOWR('S', 7, struct fw_crom_buf)
|
||||
|
||||
#define FWOHCI_RDREG _IOWR('S', 80, struct fw_reg_req_t)
|
||||
#define FWOHCI_WRREG _IOWR('S', 81, struct fw_reg_req_t)
|
||||
|
||||
#define DUMPDMA _IOWR('S', 82, u_int32_t)
|
||||
|
||||
#ifdef _KERNEL
|
||||
|
||||
#define FWMAXNDMA 0x100 /* 8 bits DMA channel id. in device No. */
|
||||
|
||||
#if __FreeBSD_version < 500000
|
||||
#define dev2unit(x) ((minor(x) & 0xff) | (minor(x) >> 8))
|
||||
#define unit2minor(x) (((x) & 0xff) | (((x) << 8) & ~0xffff))
|
||||
#endif
|
||||
|
||||
#define UNIT2MIN(x) (((x) & 0xff) << 8)
|
||||
#define DEV2UNIT(x) ((dev2unit(x) & 0xff00) >> 8)
|
||||
#define DEV2DMACH(x) (dev2unit(x) & 0xff)
|
||||
|
||||
#define FWMEM_FLAG 0x10000
|
||||
#define DEV_FWMEM(x) (dev2unit(x) & FWMEM_FLAG)
|
||||
#endif
|
||||
#endif
|
||||
@@ -1,87 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1998-2002 Katsushi Kobayashi and Hidetoshi Shimokawa
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the acknowledgement as bellow:
|
||||
*
|
||||
* This product includes software developed by K. Kobayashi and H. Shimokawa
|
||||
*
|
||||
* 4. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $FreeBSD$
|
||||
*
|
||||
*/
|
||||
|
||||
#define FW_PHY_PHYSID_REG 0x00
|
||||
#define FW_PHY_PHYSID (63<<2)
|
||||
#define FW_PHY_ROOT_REG 0x00
|
||||
#define FW_PHY_ROOT (1<<1)
|
||||
#define FW_PHY_CPS_REG 0x00
|
||||
#define FW_PHY_CPS (1<<0)
|
||||
|
||||
#define FW_PHY_RHB_REG 0x01
|
||||
#define FW_PHY_RHB (1<<7)
|
||||
#define FW_PHY_IBR_REG 0x01
|
||||
#define FW_PHY_IBR (1<<6)
|
||||
#define FW_PHY_ISBR_REG 0x05
|
||||
#define FW_PHY_ISBR (1<<6)
|
||||
#define FW_PHY_GC_REG 0x01
|
||||
|
||||
#define FW_PHY_SPD_REG 0x02
|
||||
#define FW_PHY_SPD (3<<6)
|
||||
#define FW_PHY_REV_REG 0x02
|
||||
#define FW_PHY_REV (3<<4)
|
||||
#define FW_PHY_NP_REG 0x02
|
||||
#define FW_PHY_NP (15<<0)
|
||||
|
||||
#define FW_PHY_P1_REG 0x03
|
||||
#define FW_PHY_P2_REG 0x04
|
||||
#define FW_PHY_P3_REG 0x05
|
||||
|
||||
#define FW_PHY_P_ASTAT (3<<6)
|
||||
#define FW_PHY_P_BSTAT (3<<4)
|
||||
#define FW_PHY_P_CH (1<<3)
|
||||
#define FW_PHY_P_CON (1<<2)
|
||||
|
||||
#define FW_PHY_LOOPINT_REG 0x06
|
||||
#define FW_PHY_LOOPINT (1<<7)
|
||||
#define FW_PHY_CPSINT_REG 0x06
|
||||
#define FW_PHY_CPSNT (1<<6)
|
||||
/*
|
||||
#define FW_PHY_CPS_REG 0x06
|
||||
#define FW_PHY_CPS (1<<5)
|
||||
*/
|
||||
#define FW_PHY_IR_REG 0x06
|
||||
#define FW_PHY_IR (1<<4)
|
||||
#define FW_PHY_C_REG 0x06
|
||||
#define FW_PHY_C (1<<0)
|
||||
|
||||
#define FW_PHY_ESPD_REG 0x03
|
||||
#define FW_PHY_ESPD (7<<5)
|
||||
|
||||
#define FW_PHY_EDEL_REG 0x03
|
||||
#define FW_PHY_EDEL 15<<0
|
||||
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1998-2002 Katsushi Kobayashi and Hidetoshi Shimokawa
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the acknowledgement as bellow:
|
||||
*
|
||||
* This product includes software developed by K. Kobayashi and H. Shimokawa
|
||||
*
|
||||
* 4. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $FreeBSD$
|
||||
*
|
||||
*/
|
||||
struct firewire_bus{
|
||||
device_t bdev;
|
||||
};
|
||||
@@ -1,349 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1998-2002 Katsushi Kobayashi and Hidetoshi Shimokawa
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the acknowledgement as bellow:
|
||||
*
|
||||
* This product includes software developed by K. Kobayashi and H. Shimokawa
|
||||
*
|
||||
* 4. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $FreeBSD$
|
||||
*
|
||||
*/
|
||||
|
||||
#if __FreeBSD_version >= 500000
|
||||
typedef struct thread fw_proc;
|
||||
#include <sys/selinfo.h>
|
||||
#else
|
||||
typedef struct proc fw_proc;
|
||||
#include <sys/select.h>
|
||||
#endif
|
||||
|
||||
#define splfw splimp
|
||||
|
||||
struct fw_device{
|
||||
u_int16_t dst;
|
||||
struct fw_eui64 eui;
|
||||
u_int32_t spec;
|
||||
u_int32_t ver;
|
||||
u_int8_t speed;
|
||||
u_int8_t maxrec;
|
||||
u_int8_t nport;
|
||||
u_int8_t power;
|
||||
#define CSRROMOFF 0x400
|
||||
#define CSRROMSIZE 0x400
|
||||
int rommax; /* offset from 0xffff f000 0000 */
|
||||
u_int32_t csrrom[CSRROMSIZE/4];
|
||||
int rcnt;
|
||||
device_t dev;
|
||||
u_int32_t status;
|
||||
#define FWDEVINIT 1
|
||||
#define FWDEVATTACHED 2
|
||||
#define FWDEVINVAL 3
|
||||
TAILQ_ENTRY(fw_device) link;
|
||||
LIST_HEAD(, fw_xfer) txqueue;
|
||||
LIST_HEAD(, fw_xfer) rxqueue;
|
||||
};
|
||||
struct firewire_softc {
|
||||
#if __FreeBSD_version >= 500000
|
||||
dev_t dev;
|
||||
#else
|
||||
dev_t dev[FWMAXNDMA+1];
|
||||
#endif
|
||||
struct firewire_comm *fc;
|
||||
};
|
||||
#define FW_MAX_DMACH 0x20
|
||||
#define FW_MAX_DEVCH FW_MAX_DMACH
|
||||
#define FW_XFERTIMEOUT 1
|
||||
struct firewire_dev_comm {
|
||||
device_t dev;
|
||||
struct firewire_comm *fc;
|
||||
void (*post_explore) __P((void *));
|
||||
};
|
||||
|
||||
struct tcode_info {
|
||||
u_char hdr_len; /* IEEE1394 header length */
|
||||
u_char flag;
|
||||
#define FWTI_REQ (1 << 0)
|
||||
#define FWTI_RES (1 << 1)
|
||||
#define FWTI_TLABEL (1 << 2)
|
||||
#define FWTI_BLOCK_STR (1 << 3)
|
||||
#define FWTI_BLOCK_ASY (1 << 4)
|
||||
};
|
||||
|
||||
struct firewire_comm{
|
||||
device_t dev;
|
||||
device_t bdev;
|
||||
u_int16_t busid:10,
|
||||
nodeid:6;
|
||||
u_int mode;
|
||||
u_int nport;
|
||||
u_int speed;
|
||||
u_int maxrec;
|
||||
u_int irm;
|
||||
u_int max_node;
|
||||
u_int max_hop;
|
||||
u_int max_asyretry;
|
||||
#define FWPHYASYST (1 << 0)
|
||||
u_int retry_count;
|
||||
u_int32_t ongobus:10,
|
||||
ongonode:6,
|
||||
ongoaddr:16;
|
||||
struct fw_device *ongodev;
|
||||
struct fw_eui64 ongoeui;
|
||||
#define FWMAXCSRDIR 16
|
||||
SLIST_HEAD(, csrdir) ongocsr;
|
||||
SLIST_HEAD(, csrdir) csrfree;
|
||||
struct csrdir{
|
||||
u_int32_t ongoaddr;
|
||||
u_int32_t off;
|
||||
SLIST_ENTRY(csrdir) link;
|
||||
};
|
||||
u_int32_t status;
|
||||
#define FWBUSRESET 0
|
||||
#define FWBUSINIT 1
|
||||
#define FWBUSCYMELECT 2
|
||||
#define FWBUSMGRELECT 3
|
||||
#define FWBUSMGRDONE 4
|
||||
#define FWBUSEXPLORE 5
|
||||
#define FWBUSPHYCONF 6
|
||||
#define FWBUSEXPDONE 7
|
||||
#define FWBUSCOMPLETION 10
|
||||
int nisodma;
|
||||
u_int8_t eui[8];
|
||||
STAILQ_HEAD(fw_queue, fw_xfer);
|
||||
struct fw_xferq {
|
||||
int flag;
|
||||
#define FWXFERQ_CHTAGMASK 0xff
|
||||
#define FWXFERQ_RUNNING (1 << 8)
|
||||
#define FWXFERQ_STREAM (1 << 9)
|
||||
|
||||
#define FWXFERQ_PACKET (1 << 10)
|
||||
#define FWXFERQ_BULK (1 << 11)
|
||||
#define FWXFERQ_DV (1 << 12)
|
||||
#define FWXFERQ_MODEMASK (7 << 10)
|
||||
|
||||
#define FWXFERQ_EXTBUF (1 << 13)
|
||||
#define FWXFERQ_OPEN (1 << 14)
|
||||
|
||||
#define FWXFERQ_HANDLER (1 << 16)
|
||||
#define FWXFERQ_WAKEUP (1 << 17)
|
||||
|
||||
void (*start) __P((struct firewire_comm*));
|
||||
void (*drain) __P((struct firewire_comm*, struct fw_xfer*));
|
||||
struct fw_queue q;
|
||||
u_int queued;
|
||||
u_int maxq;
|
||||
u_int psize;
|
||||
u_int packets;
|
||||
u_int error;
|
||||
STAILQ_HEAD(, fw_bind) binds;
|
||||
caddr_t buf;
|
||||
u_int bnchunk;
|
||||
u_int bnpacket;
|
||||
u_int btpacket;
|
||||
struct fw_bulkxfer *bulkxfer;
|
||||
STAILQ_HEAD(, fw_bulkxfer) stvalid;
|
||||
STAILQ_HEAD(, fw_bulkxfer) stfree;
|
||||
struct fw_bulkxfer *stdma;
|
||||
struct fw_bulkxfer *stdma2;
|
||||
struct fw_bulkxfer *stproc;
|
||||
u_int procptr;
|
||||
int dvdbc, dvdiff, dvsync;
|
||||
struct fw_dvbuf *dvbuf;
|
||||
STAILQ_HEAD(, fw_dvbuf) dvvalid;
|
||||
STAILQ_HEAD(, fw_dvbuf) dvfree;
|
||||
struct fw_dvbuf *dvdma;
|
||||
struct fw_dvbuf *dvproc;
|
||||
u_int dvptr;
|
||||
u_int dvpacket;
|
||||
u_int need_wakeup;
|
||||
struct selinfo rsel;
|
||||
caddr_t sc;
|
||||
void (*hand) __P((struct fw_xferq *));
|
||||
};
|
||||
struct fw_xferq
|
||||
*arq, *atq, *ars, *ats, *it[FW_MAX_DMACH],*ir[FW_MAX_DMACH];
|
||||
struct fw_bulkxfer{
|
||||
u_int32_t flag;
|
||||
caddr_t buf;
|
||||
STAILQ_ENTRY(fw_bulkxfer) link;
|
||||
caddr_t start;
|
||||
caddr_t end;
|
||||
u_int npacket;
|
||||
};
|
||||
struct fw_dvbuf{
|
||||
caddr_t buf;
|
||||
STAILQ_ENTRY(fw_dvbuf) link;
|
||||
};
|
||||
struct tlabel{
|
||||
struct fw_xfer *xfer;
|
||||
STAILQ_ENTRY(tlabel) link;
|
||||
};
|
||||
STAILQ_HEAD(, tlabel) tlabels[0x40];
|
||||
struct fw_bind{
|
||||
u_int32_t start_hi, start_lo, addrlen;
|
||||
struct fw_xfer* xfer;
|
||||
STAILQ_ENTRY(fw_bind) fclist;
|
||||
STAILQ_ENTRY(fw_bind) chlist;
|
||||
};
|
||||
STAILQ_HEAD(, fw_bind) binds;
|
||||
TAILQ_HEAD(, fw_device) devices;
|
||||
STAILQ_HEAD(, fw_xfer) pending;
|
||||
volatile u_int32_t *sid_buf;
|
||||
u_int sid_cnt;
|
||||
#define CSRSIZE 0x4000
|
||||
u_int32_t csr_arc[CSRSIZE/4];
|
||||
#define CROMSIZE 0x400
|
||||
u_int32_t *config_rom;
|
||||
struct fw_topology_map *topology_map;
|
||||
struct fw_speed_map *speed_map;
|
||||
struct callout_handle tlhandle;
|
||||
struct callout_handle bmrhandle;
|
||||
struct callout_handle timeouthandle;
|
||||
struct callout_handle retry_probe_handle;
|
||||
u_int32_t (*cyctimer) __P((struct firewire_comm *));
|
||||
void (*ibr) __P((struct firewire_comm *));
|
||||
u_int32_t (*set_bmr) __P((struct firewire_comm *, u_int32_t));
|
||||
int (*ioctl) __P((dev_t, u_long, caddr_t, int, fw_proc *));
|
||||
int (*irx_enable) __P((struct firewire_comm *, int));
|
||||
int (*irx_disable) __P((struct firewire_comm *, int));
|
||||
int (*itx_enable) __P((struct firewire_comm *, int));
|
||||
int (*itx_disable) __P((struct firewire_comm *, int));
|
||||
void (*timeout) __P((void *));
|
||||
void (*poll) __P((struct firewire_comm *, int, int));
|
||||
void (*set_intr) __P((struct firewire_comm *, int));
|
||||
void (*irx_post) __P((struct firewire_comm *, u_int32_t *));
|
||||
void (*itx_post) __P((struct firewire_comm *, u_int32_t *));
|
||||
struct tcode_info *tcode;
|
||||
};
|
||||
#define CSRARC(sc, offset) ((sc)->csr_arc[(offset)/4])
|
||||
|
||||
|
||||
struct fw_xfer{
|
||||
caddr_t sc;
|
||||
struct firewire_comm *fc;
|
||||
struct fw_xferq *q;
|
||||
struct callout_handle ch;
|
||||
time_t time;
|
||||
struct fw_tlabel *tlabel;
|
||||
u_int8_t spd;
|
||||
u_int8_t tcode;
|
||||
int resp;
|
||||
#define FWXF_INIT 0
|
||||
#define FWXF_INQ 1
|
||||
#define FWXF_START 2
|
||||
#define FWXF_SENT 3
|
||||
#define FWXF_SENTERR 4
|
||||
#define FWXF_BUSY 8
|
||||
#define FWXF_RCVD 10
|
||||
int state;
|
||||
u_int8_t retry;
|
||||
u_int8_t tl;
|
||||
int sub;
|
||||
int32_t dst;
|
||||
u_int8_t act_type;
|
||||
#define FWACT_NULL 0
|
||||
#define FWACT_XFER 2
|
||||
#define FWACT_CH 3
|
||||
void (*retry_req) __P((struct fw_xfer *));
|
||||
union{
|
||||
void (*hand) __P((struct fw_xfer *));
|
||||
|
||||
} act;
|
||||
union{
|
||||
struct {
|
||||
struct fw_device *device;
|
||||
} req;
|
||||
struct {
|
||||
struct stch *channel;
|
||||
} stream;
|
||||
} mode;
|
||||
struct {
|
||||
u_int16_t len, off;
|
||||
caddr_t buf;
|
||||
} send, recv;
|
||||
struct mbuf *mbuf;
|
||||
STAILQ_ENTRY(fw_xfer) link;
|
||||
};
|
||||
void fw_sidrcv __P((struct firewire_comm *, caddr_t, u_int, u_int));
|
||||
void fw_rcv __P((struct firewire_comm *, caddr_t, u_int, u_int, u_int, u_int));
|
||||
void fw_xfer_free __P(( struct fw_xfer*));
|
||||
struct fw_xfer *fw_xfer_alloc __P((void));
|
||||
void fw_init __P((struct firewire_comm *));
|
||||
int fw_tbuf_update __P((struct firewire_comm *, int, int));
|
||||
int fw_rbuf_update __P((struct firewire_comm *, int, int));
|
||||
int fw_readreqq __P((struct firewire_comm *, u_int32_t, u_int32_t, u_int32_t *));
|
||||
int fw_writereqb __P((struct firewire_comm *, u_int32_t, u_int32_t, u_int32_t, u_int32_t *));
|
||||
int fw_readresb __P((struct firewire_comm *, u_int32_t, u_int32_t, u_int32_t, u_int32_t*));
|
||||
int fw_writeres __P((struct firewire_comm *, u_int32_t, u_int32_t));
|
||||
u_int32_t getcsrdata __P((struct fw_device *, u_int8_t));
|
||||
void fw_asybusy __P((struct fw_xfer *));
|
||||
int fw_bindadd __P((struct firewire_comm *, struct fw_bind *));
|
||||
int fw_bindremove __P((struct firewire_comm *, struct fw_bind *));
|
||||
int fw_asyreq __P((struct firewire_comm *, int, struct fw_xfer*));
|
||||
void fw_busreset __P((struct firewire_comm *));
|
||||
u_int16_t fw_crc16 __P((u_int32_t *, u_int32_t));
|
||||
void fw_xfer_timeout __P((void *));
|
||||
void fw_xfer_done __P((struct fw_xfer *));
|
||||
void fw_asy_callback __P((struct fw_xfer *));
|
||||
|
||||
extern int firewire_debug;
|
||||
extern devclass_t firewire_devclass;
|
||||
|
||||
#define DV_BROADCAST_ON (1<<30)
|
||||
#define IP_CHANNELS 0x0234
|
||||
|
||||
#define STATE_CLEAR 0x0000
|
||||
#define STATE_SET 0x0004
|
||||
#define NODE_IDS 0x0008
|
||||
#define RESET_START 0x000c
|
||||
#define SPLIT_TIMEOUT_HI 0x0018
|
||||
#define SPLIT_TIMEOUT_LO 0x001c
|
||||
#define CYCLE_TIME 0x0200
|
||||
#define BUS_TIME 0x0210
|
||||
#define BUS_MGR_ID 0x021c
|
||||
#define BANDWIDTH_AV 0x0220
|
||||
#define CHANNELS_AV_HI 0x0224
|
||||
#define CHANNELS_AV_LO 0x0228
|
||||
|
||||
#define CONF_ROM 0x0400
|
||||
|
||||
#define TOPO_MAP 0x1000
|
||||
#define SPED_MAP 0x2000
|
||||
|
||||
#define oMPR 0x900
|
||||
#define oPCR 0x904
|
||||
|
||||
#define iMPR 0x980
|
||||
#define iPCR 0x984
|
||||
|
||||
#define FWPRI ((PZERO+8)|PCATCH)
|
||||
|
||||
#ifdef __alpha__
|
||||
#undef vtophys
|
||||
#define vtophys(va) alpha_XXX_dmamap((vm_offset_t)(va))
|
||||
#endif /* __alpha__ */
|
||||
@@ -1,254 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2002
|
||||
* Hidetoshi Shimokawa. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
*
|
||||
* This product includes software developed by Hidetoshi Shimokawa.
|
||||
*
|
||||
* 4. Neither the name of the author nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/conf.h>
|
||||
#include <sys/uio.h>
|
||||
#include <sys/sysctl.h>
|
||||
|
||||
#include <sys/bus.h>
|
||||
|
||||
#include <sys/signal.h>
|
||||
#include <sys/mman.h>
|
||||
#include <sys/ioccom.h>
|
||||
|
||||
#include <dev/firewire/firewire.h>
|
||||
#include <dev/firewire/firewirereg.h>
|
||||
#include <dev/firewire/fwmem.h>
|
||||
|
||||
static int fwmem_node=0, fwmem_speed=2, fwmem_debug=0;
|
||||
SYSCTL_DECL(_hw_firewire);
|
||||
SYSCTL_NODE(_hw_firewire, OID_AUTO, fwmem, CTLFLAG_RD, 0,
|
||||
"Firewire Memory Access");
|
||||
SYSCTL_INT(_hw_firewire_fwmem, OID_AUTO, node, CTLFLAG_RW, &fwmem_node, 0,
|
||||
"Fwmem target node");
|
||||
SYSCTL_INT(_hw_firewire_fwmem, OID_AUTO, speed, CTLFLAG_RW, &fwmem_speed, 0,
|
||||
"Fwmem link speed");
|
||||
SYSCTL_INT(_debug, OID_AUTO, fwmem_debug, CTLFLAG_RW, &fwmem_debug, 0,
|
||||
"Fwmem driver debug flag");
|
||||
|
||||
struct fw_xfer *
|
||||
fwmem_read_quad(
|
||||
struct firewire_comm *fc,
|
||||
int dst,
|
||||
u_int16_t dst_hi,
|
||||
u_int32_t dst_lo
|
||||
)
|
||||
{
|
||||
struct fw_xfer *xfer;
|
||||
struct fw_pkt *fp;
|
||||
int err = 0;
|
||||
|
||||
xfer = fw_xfer_alloc();
|
||||
if (xfer == NULL) {
|
||||
err = ENOMEM;
|
||||
return NULL;
|
||||
}
|
||||
xfer->fc = fc;
|
||||
xfer->dst = FWLOCALBUS | dst;
|
||||
xfer->spd = fwmem_speed; /* XXX */
|
||||
xfer->send.len = 12;
|
||||
xfer->send.buf = malloc(xfer->send.len, M_DEVBUF, M_NOWAIT | M_ZERO);
|
||||
if (xfer->send.buf == NULL) {
|
||||
err = ENOMEM;
|
||||
goto error;
|
||||
}
|
||||
xfer->send.off = 0;
|
||||
xfer->act.hand = fw_asy_callback;
|
||||
xfer->retry_req = fw_asybusy;
|
||||
xfer->sc = NULL;
|
||||
|
||||
fp = (struct fw_pkt *)xfer->send.buf;
|
||||
fp->mode.rreqq.tcode = FWTCODE_RREQQ;
|
||||
fp->mode.rreqq.dst = htons(xfer->dst);
|
||||
fp->mode.rreqq.dest_hi = htons(dst_hi);
|
||||
fp->mode.rreqq.dest_lo = htonl(dst_lo);
|
||||
|
||||
if (fwmem_debug)
|
||||
printf("fwmem: %d %04x:%08x\n", dst, dst_hi, dst_lo);
|
||||
err = fw_asyreq(fc, -1, xfer);
|
||||
if (err)
|
||||
goto error;
|
||||
err = tsleep((caddr_t)xfer, FWPRI, "fwmem", hz);
|
||||
if (err == 0) {
|
||||
return xfer;
|
||||
}
|
||||
error:
|
||||
fw_xfer_free(xfer);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
struct fw_xfer *
|
||||
fwmem_read_block(
|
||||
struct firewire_comm *fc,
|
||||
int dst,
|
||||
u_int16_t dst_hi,
|
||||
u_int32_t dst_lo,
|
||||
int len
|
||||
)
|
||||
{
|
||||
struct fw_xfer *xfer;
|
||||
struct fw_pkt *fp;
|
||||
int err = 0;
|
||||
|
||||
xfer = fw_xfer_alloc();
|
||||
if (xfer == NULL) {
|
||||
err = ENOMEM;
|
||||
return NULL;
|
||||
}
|
||||
xfer->fc = fc;
|
||||
xfer->dst = FWLOCALBUS | dst;
|
||||
xfer->spd = fwmem_speed; /* XXX */
|
||||
xfer->send.len = 16;
|
||||
xfer->send.buf = malloc(xfer->send.len, M_DEVBUF, M_NOWAIT | M_ZERO);
|
||||
if (xfer->send.buf == NULL) {
|
||||
err = ENOMEM;
|
||||
goto error;
|
||||
}
|
||||
xfer->send.off = 0;
|
||||
xfer->act.hand = fw_asy_callback;
|
||||
xfer->retry_req = fw_asybusy;
|
||||
xfer->sc = NULL;
|
||||
|
||||
fp = (struct fw_pkt *)xfer->send.buf;
|
||||
fp->mode.rreqb.tcode = FWTCODE_RREQB;
|
||||
fp->mode.rreqb.dst = htons(xfer->dst);
|
||||
fp->mode.rreqb.dest_hi = htons(dst_hi);
|
||||
fp->mode.rreqb.dest_lo = htonl(dst_lo);
|
||||
fp->mode.rreqb.len = htons(len);
|
||||
|
||||
if (fwmem_debug)
|
||||
printf("fwmem: %d %04x:%08x %d\n", dst, dst_hi, dst_lo, len);
|
||||
err = fw_asyreq(fc, -1, xfer);
|
||||
if (err)
|
||||
goto error;
|
||||
err = tsleep((caddr_t)xfer, FWPRI, "fwmem", hz);
|
||||
if (err == 0) {
|
||||
return xfer;
|
||||
}
|
||||
error:
|
||||
fw_xfer_free(xfer);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int
|
||||
fwmem_open (dev_t dev, int flags, int fmt, fw_proc *td)
|
||||
{
|
||||
int err = 0;
|
||||
return err;
|
||||
}
|
||||
|
||||
int
|
||||
fwmem_close (dev_t dev, int flags, int fmt, fw_proc *td)
|
||||
{
|
||||
int err = 0;
|
||||
return err;
|
||||
}
|
||||
|
||||
#define MAXLEN 2048
|
||||
#define USE_QUAD 0
|
||||
int
|
||||
fwmem_read (dev_t dev, struct uio *uio, int ioflag)
|
||||
{
|
||||
struct firewire_softc *sc;
|
||||
struct firewire_comm *fc;
|
||||
struct fw_xfer *xfer;
|
||||
int err = 0, pad;
|
||||
int unit = DEV2UNIT(dev);
|
||||
u_int16_t dst_hi;
|
||||
u_int32_t dst_lo;
|
||||
off_t offset;
|
||||
int len;
|
||||
|
||||
sc = devclass_get_softc(firewire_devclass, unit);
|
||||
fc = sc->fc;
|
||||
|
||||
pad = uio->uio_offset % 4;
|
||||
if (fwmem_debug && pad != 0)
|
||||
printf("unaligned\n");
|
||||
while(uio->uio_resid > 0) {
|
||||
offset = uio->uio_offset;
|
||||
offset -= pad;
|
||||
dst_hi = (offset >> 32) & 0xffff;
|
||||
dst_lo = offset & 0xffffffff;
|
||||
#if USE_QUAD
|
||||
xfer = fwmem_read_quad(fc, fwmem_node, dst_hi, dst_lo);
|
||||
if (xfer == NULL || xfer->resp != 0 || xfer->recv.buf == NULL)
|
||||
return EINVAL; /* XXX */
|
||||
err = uiomove(xfer->recv.buf + xfer->recv.off + 4*3 + pad,
|
||||
4 - pad, uio);
|
||||
#else
|
||||
len = uio->uio_resid;
|
||||
if (len > MAXLEN)
|
||||
len = MAXLEN;
|
||||
xfer = fwmem_read_block(fc, fwmem_node, dst_hi, dst_lo, len);
|
||||
if (xfer == NULL || xfer->resp != 0 || xfer->recv.buf == NULL)
|
||||
return EINVAL; /* XXX */
|
||||
err = uiomove(xfer->recv.buf + xfer->recv.off + 4*4 + pad,
|
||||
len - pad, uio);
|
||||
#endif
|
||||
if (err)
|
||||
return err;
|
||||
fw_xfer_free(xfer);
|
||||
pad = 0;
|
||||
}
|
||||
return err;
|
||||
}
|
||||
int
|
||||
fwmem_write (dev_t dev, struct uio *uio, int ioflag)
|
||||
{
|
||||
return EINVAL;
|
||||
}
|
||||
int
|
||||
fwmem_ioctl (dev_t dev, u_long cmd, caddr_t data, int flag, fw_proc *td)
|
||||
{
|
||||
return EINVAL;
|
||||
}
|
||||
int
|
||||
fwmem_poll (dev_t dev, int events, fw_proc *td)
|
||||
{
|
||||
return EINVAL;
|
||||
}
|
||||
int
|
||||
fwmem_mmap (dev_t dev, vm_offset_t offset, int nproto)
|
||||
{
|
||||
return EINVAL;
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2002
|
||||
* Hidetoshi Shimokawa. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
*
|
||||
* This product includes software developed by Hidetoshi Shimokawa.
|
||||
*
|
||||
* 4. Neither the name of the author nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
struct fw_xfer * fwmem_read_quad(struct firewire_comm *,
|
||||
int, u_int16_t, u_int32_t);
|
||||
struct fw_xfer * fwmem_read_block(struct firewire_comm *,
|
||||
int, u_int16_t, u_int32_t, int);
|
||||
d_open_t fwmem_open;
|
||||
d_close_t fwmem_close;
|
||||
d_ioctl_t fwmem_ioctl;
|
||||
d_read_t fwmem_read;
|
||||
d_write_t fwmem_write;
|
||||
d_poll_t fwmem_poll;
|
||||
d_mmap_t fwmem_mmap;
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,399 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1998-2001 Katsushi Kobayashi and Hidetoshi Shimokawa
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the acknowledgement as bellow:
|
||||
*
|
||||
* This product includes software developed by K. Kobayashi and H. Shimokawa
|
||||
*
|
||||
* 4. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $FreeBSD$
|
||||
*
|
||||
*/
|
||||
#define PCI_CBMEM 0x10
|
||||
|
||||
#define FW_VENDORID_NEC 0x1033
|
||||
#define FW_VENDORID_TI 0x104c
|
||||
#define FW_VENDORID_SONY 0x104d
|
||||
#define FW_VENDORID_VIA 0x1106
|
||||
#define FW_VENDORID_RICOH 0x1180
|
||||
#define FW_VENDORID_APPLE 0x106b
|
||||
#define FW_VENDORID_LUCENT 0x11c1
|
||||
|
||||
#define FW_DEVICE_UPD861 0x0063
|
||||
#define FW_DEVICE_TITSB22 0x8009
|
||||
#define FW_DEVICE_TITSB23 0x8019
|
||||
#define FW_DEVICE_TITSB26 0x8020
|
||||
#define FW_DEVICE_TITSB43 0x8021
|
||||
#define FW_DEVICE_CX3022 0x8039
|
||||
#define FW_DEVICE_VT6306 0x3044
|
||||
#define FW_DEVICE_R5C552 0x1180
|
||||
#define FW_DEVICE_PANGEA 0x0030
|
||||
#define FW_DEVICE_UNINORTH 0x0031
|
||||
#define FW_DEVICE_FW322 0x5811
|
||||
|
||||
#define PCI_INTERFACE_OHCI 0x10
|
||||
|
||||
#define FW_OHCI_BASE_REG 0x10
|
||||
|
||||
#define OHCI_DMA_ITCH 0x20
|
||||
#define OHCI_DMA_IRCH 0x20
|
||||
|
||||
#define OHCI_MAX_DMA_CH (0x4 + OHCI_DMA_ITCH + OHCI_DMA_IRCH)
|
||||
|
||||
|
||||
typedef volatile u_int32_t fwohcireg_t;
|
||||
|
||||
struct fwohcidb {
|
||||
union {
|
||||
struct {
|
||||
volatile u_int32_t cmd;
|
||||
volatile u_int32_t addr;
|
||||
volatile u_int32_t depend;
|
||||
volatile u_int32_t count:16,
|
||||
status:16;
|
||||
} desc;
|
||||
volatile u_int32_t immed[4];
|
||||
} db;
|
||||
#define OHCI_OUTPUT_MORE (0 << 28)
|
||||
#define OHCI_OUTPUT_LAST (1 << 28)
|
||||
#define OHCI_INPUT_MORE (2 << 28)
|
||||
#define OHCI_INPUT_LAST (3 << 28)
|
||||
#define OHCI_STORE_QUAD (4 << 28)
|
||||
#define OHCI_LOAD_QUAD (5 << 28)
|
||||
#define OHCI_NOP (6 << 28)
|
||||
#define OHCI_STOP (7 << 28)
|
||||
#define OHCI_STORE (8 << 28)
|
||||
#define OHCI_CMD_MASK (0xf << 28)
|
||||
|
||||
#define OHCI_UPDATE (1 << 27)
|
||||
|
||||
#define OHCI_KEY_ST0 (0 << 24)
|
||||
#define OHCI_KEY_ST1 (1 << 24)
|
||||
#define OHCI_KEY_ST2 (2 << 24)
|
||||
#define OHCI_KEY_ST3 (3 << 24)
|
||||
#define OHCI_KEY_REGS (5 << 24)
|
||||
#define OHCI_KEY_SYS (6 << 24)
|
||||
#define OHCI_KEY_DEVICE (7 << 24)
|
||||
#define OHCI_KEY_MASK (7 << 24)
|
||||
|
||||
#define OHCI_INTERRUPT_NEVER (0 << 20)
|
||||
#define OHCI_INTERRUPT_TRUE (1 << 20)
|
||||
#define OHCI_INTERRUPT_FALSE (2 << 20)
|
||||
#define OHCI_INTERRUPT_ALWAYS (3 << 20)
|
||||
|
||||
#define OHCI_BRANCH_NEVER (0 << 18)
|
||||
#define OHCI_BRANCH_TRUE (1 << 18)
|
||||
#define OHCI_BRANCH_FALSE (2 << 18)
|
||||
#define OHCI_BRANCH_ALWAYS (3 << 18)
|
||||
#define OHCI_BRANCH_MASK (3 << 18)
|
||||
|
||||
#define OHCI_WAIT_NEVER (0 << 16)
|
||||
#define OHCI_WAIT_TRUE (1 << 16)
|
||||
#define OHCI_WAIT_FALSE (2 << 16)
|
||||
#define OHCI_WAIT_ALWAYS (3 << 16)
|
||||
};
|
||||
|
||||
#define OHCI_SPD_S100 0x4
|
||||
#define OHCI_SPD_S200 0x1
|
||||
#define OHCI_SPD_S400 0x2
|
||||
|
||||
|
||||
#define FWOHCIEV_NOSTAT 0
|
||||
#define FWOHCIEV_LONGP 2
|
||||
#define FWOHCIEV_MISSACK 3
|
||||
#define FWOHCIEV_UNDRRUN 4
|
||||
#define FWOHCIEV_OVRRUN 5
|
||||
#define FWOHCIEV_DESCERR 6
|
||||
#define FWOHCIEV_DTRDERR 7
|
||||
#define FWOHCIEV_DTWRERR 8
|
||||
#define FWOHCIEV_BUSRST 9
|
||||
#define FWOHCIEV_TIMEOUT 0xa
|
||||
#define FWOHCIEV_TCODERR 0xb
|
||||
#define FWOHCIEV_UNKNOWN 0xe
|
||||
#define FWOHCIEV_FLUSHED 0xf
|
||||
#define FWOHCIEV_ACKCOMPL 0x11
|
||||
#define FWOHCIEV_ACKPEND 0x12
|
||||
#define FWOHCIEV_ACKBSX 0x14
|
||||
#define FWOHCIEV_ACKBSA 0x15
|
||||
#define FWOHCIEV_ACKBSB 0x16
|
||||
#define FWOHCIEV_ACKTARD 0x1b
|
||||
#define FWOHCIEV_ACKDERR 0x1d
|
||||
#define FWOHCIEV_ACKTERR 0x1e
|
||||
|
||||
#define FWOHCIEV_MASK 0x1f
|
||||
|
||||
struct ohci_registers {
|
||||
fwohcireg_t ver; /* Version No. 0x0 */
|
||||
fwohcireg_t guid; /* GUID_ROM No. 0x4 */
|
||||
fwohcireg_t retry; /* AT retries 0x8 */
|
||||
#define FWOHCI_RETRY 0x8
|
||||
fwohcireg_t csr_data; /* CSR data 0xc */
|
||||
fwohcireg_t csr_cmp; /* CSR compare 0x10 */
|
||||
fwohcireg_t csr_cntl; /* CSR compare 0x14 */
|
||||
fwohcireg_t rom_hdr; /* config ROM ptr. 0x18 */
|
||||
fwohcireg_t bus_id; /* BUS_ID 0x1c */
|
||||
fwohcireg_t bus_opt; /* BUS option 0x20 */
|
||||
#define FWOHCIGUID_H 0x24
|
||||
#define FWOHCIGUID_L 0x28
|
||||
fwohcireg_t guid_hi; /* GUID hi 0x24 */
|
||||
fwohcireg_t guid_lo; /* GUID lo 0x28 */
|
||||
fwohcireg_t dummy0[2]; /* dummy 0x2c-0x30 */
|
||||
fwohcireg_t config_rom; /* config ROM map 0x34 */
|
||||
fwohcireg_t post_wr_lo; /* post write addr lo 0x38 */
|
||||
fwohcireg_t post_wr_hi; /* post write addr hi 0x3c */
|
||||
fwohcireg_t vender; /* vender ID 0x40 */
|
||||
fwohcireg_t dummy1[3]; /* dummy 0x44-0x4c */
|
||||
fwohcireg_t hcc_cntl_set; /* HCC control set 0x50 */
|
||||
fwohcireg_t hcc_cntl_clr; /* HCC control clr 0x54 */
|
||||
#define OHCI_HCC_BIGEND (1 << 30)
|
||||
#define OHCI_HCC_PRPHY (1 << 23)
|
||||
#define OHCI_HCC_PHYEN (1 << 22)
|
||||
#define OHCI_HCC_LPS (1 << 19)
|
||||
#define OHCI_HCC_POSTWR (1 << 18)
|
||||
#define OHCI_HCC_LINKEN (1 << 17)
|
||||
#define OHCI_HCC_RESET (1 << 16)
|
||||
fwohcireg_t dummy2[2]; /* dummy 0x58-0x5c */
|
||||
fwohcireg_t dummy3[1]; /* dummy 0x60 */
|
||||
fwohcireg_t sid_buf; /* self id buffer 0x64 */
|
||||
fwohcireg_t sid_cnt; /* self id count 0x68 */
|
||||
fwohcireg_t dummy4[1]; /* dummy 0x6c */
|
||||
fwohcireg_t ir_mask_hi_set; /* ir mask hi set 0x70 */
|
||||
fwohcireg_t ir_mask_hi_clr; /* ir mask hi set 0x74 */
|
||||
fwohcireg_t ir_mask_lo_set; /* ir mask hi set 0x78 */
|
||||
fwohcireg_t ir_mask_lo_clr; /* ir mask hi set 0x7c */
|
||||
#define FWOHCI_INTSTAT 0x80
|
||||
#define FWOHCI_INTSTATCLR 0x84
|
||||
#define FWOHCI_INTMASK 0x88
|
||||
#define FWOHCI_INTMASKCLR 0x8c
|
||||
fwohcireg_t int_stat; /* 0x80 */
|
||||
fwohcireg_t int_clear; /* 0x84 */
|
||||
fwohcireg_t int_mask; /* 0x88 */
|
||||
fwohcireg_t int_mask_clear; /* 0x8c */
|
||||
fwohcireg_t it_int_stat; /* 0x90 */
|
||||
fwohcireg_t it_int_clear; /* 0x94 */
|
||||
fwohcireg_t it_int_mask; /* 0x98 */
|
||||
fwohcireg_t it_mask_clear; /* 0x9c */
|
||||
fwohcireg_t ir_int_stat; /* 0xa0 */
|
||||
fwohcireg_t ir_int_clear; /* 0xa4 */
|
||||
fwohcireg_t ir_int_mask; /* 0xa8 */
|
||||
fwohcireg_t ir_mask_clear; /* 0xac */
|
||||
fwohcireg_t dummy5[11]; /* dummy 0xb0-d8 */
|
||||
fwohcireg_t fairness; /* fairness control 0xdc */
|
||||
fwohcireg_t link_cntl; /* Chip control 0xe0*/
|
||||
fwohcireg_t link_cntl_clr; /* Chip control clear 0xe4*/
|
||||
#define FWOHCI_NODEID 0xe8
|
||||
fwohcireg_t node; /* Node ID 0xe8 */
|
||||
#define OHCI_NODE_VALID (1 << 31)
|
||||
#define OHCI_NODE_ROOT (1 << 30)
|
||||
|
||||
#define OHCI_ASYSRCBUS 1
|
||||
|
||||
fwohcireg_t phy_access; /* PHY cntl 0xec */
|
||||
#define PHYDEV_RDDONE (1<<31)
|
||||
#define PHYDEV_RDCMD (1<<15)
|
||||
#define PHYDEV_WRCMD (1<<14)
|
||||
#define PHYDEV_REGADDR 8
|
||||
#define PHYDEV_WRDATA 0
|
||||
#define PHYDEV_RDADDR 24
|
||||
#define PHYDEV_RDDATA 16
|
||||
|
||||
fwohcireg_t cycle_timer; /* Cycle Timer 0xf0 */
|
||||
fwohcireg_t dummy6[3]; /* dummy 0xf4-fc */
|
||||
fwohcireg_t areq_hi; /* Async req. filter hi 0x100 */
|
||||
fwohcireg_t areq_hi_clr; /* Async req. filter hi 0x104 */
|
||||
fwohcireg_t areq_lo; /* Async req. filter lo 0x108 */
|
||||
fwohcireg_t areq_lo_clr; /* Async req. filter lo 0x10c */
|
||||
fwohcireg_t preq_hi; /* Async req. filter hi 0x110 */
|
||||
fwohcireg_t preq_hi_clr; /* Async req. filter hi 0x114 */
|
||||
fwohcireg_t preq_lo; /* Async req. filter lo 0x118 */
|
||||
fwohcireg_t preq_lo_clr; /* Async req. filter lo 0x11c */
|
||||
|
||||
fwohcireg_t pys_upper; /* Physical Upper bound 0x120 */
|
||||
|
||||
fwohcireg_t dummy7[23]; /* dummy 0x124-0x17c */
|
||||
|
||||
struct ohci_dma{
|
||||
fwohcireg_t cntl;
|
||||
|
||||
#define OHCI_CNTL_CYCMATCH_S (0x1 << 31)
|
||||
|
||||
#define OHCI_CNTL_BUFFIL (0x1 << 31)
|
||||
#define OHCI_CNTL_ISOHDR (0x1 << 30)
|
||||
#define OHCI_CNTL_CYCMATCH_R (0x1 << 29)
|
||||
#define OHCI_CNTL_MULTICH (0x1 << 28)
|
||||
|
||||
#define OHCI_CNTL_DMA_RUN (0x1 << 15)
|
||||
#define OHCI_CNTL_DMA_WAKE (0x1 << 12)
|
||||
#define OHCI_CNTL_DMA_DEAD (0x1 << 11)
|
||||
#define OHCI_CNTL_DMA_ACTIVE (0x1 << 10)
|
||||
#define OHCI_CNTL_DMA_BT (0x1 << 8)
|
||||
#define OHCI_CNTL_DMA_BAD (0x1 << 7)
|
||||
#define OHCI_CNTL_DMA_STAT (0xff)
|
||||
|
||||
fwohcireg_t cntl_clr;
|
||||
fwohcireg_t dummy0;
|
||||
fwohcireg_t cmd;
|
||||
fwohcireg_t match;
|
||||
fwohcireg_t dummy1;
|
||||
fwohcireg_t dummy2;
|
||||
fwohcireg_t dummy3;
|
||||
};
|
||||
/* 0x180, 0x184, 0x188, 0x18c */
|
||||
/* 0x190, 0x194, 0x198, 0x19c */
|
||||
/* 0x1a0, 0x1a4, 0x1a8, 0x1ac */
|
||||
/* 0x1b0, 0x1b4, 0x1b8, 0x1bc */
|
||||
/* 0x1c0, 0x1c4, 0x1c8, 0x1cc */
|
||||
/* 0x1d0, 0x1d4, 0x1d8, 0x1dc */
|
||||
/* 0x1e0, 0x1e4, 0x1e8, 0x1ec */
|
||||
/* 0x1f0, 0x1f4, 0x1f8, 0x1fc */
|
||||
struct ohci_dma dma_ch[0x4];
|
||||
|
||||
/* 0x200, 0x204, 0x208, 0x20c */
|
||||
/* 0x210, 0x204, 0x208, 0x20c */
|
||||
struct ohci_itdma{
|
||||
fwohcireg_t cntl;
|
||||
fwohcireg_t cntl_clr;
|
||||
fwohcireg_t dummy0;
|
||||
fwohcireg_t cmd;
|
||||
};
|
||||
struct ohci_itdma dma_itch[0x20];
|
||||
|
||||
/* 0x400, 0x404, 0x408, 0x40c */
|
||||
/* 0x410, 0x404, 0x408, 0x40c */
|
||||
|
||||
struct ohci_dma dma_irch[0x20];
|
||||
};
|
||||
|
||||
struct fwohcidb_tr{
|
||||
STAILQ_ENTRY(fwohcidb_tr) link;
|
||||
struct fw_xfer *xfer;
|
||||
volatile struct fwohcidb *db;
|
||||
caddr_t buf;
|
||||
caddr_t dummy;
|
||||
int dbcnt;
|
||||
};
|
||||
|
||||
/*
|
||||
* OHCI info structure.
|
||||
*/
|
||||
#if 0
|
||||
struct fwohci_softc {
|
||||
struct fw_softc fc;
|
||||
volatile struct ohci_registers *base;
|
||||
int init;
|
||||
#define SIDPHASE 1
|
||||
u_int32_t flags;
|
||||
struct fwohcidb_tr *db_tr[OHCI_MAX_DMA_CH];
|
||||
struct fwohcidb_tr *db_first[OHCI_MAX_DMA_CH];
|
||||
struct fwohcidb_tr *db_last[OHCI_MAX_DMA_CH];
|
||||
struct {
|
||||
int tail;
|
||||
struct fwohcidb_tr *db_tr;
|
||||
struct fwohcidb *db;
|
||||
}dbdvtx[MAX_DVFRAME], dbdvrx[MAX_DVFRAME];
|
||||
int ndb[OHCI_MAX_DMA_CH];
|
||||
u_int32_t isohdr[OHCI_MAX_DMA_CH];
|
||||
int queued[OHCI_MAX_DMA_CH];
|
||||
int dma_ch[OHCI_MAX_DMA_CH];
|
||||
};
|
||||
#endif
|
||||
struct fwohci_txpkthdr{
|
||||
union{
|
||||
u_int32_t ld[4];
|
||||
struct {
|
||||
u_int32_t res3:4,
|
||||
tcode:4,
|
||||
res2:8,
|
||||
spd:3,
|
||||
res1:13;
|
||||
}common;
|
||||
struct {
|
||||
u_int32_t res3:4,
|
||||
tcode:4,
|
||||
tlrt:8,
|
||||
spd:3,
|
||||
res2:4,
|
||||
srcbus:1,
|
||||
res1:8;
|
||||
u_int32_t res4:16,
|
||||
dst:16;
|
||||
}asycomm;
|
||||
struct {
|
||||
u_int32_t sy:4,
|
||||
tcode:4,
|
||||
chtag:8,
|
||||
spd:3,
|
||||
res1:13;
|
||||
u_int32_t res2:16,
|
||||
len:16;
|
||||
}stream;
|
||||
}mode;
|
||||
};
|
||||
struct fwohci_trailer{
|
||||
u_int32_t time:16,
|
||||
stat:16;
|
||||
};
|
||||
|
||||
#define OHCI_CNTL_CYCSRC (0x1 << 22)
|
||||
#define OHCI_CNTL_CYCMTR (0x1 << 21)
|
||||
#define OHCI_CNTL_CYCTIMER (0x1 << 20)
|
||||
#define OHCI_CNTL_PHYPKT (0x1 << 10)
|
||||
#define OHCI_CNTL_SID (0x1 << 9)
|
||||
|
||||
#define OHCI_INT_DMA_ATRQ (0x1 << 0)
|
||||
#define OHCI_INT_DMA_ATRS (0x1 << 1)
|
||||
#define OHCI_INT_DMA_ARRQ (0x1 << 2)
|
||||
#define OHCI_INT_DMA_ARRS (0x1 << 3)
|
||||
#define OHCI_INT_DMA_PRRQ (0x1 << 4)
|
||||
#define OHCI_INT_DMA_PRRS (0x1 << 5)
|
||||
#define OHCI_INT_DMA_IT (0x1 << 6)
|
||||
#define OHCI_INT_DMA_IR (0x1 << 7)
|
||||
#define OHCI_INT_PW_ERR (0x1 << 8)
|
||||
#define OHCI_INT_LR_ERR (0x1 << 9)
|
||||
|
||||
#define OHCI_INT_PHY_SID (0x1 << 16)
|
||||
#define OHCI_INT_PHY_BUS_R (0x1 << 17)
|
||||
|
||||
#define OHCI_INT_PHY_INT (0x1 << 19)
|
||||
#define OHCI_INT_CYC_START (0x1 << 20)
|
||||
#define OHCI_INT_CYC_64SECOND (0x1 << 21)
|
||||
#define OHCI_INT_CYC_LOST (0x1 << 22)
|
||||
#define OHCI_INT_CYC_ERR (0x1 << 23)
|
||||
|
||||
#define OHCI_INT_ERR (0x1 << 24)
|
||||
#define OHCI_INT_CYC_LONG (0x1 << 25)
|
||||
#define OHCI_INT_PHY_REG (0x1 << 26)
|
||||
|
||||
#define OHCI_INT_EN (0x1 << 31)
|
||||
|
||||
#define IP_CHANNELS 0x0234
|
||||
#define FWOHCI_MAXREC 2048
|
||||
|
||||
#define OHCI_ISORA 0x02
|
||||
#define OHCI_ISORB 0x04
|
||||
|
||||
#define FWOHCITCODE_PHY 0xe
|
||||
@@ -1,70 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1998-2002 Katsushi Kobayashi and Hidetoshi SHimokawa
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the acknowledgement as bellow:
|
||||
*
|
||||
* This product includes software developed by K. Kobayashi and H. Shimokawa
|
||||
*
|
||||
* 4. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $FreeBSD$
|
||||
*
|
||||
*/
|
||||
typedef struct fwohci_softc {
|
||||
struct firewire_comm fc;
|
||||
bus_space_tag_t bst;
|
||||
bus_space_handle_t bsh;
|
||||
void *ih;
|
||||
#if __FreeBSD_version < 500000
|
||||
void *ih_cam;
|
||||
#endif
|
||||
|
||||
struct resource *bsr;
|
||||
struct resource *irq_res;
|
||||
struct fwohci_dbch{
|
||||
u_int ndb;
|
||||
u_int ndesc;
|
||||
caddr_t dummy;
|
||||
STAILQ_HEAD(, fwohcidb_tr) db_trq;
|
||||
struct fwohcidb_tr *top, *bottom, *pdb_tr;
|
||||
struct fw_xferq xferq;
|
||||
struct {
|
||||
int len;
|
||||
int hlen;
|
||||
int plen;
|
||||
caddr_t buf;
|
||||
} frag;
|
||||
int flags;
|
||||
#define FWOHCI_DBCH_FULL (1<<1)
|
||||
int buf_offset;
|
||||
} arrq, arrs, atrq, atrs, it[OHCI_MAX_DMA_CH], ir[OHCI_MAX_DMA_CH];
|
||||
u_int maxrec;
|
||||
u_int32_t *cromptr;
|
||||
u_int32_t intmask;
|
||||
} fwohci_softc_t;
|
||||
void fwohci_intr __P((void *arg));
|
||||
int fwohci_init __P((struct fwohci_softc *, device_t));
|
||||
int fwohci_shutdown __P((device_t dev));
|
||||
@@ -1,92 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1998-2002 Katsushi Kobayashi and Hidetoshi Shimokawa
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the acknowledgement as bellow:
|
||||
*
|
||||
* This product includes software developed by K. Kobayashi and H. Shimokawa
|
||||
*
|
||||
* 4. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $FreeBSD$
|
||||
*
|
||||
*/
|
||||
#define CSRKEY_MVID 0x3
|
||||
#define CSRKEY_NCAP 0xc
|
||||
#define CSRKEY_NUNQ 0x8d
|
||||
#define CSRKEY_NPWR 0x30
|
||||
#define CSRKEY_SPEC 0x12
|
||||
#define CSRVAL_1394TA 0x00a02d
|
||||
#define CSRVAL_ANSIT10 0x00609e
|
||||
#define CSRKEY_VER 0x13
|
||||
#define CSR_PROTAVC 0x010001
|
||||
#define CSR_PROTCAL 0x010002
|
||||
#define CSR_PROTEHS 0x010004
|
||||
#define CSR_PROTHAVI 0x010008
|
||||
#define CSR_PROTCAM104 0x000100
|
||||
#define CSR_PROTCAM120 0x000101
|
||||
#define CSR_PROTCAM130 0x000102
|
||||
#define CSR_PROTDPP 0x0a6be2
|
||||
#define CSR_PROTIICP 0x4b661f
|
||||
|
||||
#define CSRVAL_T10SBP2 0x010483
|
||||
|
||||
struct csrreg {
|
||||
u_int32_t val:24,
|
||||
key:8;
|
||||
};
|
||||
struct csrhdr {
|
||||
u_int32_t crc:16,
|
||||
crc_len:8,
|
||||
info_len:8;
|
||||
};
|
||||
struct csrdirectory {
|
||||
u_int32_t crc:16,
|
||||
crc_len:16;
|
||||
struct csrreg entry[0];
|
||||
};
|
||||
struct csrtext {
|
||||
u_int32_t crc:16,
|
||||
crc_len:16;
|
||||
u_int32_t spec_id:16,
|
||||
spec_type:16;
|
||||
u_int32_t lang_id;
|
||||
u_int32_t text[0];
|
||||
};
|
||||
struct businfo {
|
||||
u_int32_t crc:16,
|
||||
crc_len:8,
|
||||
:12,
|
||||
max_rec:4,
|
||||
clk_acc:8,
|
||||
:4,
|
||||
bmc:1,
|
||||
isc:1,
|
||||
cmc:1,
|
||||
irmc:1;
|
||||
u_int32_t c_id_hi:8,
|
||||
v_id:24;
|
||||
u_int32_t c_id_lo;
|
||||
};
|
||||
@@ -1,74 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1998-2001 Katsushi Kobayashi and Hidetoshi Shimokawa
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the acknowledgement as bellow:
|
||||
*
|
||||
* This product includes software developed by K. Kobayashi and H. Shimokawa
|
||||
*
|
||||
* 4. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $FreeBSD$
|
||||
*
|
||||
*/
|
||||
struct ciphdr {
|
||||
#if BYTE_ORDER == LITTLE_ENDIAN
|
||||
u_int32_t src:8,
|
||||
len:8,
|
||||
dummy:8,
|
||||
dbc:8;
|
||||
u_int32_t :16,
|
||||
cyc:16;
|
||||
#else
|
||||
u_int32_t dbc:8,
|
||||
dummy:8,
|
||||
len:8,
|
||||
src:8;
|
||||
u_int32_t cyc:16,
|
||||
:16;
|
||||
#endif
|
||||
};
|
||||
struct dvdbc{
|
||||
#if BYTE_ORDER == BIG_ENDIAN
|
||||
u_int32_t :8,
|
||||
dbn:8,
|
||||
rsv0:3,
|
||||
z:1,
|
||||
dseq:4,
|
||||
seq:4,
|
||||
rsv1:1,
|
||||
sct:3;
|
||||
#else
|
||||
u_int32_t seq:4,
|
||||
:1,
|
||||
sct:3,
|
||||
:3,
|
||||
z:1,
|
||||
dseq:4,
|
||||
dbn:8,
|
||||
:8;
|
||||
#endif
|
||||
u_int32_t ld[19];
|
||||
};
|
||||
@@ -1,597 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2002
|
||||
* Hidetoshi Shimokawa. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
*
|
||||
* This product includes software developed by Hidetoshi Shimokawa.
|
||||
*
|
||||
* 4. Neither the name of the author nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
#include "opt_inet.h"
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/conf.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/mbuf.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/sockio.h>
|
||||
#include <sys/sysctl.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/module.h>
|
||||
#include <sys/bus.h>
|
||||
|
||||
#include <net/bpf.h>
|
||||
#include <net/ethernet.h>
|
||||
#include <net/if.h>
|
||||
#include <net/if_arp.h>
|
||||
#include <net/if_vlan_var.h>
|
||||
#include <net/route.h>
|
||||
|
||||
#include <netinet/in.h>
|
||||
|
||||
#include <dev/firewire/firewire.h>
|
||||
#include <dev/firewire/firewirereg.h>
|
||||
#include <dev/firewire/if_fwevar.h>
|
||||
|
||||
#define FWEDEBUG if (fwedebug) printf
|
||||
#define MAX_QUEUED IFQ_MAXLEN /* 50 */
|
||||
|
||||
/* network interface */
|
||||
static void fwe_start __P((struct ifnet *));
|
||||
static int fwe_ioctl __P((struct ifnet *, u_long, caddr_t));
|
||||
static void fwe_init __P((void *));
|
||||
|
||||
static void fwe_as_output __P((struct fwe_softc *, struct ifnet *));
|
||||
static void fwe_as_input __P((struct fw_xferq *));
|
||||
|
||||
static int fwedebug = 0;
|
||||
static int stream_ch = 1;
|
||||
|
||||
MALLOC_DECLARE(M_FWE);
|
||||
MALLOC_DEFINE(M_FWE, "if_fwe", "Ethernet over Firewire interface");
|
||||
SYSCTL_INT(_debug, OID_AUTO, if_fwe_debug, CTLFLAG_RW, &fwedebug, 0, "");
|
||||
SYSCTL_DECL(_hw_firewire);
|
||||
SYSCTL_NODE(_hw_firewire, OID_AUTO, fwe, CTLFLAG_RD, 0,
|
||||
"Ethernet Emulation Subsystem");
|
||||
SYSCTL_INT(_hw_firewire_fwe, OID_AUTO, stream_ch, CTLFLAG_RW, &stream_ch, 0,
|
||||
"Stream channel to use");
|
||||
|
||||
#ifdef DEVICE_POLLING
|
||||
#define FWE_POLL_REGISTER(func, fwe, ifp) \
|
||||
if (ether_poll_register(func, ifp)) { \
|
||||
struct firewire_comm *fc = (fwe)->fd.fc; \
|
||||
fc->set_intr(fc, 0); \
|
||||
}
|
||||
|
||||
#define FWE_POLL_DEREGISTER(fwe, ifp) \
|
||||
do { \
|
||||
struct firewire_comm *fc = (fwe)->fd.fc; \
|
||||
ether_poll_deregister(ifp); \
|
||||
fc->set_intr(fc, 1); \
|
||||
} while(0) \
|
||||
|
||||
static poll_handler_t fwe_poll;
|
||||
|
||||
static void
|
||||
fwe_poll(struct ifnet *ifp, enum poll_cmd cmd, int count)
|
||||
{
|
||||
struct fwe_softc *fwe;
|
||||
struct firewire_comm *fc;
|
||||
|
||||
fwe = ((struct fwe_eth_softc *)ifp->if_softc)->fwe;
|
||||
fc = fwe->fd.fc;
|
||||
if (cmd == POLL_DEREGISTER) {
|
||||
/* enable interrupts */
|
||||
fc->set_intr(fc, 1);
|
||||
return;
|
||||
}
|
||||
fc->poll(fc, (cmd == POLL_AND_CHECK_STATUS)?0:1, count);
|
||||
}
|
||||
#else
|
||||
#define FWE_POLL_REGISTER(func, fwe, ifp)
|
||||
#define FWE_POLL_DEREGISTER(fwe, ifp)
|
||||
#endif
|
||||
static void
|
||||
fwe_identify(driver_t *driver, device_t parent)
|
||||
{
|
||||
BUS_ADD_CHILD(parent, 0, "if_fwe", device_get_unit(parent));
|
||||
}
|
||||
|
||||
static int
|
||||
fwe_probe(device_t dev)
|
||||
{
|
||||
device_t pa;
|
||||
|
||||
pa = device_get_parent(dev);
|
||||
if(device_get_unit(dev) != device_get_unit(pa)){
|
||||
return(ENXIO);
|
||||
}
|
||||
|
||||
device_set_desc(dev, "Ethernet over Firewire");
|
||||
return (0);
|
||||
}
|
||||
|
||||
static int
|
||||
fwe_attach(device_t dev)
|
||||
{
|
||||
struct fwe_softc *fwe;
|
||||
struct ifnet *ifp;
|
||||
int unit, s;
|
||||
u_char *eaddr;
|
||||
|
||||
fwe = ((struct fwe_softc *)device_get_softc(dev));
|
||||
unit = device_get_unit(dev);
|
||||
|
||||
bzero(fwe, sizeof(struct fwe_softc));
|
||||
/* XXX */
|
||||
fwe->stream_ch = stream_ch;
|
||||
fwe->dma_ch = -1;
|
||||
|
||||
fwe->fd.fc = device_get_ivars(dev);
|
||||
fwe->fd.dev = dev;
|
||||
fwe->fd.post_explore = NULL;
|
||||
fwe->eth_softc.fwe = fwe;
|
||||
|
||||
fwe->pkt_hdr.mode.stream.tcode = FWTCODE_STREAM;
|
||||
fwe->pkt_hdr.mode.stream.sy = 0;
|
||||
fwe->pkt_hdr.mode.stream.chtag = fwe->stream_ch;
|
||||
|
||||
/* generate fake MAC address: first and last 3bytes from eui64 */
|
||||
#define LOCAL (0x02)
|
||||
#define GROUP (0x01)
|
||||
eaddr = &fwe->eth_softc.arpcom.ac_enaddr[0];
|
||||
eaddr[0] = (fwe->fd.fc->eui[0] | LOCAL) & ~GROUP;
|
||||
eaddr[1] = fwe->fd.fc->eui[1];
|
||||
eaddr[2] = fwe->fd.fc->eui[2];
|
||||
eaddr[3] = fwe->fd.fc->eui[5];
|
||||
eaddr[4] = fwe->fd.fc->eui[6];
|
||||
eaddr[5] = fwe->fd.fc->eui[7];
|
||||
printf("if_fwe%d: %02x:%02x:%02x:%02x:%02x:%02x\n", unit,
|
||||
eaddr[0], eaddr[1], eaddr[2], eaddr[3], eaddr[4], eaddr[5]);
|
||||
|
||||
/* fill the rest and attach interface */
|
||||
ifp = &fwe->fwe_if;
|
||||
ifp->if_softc = &fwe->eth_softc;
|
||||
|
||||
ifp->if_unit = unit;
|
||||
ifp->if_name = "fwe";
|
||||
ifp->if_init = fwe_init;
|
||||
ifp->if_output = ether_output;
|
||||
ifp->if_start = fwe_start;
|
||||
ifp->if_ioctl = fwe_ioctl;
|
||||
ifp->if_mtu = ETHERMTU;
|
||||
ifp->if_flags = (IFF_BROADCAST|IFF_SIMPLEX|IFF_MULTICAST);
|
||||
ifp->if_snd.ifq_maxlen = FWMAXQUEUE - 1;
|
||||
|
||||
s = splimp();
|
||||
ether_ifattach(ifp, 1);
|
||||
splx(s);
|
||||
|
||||
/* Tell the upper layer(s) we support long frames. */
|
||||
ifp->if_data.ifi_hdrlen = sizeof(struct ether_vlan_header);
|
||||
|
||||
ifp->if_snd.ifq_maxlen = MAX_QUEUED - 1;
|
||||
|
||||
FWEDEBUG("interface %s%d created.\n", ifp->if_name, ifp->if_unit);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
fwe_stop(struct fwe_softc *fwe)
|
||||
{
|
||||
struct firewire_comm *fc;
|
||||
struct fw_xferq *xferq;
|
||||
struct ifnet *ifp = &fwe->fwe_if;
|
||||
|
||||
fc = fwe->fd.fc;
|
||||
|
||||
FWE_POLL_DEREGISTER(fwe, ifp);
|
||||
|
||||
if (fwe->dma_ch >= 0) {
|
||||
xferq = fc->ir[fwe->dma_ch];
|
||||
|
||||
if (xferq->flag & FWXFERQ_RUNNING)
|
||||
fc->irx_disable(fc, fwe->dma_ch);
|
||||
xferq->flag &=
|
||||
~(FWXFERQ_MODEMASK | FWXFERQ_OPEN | FWXFERQ_HANDLER);
|
||||
/* XXX dequeue xferq->q */
|
||||
fwe->dma_ch = -1;
|
||||
}
|
||||
|
||||
ifp->if_flags &= ~(IFF_RUNNING | IFF_OACTIVE);
|
||||
}
|
||||
|
||||
static int
|
||||
fwe_detach(device_t dev)
|
||||
{
|
||||
struct fwe_softc *fwe;
|
||||
int s;
|
||||
|
||||
fwe = (struct fwe_softc *)device_get_softc(dev);
|
||||
s = splimp();
|
||||
|
||||
fwe_stop(fwe);
|
||||
ether_ifdetach(&fwe->fwe_if, 1);
|
||||
|
||||
splx(s);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
fwe_init(void *arg)
|
||||
{
|
||||
struct fwe_softc *fwe = ((struct fwe_eth_softc *)arg)->fwe;
|
||||
struct firewire_comm *fc;
|
||||
struct ifnet *ifp = &fwe->fwe_if;
|
||||
struct fw_xferq *xferq;
|
||||
int i;
|
||||
|
||||
FWEDEBUG("initializing %s%d\n", ifp->if_name, ifp->if_unit);
|
||||
|
||||
/* XXX keep promiscoud mode */
|
||||
ifp->if_flags |= IFF_PROMISC;
|
||||
|
||||
fc = fwe->fd.fc;
|
||||
#define START 0
|
||||
if (fwe->dma_ch < 0) {
|
||||
xferq = NULL;
|
||||
for (i = START; i < fc->nisodma; i ++) {
|
||||
xferq = fc->ir[i];
|
||||
if ((xferq->flag & FWXFERQ_OPEN) == 0)
|
||||
break;
|
||||
}
|
||||
|
||||
if (xferq == NULL) {
|
||||
printf("no free dma channel\n");
|
||||
return;
|
||||
}
|
||||
fwe->dma_ch = i;
|
||||
fwe->stream_ch = stream_ch;
|
||||
fwe->pkt_hdr.mode.stream.chtag = fwe->stream_ch;
|
||||
/* allocate DMA channel and init packet mode */
|
||||
xferq->flag |= FWXFERQ_OPEN | FWXFERQ_PACKET;
|
||||
xferq->flag |= fwe->stream_ch & 0xff;
|
||||
/* register fwe_input handler */
|
||||
xferq->sc = (caddr_t) fwe;
|
||||
xferq->hand = fwe_as_input;
|
||||
xferq->flag |= FWXFERQ_HANDLER;
|
||||
} else
|
||||
xferq = fc->ir[fwe->dma_ch];
|
||||
|
||||
|
||||
/* start dma */
|
||||
if ((xferq->flag & FWXFERQ_RUNNING) == 0)
|
||||
fc->irx_enable(fc, fwe->dma_ch);
|
||||
|
||||
ifp->if_flags |= IFF_RUNNING;
|
||||
ifp->if_flags &= ~IFF_OACTIVE;
|
||||
|
||||
FWE_POLL_REGISTER(fwe_poll, fwe, ifp);
|
||||
#if 0
|
||||
/* attempt to start output */
|
||||
fwe_start(ifp);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
fwe_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
|
||||
{
|
||||
struct fwe_softc *fwe = ((struct fwe_eth_softc *)ifp->if_softc)->fwe;
|
||||
struct ifstat *ifs = NULL;
|
||||
int s, error, len;
|
||||
|
||||
switch (cmd) {
|
||||
case SIOCSIFADDR:
|
||||
case SIOCGIFADDR:
|
||||
case SIOCSIFMTU:
|
||||
s = splimp();
|
||||
error = ether_ioctl(ifp, cmd, data);
|
||||
splx(s);
|
||||
return (error);
|
||||
case SIOCSIFFLAGS:
|
||||
s = splimp();
|
||||
if (ifp->if_flags & IFF_UP) {
|
||||
if (!(ifp->if_flags & IFF_RUNNING))
|
||||
fwe_init(&fwe->eth_softc);
|
||||
} else {
|
||||
if (ifp->if_flags & IFF_RUNNING)
|
||||
fwe_stop(fwe);
|
||||
}
|
||||
/* XXX keep promiscoud mode */
|
||||
ifp->if_flags |= IFF_PROMISC;
|
||||
splx(s);
|
||||
break;
|
||||
case SIOCADDMULTI:
|
||||
case SIOCDELMULTI:
|
||||
break;
|
||||
|
||||
case SIOCGIFSTATUS:
|
||||
s = splimp();
|
||||
ifs = (struct ifstat *)data;
|
||||
len = strlen(ifs->ascii);
|
||||
if (len < sizeof(ifs->ascii))
|
||||
snprintf(ifs->ascii + len,
|
||||
sizeof(ifs->ascii) - len,
|
||||
"\tch %d dma %d\n",
|
||||
fwe->stream_ch, fwe->dma_ch);
|
||||
splx(s);
|
||||
break;
|
||||
|
||||
default:
|
||||
return (EINVAL);
|
||||
}
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
static void
|
||||
fwe_start(struct ifnet *ifp)
|
||||
{
|
||||
struct fwe_softc *fwe = ((struct fwe_eth_softc *)ifp->if_softc)->fwe;
|
||||
int s;
|
||||
|
||||
#if 1
|
||||
FWEDEBUG("%s%d starting\n", ifp->if_name, ifp->if_unit);
|
||||
|
||||
if (fwe->dma_ch < 0) {
|
||||
struct mbuf *m = NULL;
|
||||
|
||||
FWEDEBUG("%s%d not ready.\n", ifp->if_name, ifp->if_unit);
|
||||
|
||||
s = splimp();
|
||||
do {
|
||||
IF_DEQUEUE(&ifp->if_snd, m);
|
||||
if (m != NULL)
|
||||
m_freem(m);
|
||||
ifp->if_oerrors ++;
|
||||
} while (m != NULL);
|
||||
splx(s);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
#endif
|
||||
s = splimp();
|
||||
ifp->if_flags |= IFF_OACTIVE;
|
||||
|
||||
if (ifp->if_snd.ifq_len != 0)
|
||||
fwe_as_output(fwe, ifp);
|
||||
|
||||
ifp->if_flags &= ~IFF_OACTIVE;
|
||||
splx(s);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
fwe_output_callback(struct fw_xfer *xfer)
|
||||
{
|
||||
struct fwe_softc *fwe;
|
||||
struct ifnet *ifp;
|
||||
|
||||
fwe = (struct fwe_softc *)xfer->sc;
|
||||
/* XXX error check */
|
||||
FWEDEBUG("resp = %d\n", xfer->resp);
|
||||
m_freem(xfer->mbuf);
|
||||
xfer->send.buf = NULL;
|
||||
fw_xfer_free(xfer);
|
||||
#if 1
|
||||
/* XXX for queue full */
|
||||
ifp = &fwe->fwe_if;
|
||||
if (ifp->if_snd.ifq_head != NULL)
|
||||
fwe_start(ifp);
|
||||
#endif
|
||||
}
|
||||
|
||||
#define HDR_LEN 4
|
||||
#define ALIGN_PAD 2
|
||||
/* Async. stream output */
|
||||
static void
|
||||
fwe_as_output(struct fwe_softc *fwe, struct ifnet *ifp)
|
||||
{
|
||||
struct mbuf *m;
|
||||
struct fw_xfer *xfer;
|
||||
struct fw_xferq *xferq;
|
||||
struct fw_pkt *fp;
|
||||
int i = 0;
|
||||
|
||||
xfer = NULL;
|
||||
xferq = fwe->fd.fc->atq;
|
||||
while (xferq->queued < xferq->maxq) {
|
||||
IF_DEQUEUE(&ifp->if_snd, m);
|
||||
if (m == NULL)
|
||||
break;
|
||||
xfer = fw_xfer_alloc();
|
||||
if (xfer == NULL) {
|
||||
return;
|
||||
}
|
||||
if (ifp->if_bpf != NULL)
|
||||
bpf_mtap(ifp, m);
|
||||
|
||||
xfer->send.off = 0;
|
||||
xfer->spd = 2;
|
||||
xfer->fc = fwe->fd.fc;
|
||||
xfer->retry_req = fw_asybusy;
|
||||
xfer->sc = (caddr_t)fwe;
|
||||
xfer->act.hand = fwe_output_callback;
|
||||
|
||||
/* keep ip packet alignment for alpha */
|
||||
M_PREPEND(m, ALIGN_PAD, M_DONTWAIT);
|
||||
fp = (struct fw_pkt *)&xfer->dst; /* XXX */
|
||||
xfer->dst = *((int32_t *)&fwe->pkt_hdr);
|
||||
fp->mode.stream.len = htons(m->m_pkthdr.len);
|
||||
xfer->send.buf = (caddr_t) fp;
|
||||
xfer->mbuf = m;
|
||||
xfer->send.len = m->m_pkthdr.len + HDR_LEN;
|
||||
|
||||
i++;
|
||||
if (fw_asyreq(xfer->fc, -1, xfer) != 0) {
|
||||
/* error */
|
||||
ifp->if_oerrors ++;
|
||||
/* XXX set error code */
|
||||
fwe_output_callback(xfer);
|
||||
} else {
|
||||
ifp->if_opackets ++;
|
||||
}
|
||||
}
|
||||
#if 0
|
||||
if (i > 1)
|
||||
printf("%d queued\n", i);
|
||||
#endif
|
||||
if (xfer != NULL)
|
||||
xferq->start(xfer->fc);
|
||||
}
|
||||
|
||||
#if __FreeBSD_version >= 500000
|
||||
static void
|
||||
fwe_free(void *buf, void *args)
|
||||
{
|
||||
FWEDEBUG("fwe_free:\n");
|
||||
free(buf, M_DEVBUF);
|
||||
}
|
||||
|
||||
#else
|
||||
static void
|
||||
fwe_free(caddr_t buf, u_int size)
|
||||
{
|
||||
int *p;
|
||||
FWEDEBUG("fwe_free:\n");
|
||||
p = (int *)buf;
|
||||
(*p) --;
|
||||
if (*p < 1)
|
||||
free(buf, M_DEVBUF);
|
||||
}
|
||||
|
||||
static void
|
||||
fwe_ref(caddr_t buf, u_int size)
|
||||
{
|
||||
int *p;
|
||||
|
||||
FWEDEBUG("fwe_ref: called\n");
|
||||
p = (int *)buf;
|
||||
(*p) ++;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Async. stream output */
|
||||
static void
|
||||
fwe_as_input(struct fw_xferq *xferq)
|
||||
{
|
||||
struct mbuf *m;
|
||||
struct ether_header *eh;
|
||||
struct ifnet *ifp;
|
||||
struct fw_xfer *xfer;
|
||||
struct fwe_softc *fwe;
|
||||
u_char *c;
|
||||
int len;
|
||||
caddr_t p;
|
||||
|
||||
fwe = (struct fwe_softc *)xferq->sc;
|
||||
ifp = &fwe->fwe_if;
|
||||
#if 0
|
||||
FWE_POLL_REGISTER(fwe_poll, fwe, ifp);
|
||||
#endif
|
||||
while ((xfer = STAILQ_FIRST(&xferq->q)) != NULL) {
|
||||
STAILQ_REMOVE_HEAD(&xferq->q, link);
|
||||
xferq->queued --;
|
||||
MGETHDR(m, M_DONTWAIT, MT_DATA);
|
||||
if (m == NULL) {
|
||||
printf("MGETHDR failed\n");
|
||||
fw_xfer_free(xfer);
|
||||
return;
|
||||
}
|
||||
len = xfer->recv.off + xfer->recv.len;
|
||||
FWEDEBUG("fwe_as_input len=%d\n", len);
|
||||
#if __FreeBSD_version >= 500000
|
||||
MEXTADD(m, xfer->recv.buf, len, fwe_free, NULL, 0, EXT_NET_DRV);
|
||||
#else
|
||||
m->m_flags |= M_EXT;
|
||||
m->m_ext.ext_buf = xfer->recv.buf;
|
||||
m->m_ext.ext_size = len;
|
||||
m->m_ext.ext_free = fwe_free;
|
||||
m->m_ext.ext_ref = fwe_ref;
|
||||
*((int *)m->m_ext.ext_buf) = 1; /* XXX refcount */
|
||||
#endif
|
||||
p = xfer->recv.buf + xfer->recv.off + HDR_LEN + ALIGN_PAD;
|
||||
eh = (struct ether_header *)p;
|
||||
p += sizeof(struct ether_header);
|
||||
len -= xfer->recv.off + HDR_LEN + ALIGN_PAD
|
||||
+ sizeof(struct ether_header);
|
||||
m->m_data = p;
|
||||
m->m_len = m->m_pkthdr.len = len;
|
||||
m->m_pkthdr.rcvif = ifp;
|
||||
c = (char *)eh;
|
||||
#if 0
|
||||
FWEDEBUG("%02x %02x %02x %02x %02x %02x\n"
|
||||
"%02x %02x %02x %02x %02x %02x\n"
|
||||
"%02x %02x %02x %02x\n"
|
||||
"%02x %02x %02x %02x\n"
|
||||
"%02x %02x %02x %02x\n"
|
||||
"%02x %02x %02x %02x\n",
|
||||
c[0], c[1], c[2], c[3], c[4], c[5],
|
||||
c[6], c[7], c[8], c[9], c[10], c[11],
|
||||
c[12], c[13], c[14], c[15],
|
||||
c[16], c[17], c[18], c[19],
|
||||
c[20], c[21], c[22], c[23],
|
||||
c[20], c[21], c[22], c[23]
|
||||
);
|
||||
#endif
|
||||
ether_input(ifp, eh, m);
|
||||
ifp->if_ipackets ++;
|
||||
|
||||
xfer->recv.buf = NULL;
|
||||
fw_xfer_free(xfer);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static devclass_t fwe_devclass;
|
||||
|
||||
static device_method_t fwe_methods[] = {
|
||||
/* device interface */
|
||||
DEVMETHOD(device_identify, fwe_identify),
|
||||
DEVMETHOD(device_probe, fwe_probe),
|
||||
DEVMETHOD(device_attach, fwe_attach),
|
||||
DEVMETHOD(device_detach, fwe_detach),
|
||||
{ 0, 0 }
|
||||
};
|
||||
|
||||
static driver_t fwe_driver = {
|
||||
"if_fwe",
|
||||
fwe_methods,
|
||||
sizeof(struct fwe_softc),
|
||||
};
|
||||
|
||||
|
||||
DRIVER_MODULE(if_fwe, firewire, fwe_driver, fwe_devclass, 0, 0);
|
||||
MODULE_VERSION(if_fwe, 1);
|
||||
MODULE_DEPEND(if_fwe, firewire, 1, 1, 1);
|
||||
@@ -1,53 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2002
|
||||
* Hidetoshi Shimokawa. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
*
|
||||
* This product includes software developed by Hidetoshi Shimokawa.
|
||||
*
|
||||
* 4. Neither the name of the author nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
#ifndef _NET_IF_FWEVAR_H_
|
||||
#define _NET_IF_FWEVAR_H_
|
||||
|
||||
struct fwe_softc {
|
||||
/* XXX this must be first for fd.post_explore() */
|
||||
struct firewire_dev_comm fd;
|
||||
short stream_ch;
|
||||
short dma_ch;
|
||||
struct fw_pkt pkt_hdr;
|
||||
struct fwe_eth_softc {
|
||||
/* XXX this must be first for if_ethersub.c */
|
||||
struct arpcom arpcom; /* ethernet common data */
|
||||
#define fwe_if eth_softc.arpcom.ac_if
|
||||
struct fwe_softc *fwe;
|
||||
} eth_softc;
|
||||
};
|
||||
#endif /* !_NET_IF_FWEVAR_H_ */
|
||||
@@ -1,82 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2000,2001 Jonathan Chen.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions, and the following disclaimer,
|
||||
* without modification, immediately at the beginning of the file.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Register definitions for TDK 78Q2120
|
||||
*/
|
||||
|
||||
#ifndef _DEV_MII_TDKPHYREG_H_
|
||||
#define _DEV_MII_TDKPHYREG_H_
|
||||
|
||||
#define MII_VENDOR 16
|
||||
#define VENDOR_RXCC 0x0001
|
||||
#define VENDOR_PCSBP 0x0002
|
||||
#define VENDOR_RVSPOL 0x0010
|
||||
#define VENDOR_NOAPOL 0x0020
|
||||
#define VENDOR_GPIO0DIR 0x0040
|
||||
#define VENDOR_GPIO0DAT 0x0080
|
||||
#define VENDOR_GPIO1DIR 0x0100
|
||||
#define VENDOR_GPIO1DAT 0x0200
|
||||
#define VENDOR_10BTLOOP 0x0400
|
||||
#define VENDOR_NOSQE 0x0800
|
||||
#define VENDOR_TXHIM 0x1000
|
||||
#define VENDOR_INTLVL 0x4000
|
||||
#define VENDOR_RPTR 0x8000
|
||||
|
||||
#define MII_INT 17
|
||||
#define INT_STAT_MASK 0x00ff
|
||||
#define INT_STAT_ACOMP 0x0001
|
||||
#define INT_STAT_RFAULT 0x0002
|
||||
#define INT_STAT_LSCHG 0x0004
|
||||
#define INT_STAT_LPACK 0x0008
|
||||
#define INT_STAT_PDF 0x0010
|
||||
#define INT_STAT_PRX 0x0020
|
||||
#define INT_STAT_RXERR 0x0040
|
||||
#define INT_STAT_JABBER 0x0080
|
||||
#define INT_CTRL_MASK 0xff00
|
||||
#define INT_CTRL_ACOMP 0x0100
|
||||
#define INT_CTRL_RFAULT 0x0200
|
||||
#define INT_CTRL_LSCHG 0x0400
|
||||
#define INT_CTRL_LPACK 0x0800
|
||||
#define INT_CTRL_PDF 0x1000
|
||||
#define INT_CTRL_PRX 0x2000
|
||||
#define INT_CTRL_RXERR 0x4000
|
||||
#define INT_CTRL_JABBER 0x8000
|
||||
|
||||
|
||||
#define MII_DIAG 18
|
||||
#define DIAG_RLOCK 0x0100
|
||||
#define DIAG_RPASS 0x0200
|
||||
#define DIAG_RATE_100 0x0400
|
||||
#define DIAG_DUPLEX 0x0800
|
||||
#define DIAG_NEGFAIL 0x1000
|
||||
|
||||
|
||||
#endif
|
||||
@@ -1,348 +0,0 @@
|
||||
/* $NetBSD: uftdireg.h,v 1.6 2002/07/11 21:14:28 augustss Exp $ */
|
||||
/* $FreeBSD$ */
|
||||
|
||||
/*
|
||||
* Definitions for the FTDI USB Single Port Serial Converter -
|
||||
* known as FTDI_SIO (Serial Input/Output application of the chipset)
|
||||
*
|
||||
* The device is based on the FTDI FT8U100AX chip. It has a DB25 on one side,
|
||||
* USB on the other.
|
||||
*
|
||||
* Thanx to FTDI (http://www.ftdi.co.uk) for so kindly providing details
|
||||
* of the protocol required to talk to the device and ongoing assistence
|
||||
* during development.
|
||||
*
|
||||
* Bill Ryder - bryder@sgi.com of Silicon Graphics, Inc. is the original
|
||||
* author of this file.
|
||||
*/
|
||||
/* Modified by Lennart Augustsson */
|
||||
|
||||
/* Vendor Request Interface */
|
||||
#define FTDI_SIO_RESET 0 /* Reset the port */
|
||||
#define FTDI_SIO_MODEM_CTRL 1 /* Set the modem control register */
|
||||
#define FTDI_SIO_SET_FLOW_CTRL 2 /* Set flow control register */
|
||||
#define FTDI_SIO_SET_BAUD_RATE 3 /* Set baud rate */
|
||||
#define FTDI_SIO_SET_DATA 4 /* Set the data characteristics of the port */
|
||||
#define FTDI_SIO_GET_STATUS 5 /* Retrieve current value of status reg */
|
||||
#define FTDI_SIO_SET_EVENT_CHAR 6 /* Set the event character */
|
||||
#define FTDI_SIO_SET_ERROR_CHAR 7 /* Set the error character */
|
||||
|
||||
/* Port Identifier Table */
|
||||
#define FTDI_PIT_DEFAULT 0 /* SIOA */
|
||||
#define FTDI_PIT_SIOA 1 /* SIOA */
|
||||
#define FTDI_PIT_SIOB 2 /* SIOB */
|
||||
#define FTDI_PIT_PARALLEL 3 /* Parallel */
|
||||
|
||||
enum uftdi_type {
|
||||
UFTDI_TYPE_SIO,
|
||||
UFTDI_TYPE_8U232AM
|
||||
};
|
||||
|
||||
/*
|
||||
* BmRequestType: 0100 0000B
|
||||
* bRequest: FTDI_SIO_RESET
|
||||
* wValue: Control Value
|
||||
* 0 = Reset SIO
|
||||
* 1 = Purge RX buffer
|
||||
* 2 = Purge TX buffer
|
||||
* wIndex: Port
|
||||
* wLength: 0
|
||||
* Data: None
|
||||
*
|
||||
* The Reset SIO command has this effect:
|
||||
*
|
||||
* Sets flow control set to 'none'
|
||||
* Event char = 0x0d
|
||||
* Event trigger = disabled
|
||||
* Purge RX buffer
|
||||
* Purge TX buffer
|
||||
* Clear DTR
|
||||
* Clear RTS
|
||||
* baud and data format not reset
|
||||
*
|
||||
* The Purge RX and TX buffer commands affect nothing except the buffers
|
||||
*
|
||||
*/
|
||||
/* FTDI_SIO_RESET */
|
||||
#define FTDI_SIO_RESET_SIO 0
|
||||
#define FTDI_SIO_RESET_PURGE_RX 1
|
||||
#define FTDI_SIO_RESET_PURGE_TX 2
|
||||
|
||||
|
||||
/*
|
||||
* BmRequestType: 0100 0000B
|
||||
* bRequest: FTDI_SIO_SET_BAUDRATE
|
||||
* wValue: BaudRate value - see below
|
||||
* wIndex: Port
|
||||
* wLength: 0
|
||||
* Data: None
|
||||
*/
|
||||
/* FTDI_SIO_SET_BAUDRATE */
|
||||
enum {
|
||||
ftdi_sio_b300 = 0,
|
||||
ftdi_sio_b600 = 1,
|
||||
ftdi_sio_b1200 = 2,
|
||||
ftdi_sio_b2400 = 3,
|
||||
ftdi_sio_b4800 = 4,
|
||||
ftdi_sio_b9600 = 5,
|
||||
ftdi_sio_b19200 = 6,
|
||||
ftdi_sio_b38400 = 7,
|
||||
ftdi_sio_b57600 = 8,
|
||||
ftdi_sio_b115200 = 9
|
||||
};
|
||||
|
||||
enum {
|
||||
ftdi_8u232am_b300 = 0x2710,
|
||||
ftdi_8u232am_b600 = 0x1388,
|
||||
ftdi_8u232am_b1200 = 0x09c4,
|
||||
ftdi_8u232am_b2400 = 0x04e2,
|
||||
ftdi_8u232am_b4800 = 0x0271,
|
||||
ftdi_8u232am_b9600 = 0x4138,
|
||||
ftdi_8u232am_b19200 = 0x809c,
|
||||
ftdi_8u232am_b38400 = 0xc04e,
|
||||
ftdi_8u232am_b57600 = 0x0034,
|
||||
ftdi_8u232am_b115200 = 0x001a,
|
||||
ftdi_8u232am_b230400 = 0x000d,
|
||||
ftdi_8u232am_b460800 = 0x4006,
|
||||
ftdi_8u232am_b921600 = 0x8003
|
||||
};
|
||||
|
||||
/*
|
||||
* BmRequestType: 0100 0000B
|
||||
* bRequest: FTDI_SIO_SET_DATA
|
||||
* wValue: Data characteristics (see below)
|
||||
* wIndex: Port
|
||||
* wLength: 0
|
||||
* Data: No
|
||||
*
|
||||
* Data characteristics
|
||||
*
|
||||
* B0..7 Number of data bits
|
||||
* B8..10 Parity
|
||||
* 0 = None
|
||||
* 1 = Odd
|
||||
* 2 = Even
|
||||
* 3 = Mark
|
||||
* 4 = Space
|
||||
* B11..13 Stop Bits
|
||||
* 0 = 1
|
||||
* 1 = 1.5
|
||||
* 2 = 2
|
||||
* B14..15 Reserved
|
||||
*
|
||||
*/
|
||||
/* FTDI_SIO_SET_DATA */
|
||||
#define FTDI_SIO_SET_DATA_BITS(n) (n)
|
||||
#define FTDI_SIO_SET_DATA_PARITY_NONE (0x0 << 8)
|
||||
#define FTDI_SIO_SET_DATA_PARITY_ODD (0x1 << 8)
|
||||
#define FTDI_SIO_SET_DATA_PARITY_EVEN (0x2 << 8)
|
||||
#define FTDI_SIO_SET_DATA_PARITY_MARK (0x3 << 8)
|
||||
#define FTDI_SIO_SET_DATA_PARITY_SPACE (0x4 << 8)
|
||||
#define FTDI_SIO_SET_DATA_STOP_BITS_1 (0x0 << 11)
|
||||
#define FTDI_SIO_SET_DATA_STOP_BITS_15 (0x1 << 11)
|
||||
#define FTDI_SIO_SET_DATA_STOP_BITS_2 (0x2 << 11)
|
||||
#define FTDI_SIO_SET_BREAK (0x1 << 14)
|
||||
|
||||
|
||||
/*
|
||||
* BmRequestType: 0100 0000B
|
||||
* bRequest: FTDI_SIO_MODEM_CTRL
|
||||
* wValue: ControlValue (see below)
|
||||
* wIndex: Port
|
||||
* wLength: 0
|
||||
* Data: None
|
||||
*
|
||||
* NOTE: If the device is in RTS/CTS flow control, the RTS set by this
|
||||
* command will be IGNORED without an error being returned
|
||||
* Also - you can not set DTR and RTS with one control message
|
||||
*
|
||||
* ControlValue
|
||||
* B0 DTR state
|
||||
* 0 = reset
|
||||
* 1 = set
|
||||
* B1 RTS state
|
||||
* 0 = reset
|
||||
* 1 = set
|
||||
* B2..7 Reserved
|
||||
* B8 DTR state enable
|
||||
* 0 = ignore
|
||||
* 1 = use DTR state
|
||||
* B9 RTS state enable
|
||||
* 0 = ignore
|
||||
* 1 = use RTS state
|
||||
* B10..15 Reserved
|
||||
*/
|
||||
/* FTDI_SIO_MODEM_CTRL */
|
||||
#define FTDI_SIO_SET_DTR_MASK 0x1
|
||||
#define FTDI_SIO_SET_DTR_HIGH (1 | ( FTDI_SIO_SET_DTR_MASK << 8))
|
||||
#define FTDI_SIO_SET_DTR_LOW (0 | ( FTDI_SIO_SET_DTR_MASK << 8))
|
||||
#define FTDI_SIO_SET_RTS_MASK 0x2
|
||||
#define FTDI_SIO_SET_RTS_HIGH (2 | ( FTDI_SIO_SET_RTS_MASK << 8))
|
||||
#define FTDI_SIO_SET_RTS_LOW (0 | ( FTDI_SIO_SET_RTS_MASK << 8))
|
||||
|
||||
|
||||
/*
|
||||
* BmRequestType: 0100 0000b
|
||||
* bRequest: FTDI_SIO_SET_FLOW_CTRL
|
||||
* wValue: Xoff/Xon
|
||||
* wIndex: Protocol/Port - hIndex is protocl / lIndex is port
|
||||
* wLength: 0
|
||||
* Data: None
|
||||
*
|
||||
* hIndex protocol is:
|
||||
* B0 Output handshaking using RTS/CTS
|
||||
* 0 = disabled
|
||||
* 1 = enabled
|
||||
* B1 Output handshaking using DTR/DSR
|
||||
* 0 = disabled
|
||||
* 1 = enabled
|
||||
* B2 Xon/Xoff handshaking
|
||||
* 0 = disabled
|
||||
* 1 = enabled
|
||||
*
|
||||
* A value of zero in the hIndex field disables handshaking
|
||||
*
|
||||
* If Xon/Xoff handshaking is specified, the hValue field should contain the
|
||||
* XOFF character and the lValue field contains the XON character.
|
||||
*/
|
||||
/* FTDI_SIO_SET_FLOW_CTRL */
|
||||
#define FTDI_SIO_DISABLE_FLOW_CTRL 0x0
|
||||
#define FTDI_SIO_RTS_CTS_HS 0x1
|
||||
#define FTDI_SIO_DTR_DSR_HS 0x2
|
||||
#define FTDI_SIO_XON_XOFF_HS 0x4
|
||||
|
||||
|
||||
/*
|
||||
* BmRequestType: 0100 0000b
|
||||
* bRequest: FTDI_SIO_SET_EVENT_CHAR
|
||||
* wValue: Event Char
|
||||
* wIndex: Port
|
||||
* wLength: 0
|
||||
* Data: None
|
||||
*
|
||||
* wValue:
|
||||
* B0..7 Event Character
|
||||
* B8 Event Character Processing
|
||||
* 0 = disabled
|
||||
* 1 = enabled
|
||||
* B9..15 Reserved
|
||||
*
|
||||
* FTDI_SIO_SET_EVENT_CHAR
|
||||
*
|
||||
* Set the special event character for the specified communications port.
|
||||
* If the device sees this character it will immediately return the
|
||||
* data read so far - rather than wait 40ms or until 62 bytes are read
|
||||
* which is what normally happens.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* BmRequestType: 0100 0000b
|
||||
* bRequest: FTDI_SIO_SET_ERROR_CHAR
|
||||
* wValue: Error Char
|
||||
* wIndex: Port
|
||||
* wLength: 0
|
||||
* Data: None
|
||||
*
|
||||
* Error Char
|
||||
* B0..7 Error Character
|
||||
* B8 Error Character Processing
|
||||
* 0 = disabled
|
||||
* 1 = enabled
|
||||
* B9..15 Reserved
|
||||
*
|
||||
*
|
||||
* FTDI_SIO_SET_ERROR_CHAR
|
||||
* Set the parity error replacement character for the specified communications
|
||||
* port.
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* BmRequestType: 1100 0000b
|
||||
* bRequest: FTDI_SIO_GET_MODEM_STATUS
|
||||
* wValue: zero
|
||||
* wIndex: Port
|
||||
* wLength: 1
|
||||
* Data: Status
|
||||
*
|
||||
* One byte of data is returned
|
||||
* B0..3 0
|
||||
* B4 CTS
|
||||
* 0 = inactive
|
||||
* 1 = active
|
||||
* B5 DSR
|
||||
* 0 = inactive
|
||||
* 1 = active
|
||||
* B6 Ring Indicator (RI)
|
||||
* 0 = inactive
|
||||
* 1 = active
|
||||
* B7 Receive Line Signal Detect (RLSD)
|
||||
* 0 = inactive
|
||||
* 1 = active
|
||||
*
|
||||
* FTDI_SIO_GET_MODEM_STATUS
|
||||
* Retrieve the current value of the modem status register.
|
||||
*/
|
||||
#define FTDI_SIO_CTS_MASK 0x10
|
||||
#define FTDI_SIO_DSR_MASK 0x20
|
||||
#define FTDI_SIO_RI_MASK 0x40
|
||||
#define FTDI_SIO_RLSD_MASK 0x80
|
||||
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
* DATA FORMAT
|
||||
*
|
||||
* IN Endpoint
|
||||
*
|
||||
* The device reserves the first two bytes of data on this endpoint to contain
|
||||
* the current values of the modem and line status registers. In the absence of
|
||||
* data, the device generates a message consisting of these two status bytes
|
||||
* every 40 ms.
|
||||
*
|
||||
* Byte 0: Modem Status
|
||||
* NOTE: 4 upper bits have same layout as the MSR register in a 16550
|
||||
*
|
||||
* Offset Description
|
||||
* B0..3 Port
|
||||
* B4 Clear to Send (CTS)
|
||||
* B5 Data Set Ready (DSR)
|
||||
* B6 Ring Indicator (RI)
|
||||
* B7 Receive Line Signal Detect (RLSD)
|
||||
*
|
||||
* Byte 1: Line Status
|
||||
* NOTE: same layout as the LSR register in a 16550
|
||||
*
|
||||
* Offset Description
|
||||
* B0 Data Ready (DR)
|
||||
* B1 Overrun Error (OE)
|
||||
* B2 Parity Error (PE)
|
||||
* B3 Framing Error (FE)
|
||||
* B4 Break Interrupt (BI)
|
||||
* B5 Transmitter Holding Register (THRE)
|
||||
* B6 Transmitter Empty (TEMT)
|
||||
* B7 Error in RCVR FIFO
|
||||
*
|
||||
*
|
||||
* OUT Endpoint
|
||||
*
|
||||
* This device reserves the first bytes of data on this endpoint contain the
|
||||
* length and port identifier of the message. For the FTDI USB Serial converter
|
||||
* the port identifier is always 1.
|
||||
*
|
||||
* Byte 0: Port & length
|
||||
*
|
||||
* Offset Description
|
||||
* B0..1 Port
|
||||
* B2..7 Length of message - (not including Byte 0)
|
||||
*
|
||||
*/
|
||||
#define FTDI_PORT_MASK 0x0f
|
||||
#define FTDI_MSR_MASK 0xf0
|
||||
#define FTDI_GET_MSR(p) (((p)[0]) & FTDI_MSR_MASK)
|
||||
#define FTDI_GET_LSR(p) ((p)[1])
|
||||
#define FTDI_LSR_MASK (~0x60) /* interesting bits */
|
||||
#define FTDI_OUT_TAG(len, port) (((len) << 2) | (port))
|
||||
@@ -1,92 +0,0 @@
|
||||
/* $NetBSD: usb/ugraphire_rdesc.h,v 1.1 2000/12/29 01:47:49 augustss Exp $ */
|
||||
/* $FreeBSD$ */
|
||||
/*
|
||||
* Copyright (c) 2000 Nick Hibma <n_hibma@freebsd.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
static uByte uhid_graphire_report_descr[] = {
|
||||
0x05, 0x0d, /* USAGE_PAGE (Digitizers) */
|
||||
0x09, 0x01, /* USAGE (Digitizer) */
|
||||
0xa1, 0x01, /* COLLECTION (Application) */
|
||||
0x85, 0x02, /* REPORT_ID (2) */
|
||||
0x05, 0x0d, /* USAGE_PAGE (Digitizers) */
|
||||
0x09, 0x01, /* USAGE (Digitizer) */
|
||||
0xa1, 0x00, /* COLLECTION (Physical) */
|
||||
0x15, 0x00, /* LOGICAL_MINIMUM (0) */
|
||||
0x25, 0x01, /* LOGICAL_MAXIMUM (1) */
|
||||
0x09, 0x33, /* USAGE (Touch) */
|
||||
0x95, 0x01, /* REPORT_COUNT (1) */
|
||||
0x75, 0x01, /* REPORT_SIZE (1) */
|
||||
0x81, 0x02, /* INPUT (Data,Var,Abs) */
|
||||
0x09, 0x44, /* USAGE (Barrel Switch) */
|
||||
0x95, 0x02, /* REPORT_COUNT (2) */
|
||||
0x75, 0x01, /* REPORT_SIZE (1) */
|
||||
0x81, 0x02, /* INPUT (Data,Var,Abs) */
|
||||
0x09, 0x00, /* USAGE (Undefined) */
|
||||
0x95, 0x02, /* REPORT_COUNT (2) */
|
||||
0x75, 0x01, /* REPORT_SIZE (1) */
|
||||
0x81, 0x03, /* INPUT (Cnst,Var,Abs) */
|
||||
0x09, 0x3c, /* USAGE (Invert) */
|
||||
0x95, 0x01, /* REPORT_COUNT (1) */
|
||||
0x75, 0x01, /* REPORT_SIZE (1) */
|
||||
0x81, 0x02, /* INPUT (Data,Var,Abs) */
|
||||
0x09, 0x38, /* USAGE (Transducer Index) */
|
||||
0x95, 0x01, /* REPORT_COUNT (1) */
|
||||
0x75, 0x01, /* REPORT_SIZE (1) */
|
||||
0x81, 0x02, /* INPUT (Data,Var,Abs) */
|
||||
0x09, 0x32, /* USAGE (In Range) */
|
||||
0x95, 0x01, /* REPORT_COUNT (1) */
|
||||
0x75, 0x01, /* REPORT_SIZE (1) */
|
||||
0x81, 0x02, /* INPUT (Data,Var,Abs) */
|
||||
0x05, 0x01, /* USAGE_PAGE (Generic Desktop) */
|
||||
0x09, 0x30, /* USAGE (X) */
|
||||
0x15, 0x00, /* LOGICAL_MINIMUM (0) */
|
||||
0x26, 0xde, 0x27, /* LOGICAL_MAXIMUM (10206) */
|
||||
0x95, 0x01, /* REPORT_COUNT (1) */
|
||||
0x75, 0x10, /* REPORT_SIZE (16) */
|
||||
0x81, 0x02, /* INPUT (Data,Var,Abs) */
|
||||
0x09, 0x31, /* USAGE (Y) */
|
||||
0x26, 0xfe, 0x1c, /* LOGICAL_MAXIMUM (7422) */
|
||||
0x95, 0x01, /* REPORT_COUNT (1) */
|
||||
0x75, 0x10, /* REPORT_SIZE (16) */
|
||||
0x81, 0x02, /* INPUT (Data,Var,Abs) */
|
||||
0x05, 0x0d, /* USAGE_PAGE (Digitizers) */
|
||||
0x09, 0x30, /* USAGE (Tip Pressure) */
|
||||
0x26, 0xff, 0x01, /* LOGICAL_MAXIMUM (511) */
|
||||
0x95, 0x01, /* REPORT_COUNT (1) */
|
||||
0x75, 0x10, /* REPORT_SIZE (16) */
|
||||
0x81, 0x02, /* INPUT (Data,Var,Abs) */
|
||||
0xc0, /* END_COLLECTION */
|
||||
0x05, 0x0d, /* USAGE_PAGE (Digitizers) */
|
||||
0x09, 0x00, /* USAGE (Undefined) */
|
||||
0x85, 0x02, /* REPORT_ID (2) */
|
||||
0x95, 0x01, /* REPORT_COUNT (1) */
|
||||
0xb1, 0x02, /* FEATURE (Data,Var,Abs) */
|
||||
0x09, 0x00, /* USAGE (Undefined) */
|
||||
0x85, 0x03, /* REPORT_ID (3) */
|
||||
0x95, 0x01, /* REPORT_COUNT (1) */
|
||||
0xb1, 0x02, /* FEATURE (Data,Var,Abs) */
|
||||
0xc0, /* END_COLLECTION */
|
||||
};
|
||||
@@ -1,25 +0,0 @@
|
||||
# $FreeBSD$
|
||||
|
||||
# Correct path for kernel builds
|
||||
# Don't rely on the kernel's .depend file
|
||||
.ifdef MAKESRCPATH
|
||||
.PATH: ${MAKESRCPATH}
|
||||
DEPENDFILE=
|
||||
.else
|
||||
MAKESRCPATH= ${.CURDIR}
|
||||
CLEANFILES= acpi_wakecode.h acpi_wakecode.bin acpi_wakecode.o
|
||||
.endif
|
||||
CFLAGS+= -I.
|
||||
|
||||
all: acpi_wakecode.h
|
||||
|
||||
acpi_wakecode.o: acpi_wakecode.S
|
||||
|
||||
acpi_wakecode.bin: acpi_wakecode.o
|
||||
objcopy -S -O binary acpi_wakecode.o acpi_wakecode.bin
|
||||
|
||||
acpi_wakecode.h: acpi_wakecode.bin acpi_wakecode.o
|
||||
sh ${MAKESRCPATH}/genwakecode.sh > acpi_wakecode.h
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
#!/bin/sh
|
||||
# $FreeBSD$
|
||||
#
|
||||
echo 'static char wakecode[] = {';
|
||||
hexdump -Cv acpi_wakecode.bin | \
|
||||
sed -e 's/^[0-9a-f][0-9a-f]*//' -e 's/\|.*$//' | \
|
||||
while read line
|
||||
do
|
||||
for code in ${line}
|
||||
do
|
||||
echo -n "0x${code},";
|
||||
done
|
||||
done
|
||||
echo '};'
|
||||
|
||||
nm -n acpi_wakecode.o | while read offset dummy what
|
||||
do
|
||||
echo "#define ${what} 0x${offset}"
|
||||
done
|
||||
|
||||
exit 0
|
||||
+31
-17
@@ -357,7 +357,7 @@ i386_get_ldt(p, args)
|
||||
num = min(uap->num, nldt);
|
||||
lp = &ldt[uap->start];
|
||||
}
|
||||
if (uap->start > nldt) {
|
||||
if (uap->start + num > nldt) {
|
||||
splx(s);
|
||||
return(EINVAL);
|
||||
}
|
||||
@@ -379,7 +379,8 @@ i386_set_ldt(p, args)
|
||||
int largest_ld;
|
||||
struct pcb *pcb = &p->p_addr->u_pcb;
|
||||
struct pcb_ldt *pcb_ldt = pcb->pcb_ldt;
|
||||
int s;
|
||||
union descriptor *descs;
|
||||
int descs_size, s;
|
||||
struct i386_ldt_args ua, *uap = &ua;
|
||||
|
||||
if ((error = copyin(args, uap, sizeof(struct i386_ldt_args))) < 0)
|
||||
@@ -422,17 +423,23 @@ i386_set_ldt(p, args)
|
||||
#endif
|
||||
}
|
||||
|
||||
descs_size = uap->num * sizeof(union descriptor);
|
||||
descs = (union descriptor *)kmem_alloc(kernel_map, descs_size);
|
||||
if (descs == NULL)
|
||||
return (ENOMEM);
|
||||
error = copyin(&uap->descs[0], descs, descs_size);
|
||||
if (error) {
|
||||
kmem_free(kernel_map, (vm_offset_t)descs, descs_size);
|
||||
return (error);
|
||||
}
|
||||
/* Check descriptors for access violations */
|
||||
for (i = 0, n = uap->start; i < uap->num; i++, n++) {
|
||||
union descriptor desc, *dp;
|
||||
dp = &uap->descs[i];
|
||||
error = copyin(dp, &desc, sizeof(union descriptor));
|
||||
if (error)
|
||||
return(error);
|
||||
union descriptor *dp;
|
||||
dp = &descs[i];
|
||||
|
||||
switch (desc.sd.sd_type) {
|
||||
switch (dp->sd.sd_type) {
|
||||
case SDT_SYSNULL: /* system null */
|
||||
desc.sd.sd_p = 0;
|
||||
dp->sd.sd_p = 0;
|
||||
break;
|
||||
case SDT_SYS286TSS: /* system 286 TSS available */
|
||||
case SDT_SYSLDT: /* system local descriptor table */
|
||||
@@ -453,6 +460,7 @@ i386_set_ldt(p, args)
|
||||
* to create a segment of these types. They are
|
||||
* for OS use only.
|
||||
*/
|
||||
kmem_free(kernel_map, (vm_offset_t)descs, descs_size);
|
||||
return EACCES;
|
||||
|
||||
/* memory segment types */
|
||||
@@ -460,9 +468,12 @@ i386_set_ldt(p, args)
|
||||
case SDT_MEMEAC: /* memory execute only accessed conforming */
|
||||
case SDT_MEMERC: /* memory execute read conforming */
|
||||
case SDT_MEMERAC: /* memory execute read accessed conforming */
|
||||
/* Must be "present" if executable and conforming. */
|
||||
if (desc.sd.sd_p == 0)
|
||||
return (EACCES);
|
||||
/* Must be "present" if executable and conforming. */
|
||||
if (dp->sd.sd_p == 0) {
|
||||
kmem_free(kernel_map, (vm_offset_t)descs,
|
||||
descs_size);
|
||||
return (EACCES);
|
||||
}
|
||||
break;
|
||||
case SDT_MEMRO: /* memory read only */
|
||||
case SDT_MEMROA: /* memory read only accessed */
|
||||
@@ -478,25 +489,28 @@ i386_set_ldt(p, args)
|
||||
case SDT_MEMERA: /* memory execute read accessed */
|
||||
break;
|
||||
default:
|
||||
kmem_free(kernel_map, (vm_offset_t)descs, descs_size);
|
||||
return(EINVAL);
|
||||
/*NOTREACHED*/
|
||||
}
|
||||
|
||||
/* Only user (ring-3) descriptors may be present. */
|
||||
if ((desc.sd.sd_p != 0) && (desc.sd.sd_dpl != SEL_UPL))
|
||||
if ((dp->sd.sd_p != 0) && (dp->sd.sd_dpl != SEL_UPL)) {
|
||||
kmem_free(kernel_map, (vm_offset_t)descs, descs_size);
|
||||
return (EACCES);
|
||||
}
|
||||
}
|
||||
|
||||
s = splhigh();
|
||||
|
||||
/* Fill in range */
|
||||
error = copyin(uap->descs,
|
||||
bcopy(descs,
|
||||
&((union descriptor *)(pcb_ldt->ldt_base))[uap->start],
|
||||
uap->num * sizeof(union descriptor));
|
||||
if (!error)
|
||||
p->p_retval[0] = uap->start;
|
||||
p->p_retval[0] = uap->start;
|
||||
|
||||
splx(s);
|
||||
return(error);
|
||||
kmem_free(kernel_map, (vm_offset_t)descs, descs_size);
|
||||
return (0);
|
||||
}
|
||||
#endif /* USER_LDT */
|
||||
@@ -48,9 +48,9 @@
|
||||
#define I386_VM86 6
|
||||
|
||||
struct i386_ldt_args {
|
||||
int start;
|
||||
unsigned int start;
|
||||
union descriptor *descs;
|
||||
int num;
|
||||
unsigned int num;
|
||||
};
|
||||
|
||||
struct i386_ioperm_args {
|
||||
|
||||
@@ -1,490 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2001 Alexander Kabaev
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer
|
||||
* in this position and unchanged.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
#include "opt_cpu.h"
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/lock.h>
|
||||
#include <sys/mutex.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/ptrace.h>
|
||||
#include <sys/syscallsubr.h>
|
||||
#include <sys/systm.h>
|
||||
|
||||
#include <machine/md_var.h>
|
||||
#include <machine/pcb.h>
|
||||
#include <machine/reg.h>
|
||||
|
||||
#include <i386/linux/linux.h>
|
||||
#include <i386/linux/linux_proto.h>
|
||||
|
||||
#if !defined(CPU_ENABLE_SSE) && defined(I686_CPU)
|
||||
#define CPU_ENABLE_SSE
|
||||
#endif
|
||||
#if defined(CPU_DISABLE_SSE)
|
||||
#undef CPU_ENABLE_SSE
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Linux ptrace requests numbers. Mostly identical to FreeBSD,
|
||||
* except for MD ones and PT_ATTACH/PT_DETACH.
|
||||
*/
|
||||
#define PTRACE_TRACEME 0
|
||||
#define PTRACE_PEEKTEXT 1
|
||||
#define PTRACE_PEEKDATA 2
|
||||
#define PTRACE_PEEKUSR 3
|
||||
#define PTRACE_POKETEXT 4
|
||||
#define PTRACE_POKEDATA 5
|
||||
#define PTRACE_POKEUSR 6
|
||||
#define PTRACE_CONT 7
|
||||
#define PTRACE_KILL 8
|
||||
#define PTRACE_SINGLESTEP 9
|
||||
|
||||
#define PTRACE_ATTACH 16
|
||||
#define PTRACE_DETACH 17
|
||||
|
||||
#define PTRACE_SYSCALL 24
|
||||
|
||||
#define PTRACE_GETREGS 12
|
||||
#define PTRACE_SETREGS 13
|
||||
#define PTRACE_GETFPREGS 14
|
||||
#define PTRACE_SETFPREGS 15
|
||||
#define PTRACE_GETFPXREGS 18
|
||||
#define PTRACE_SETFPXREGS 19
|
||||
|
||||
#define PTRACE_SETOPTIONS 21
|
||||
|
||||
/*
|
||||
* Linux keeps debug registers at the following
|
||||
* offset in the user struct
|
||||
*/
|
||||
#define LINUX_DBREG_OFFSET 252
|
||||
#define LINUX_DBREG_SIZE (8*sizeof(l_int))
|
||||
|
||||
static __inline__ int
|
||||
map_signum(int signum)
|
||||
{
|
||||
|
||||
if (signum > 0 && signum <= LINUX_SIGTBLSZ)
|
||||
signum = linux_to_bsd_signal[_SIG_IDX(signum)];
|
||||
return ((signum == SIGSTOP)? 0 : signum);
|
||||
}
|
||||
|
||||
struct linux_pt_reg {
|
||||
l_long ebx;
|
||||
l_long ecx;
|
||||
l_long edx;
|
||||
l_long esi;
|
||||
l_long edi;
|
||||
l_long ebp;
|
||||
l_long eax;
|
||||
l_int xds;
|
||||
l_int xes;
|
||||
l_int xfs;
|
||||
l_int xgs;
|
||||
l_long orig_eax;
|
||||
l_long eip;
|
||||
l_int xcs;
|
||||
l_long eflags;
|
||||
l_long esp;
|
||||
l_int xss;
|
||||
};
|
||||
|
||||
/*
|
||||
* Translate i386 ptrace registers between Linux and FreeBSD formats.
|
||||
* The translation is pretty straighforward, for all registers, but
|
||||
* orig_eax on Linux side and r_trapno and r_err in FreeBSD
|
||||
*/
|
||||
static void
|
||||
map_regs_to_linux(struct reg *bsd_r, struct linux_pt_reg *linux_r)
|
||||
{
|
||||
linux_r->ebx = bsd_r->r_ebx;
|
||||
linux_r->ecx = bsd_r->r_ecx;
|
||||
linux_r->edx = bsd_r->r_edx;
|
||||
linux_r->esi = bsd_r->r_esi;
|
||||
linux_r->edi = bsd_r->r_edi;
|
||||
linux_r->ebp = bsd_r->r_ebp;
|
||||
linux_r->eax = bsd_r->r_eax;
|
||||
linux_r->xds = bsd_r->r_ds;
|
||||
linux_r->xes = bsd_r->r_es;
|
||||
linux_r->xfs = bsd_r->r_fs;
|
||||
linux_r->xgs = bsd_r->r_gs;
|
||||
linux_r->orig_eax = bsd_r->r_eax;
|
||||
linux_r->eip = bsd_r->r_eip;
|
||||
linux_r->xcs = bsd_r->r_cs;
|
||||
linux_r->eflags = bsd_r->r_eflags;
|
||||
linux_r->esp = bsd_r->r_esp;
|
||||
linux_r->xss = bsd_r->r_ss;
|
||||
}
|
||||
|
||||
static void
|
||||
map_regs_from_linux(struct reg *bsd_r, struct linux_pt_reg *linux_r)
|
||||
{
|
||||
bsd_r->r_ebx = linux_r->ebx;
|
||||
bsd_r->r_ecx = linux_r->ecx;
|
||||
bsd_r->r_edx = linux_r->edx;
|
||||
bsd_r->r_esi = linux_r->esi;
|
||||
bsd_r->r_edi = linux_r->edi;
|
||||
bsd_r->r_ebp = linux_r->ebp;
|
||||
bsd_r->r_eax = linux_r->eax;
|
||||
bsd_r->r_ds = linux_r->xds;
|
||||
bsd_r->r_es = linux_r->xes;
|
||||
bsd_r->r_fs = linux_r->xfs;
|
||||
bsd_r->r_gs = linux_r->xgs;
|
||||
bsd_r->r_eip = linux_r->eip;
|
||||
bsd_r->r_cs = linux_r->xcs;
|
||||
bsd_r->r_eflags = linux_r->eflags;
|
||||
bsd_r->r_esp = linux_r->esp;
|
||||
bsd_r->r_ss = linux_r->xss;
|
||||
}
|
||||
|
||||
struct linux_pt_fpreg {
|
||||
l_long cwd;
|
||||
l_long swd;
|
||||
l_long twd;
|
||||
l_long fip;
|
||||
l_long fcs;
|
||||
l_long foo;
|
||||
l_long fos;
|
||||
l_long st_space[2*10];
|
||||
};
|
||||
|
||||
static void
|
||||
map_fpregs_to_linux(struct fpreg *bsd_r, struct linux_pt_fpreg *linux_r)
|
||||
{
|
||||
linux_r->cwd = bsd_r->fpr_env[0];
|
||||
linux_r->swd = bsd_r->fpr_env[1];
|
||||
linux_r->twd = bsd_r->fpr_env[2];
|
||||
linux_r->fip = bsd_r->fpr_env[3];
|
||||
linux_r->fcs = bsd_r->fpr_env[4];
|
||||
linux_r->foo = bsd_r->fpr_env[5];
|
||||
linux_r->fos = bsd_r->fpr_env[6];
|
||||
bcopy(bsd_r->fpr_acc, linux_r->st_space, sizeof(linux_r->st_space));
|
||||
}
|
||||
|
||||
static void
|
||||
map_fpregs_from_linux(struct fpreg *bsd_r, struct linux_pt_fpreg *linux_r)
|
||||
{
|
||||
bsd_r->fpr_env[0] = linux_r->cwd;
|
||||
bsd_r->fpr_env[1] = linux_r->swd;
|
||||
bsd_r->fpr_env[2] = linux_r->twd;
|
||||
bsd_r->fpr_env[3] = linux_r->fip;
|
||||
bsd_r->fpr_env[4] = linux_r->fcs;
|
||||
bsd_r->fpr_env[5] = linux_r->foo;
|
||||
bsd_r->fpr_env[6] = linux_r->fos;
|
||||
bcopy(bsd_r->fpr_acc, linux_r->st_space, sizeof(bsd_r->fpr_acc));
|
||||
}
|
||||
|
||||
struct linux_pt_fpxreg {
|
||||
l_ushort cwd;
|
||||
l_ushort swd;
|
||||
l_ushort twd;
|
||||
l_ushort fop;
|
||||
l_long fip;
|
||||
l_long fcs;
|
||||
l_long foo;
|
||||
l_long fos;
|
||||
l_long mxcsr;
|
||||
l_long reserved;
|
||||
l_long st_space[32];
|
||||
l_long xmm_space[32];
|
||||
l_long padding[56];
|
||||
};
|
||||
|
||||
#ifdef CPU_ENABLE_SSE
|
||||
static int
|
||||
linux_proc_read_fpxregs(struct thread *td, struct linux_pt_fpxreg *fpxregs)
|
||||
{
|
||||
int error;
|
||||
|
||||
error = 0;
|
||||
mtx_lock_spin(&sched_lock);
|
||||
if (cpu_fxsr == 0 || (td->td_proc->p_sflag & PS_INMEM) == 0)
|
||||
error = EIO;
|
||||
else
|
||||
bcopy(&td->td_pcb->pcb_save.sv_xmm, fpxregs, sizeof(*fpxregs));
|
||||
mtx_unlock_spin(&sched_lock);
|
||||
return (error);
|
||||
}
|
||||
|
||||
static int
|
||||
linux_proc_write_fpxregs(struct thread *td, struct linux_pt_fpxreg *fpxregs)
|
||||
{
|
||||
int error;
|
||||
|
||||
error = 0;
|
||||
mtx_lock_spin(&sched_lock);
|
||||
if (cpu_fxsr == 0 || (td->td_proc->p_sflag & PS_INMEM) == 0)
|
||||
error = EIO;
|
||||
else
|
||||
bcopy(fpxregs, &td->td_pcb->pcb_save.sv_xmm, sizeof(*fpxregs));
|
||||
mtx_unlock_spin(&sched_lock);
|
||||
return (error);
|
||||
}
|
||||
#endif
|
||||
|
||||
int
|
||||
linux_ptrace(struct thread *td, struct linux_ptrace_args *uap)
|
||||
{
|
||||
union {
|
||||
struct linux_pt_reg reg;
|
||||
struct linux_pt_fpreg fpreg;
|
||||
struct linux_pt_fpxreg fpxreg;
|
||||
} r;
|
||||
union {
|
||||
struct reg bsd_reg;
|
||||
struct fpreg bsd_fpreg;
|
||||
struct dbreg bsd_dbreg;
|
||||
} u;
|
||||
void *addr;
|
||||
pid_t pid;
|
||||
int error, req;
|
||||
|
||||
error = 0;
|
||||
|
||||
/* by default, just copy data intact */
|
||||
req = uap->req;
|
||||
pid = (pid_t)uap->pid;
|
||||
addr = (void *)uap->addr;
|
||||
|
||||
switch (req) {
|
||||
case PTRACE_TRACEME:
|
||||
case PTRACE_POKETEXT:
|
||||
case PTRACE_POKEDATA:
|
||||
case PTRACE_KILL:
|
||||
error = kern_ptrace(td, req, pid, addr, uap->data);
|
||||
break;
|
||||
case PTRACE_PEEKTEXT:
|
||||
case PTRACE_PEEKDATA: {
|
||||
/* need to preserve return value */
|
||||
int rval = td->td_retval[0];
|
||||
error = kern_ptrace(td, req, pid, addr, 0);
|
||||
if (error == 0)
|
||||
error = copyout(td->td_retval, (caddr_t)uap->data,
|
||||
sizeof(l_int));
|
||||
td->td_retval[0] = rval;
|
||||
break;
|
||||
}
|
||||
case PTRACE_DETACH:
|
||||
error = kern_ptrace(td, PT_DETACH, pid, (void *)1,
|
||||
map_signum(uap->data));
|
||||
break;
|
||||
case PTRACE_SINGLESTEP:
|
||||
case PTRACE_CONT:
|
||||
error = kern_ptrace(td, req, pid, (void *)1,
|
||||
map_signum(uap->data));
|
||||
break;
|
||||
case PTRACE_ATTACH:
|
||||
error = kern_ptrace(td, PT_ATTACH, pid, addr, uap->data);
|
||||
break;
|
||||
case PTRACE_GETREGS:
|
||||
/* Linux is using data where FreeBSD is using addr */
|
||||
error = kern_ptrace(td, PT_GETREGS, pid, &u.bsd_reg, 0);
|
||||
if (error == 0) {
|
||||
map_regs_to_linux(&u.bsd_reg, &r.reg);
|
||||
error = copyout(&r.reg, (caddr_t)uap->data,
|
||||
sizeof(r.reg));
|
||||
}
|
||||
break;
|
||||
case PTRACE_SETREGS:
|
||||
/* Linux is using data where FreeBSD is using addr */
|
||||
error = copyin((caddr_t)uap->data, &r.reg, sizeof(r.reg));
|
||||
if (error == 0) {
|
||||
map_regs_from_linux(&u.bsd_reg, &r.reg);
|
||||
error = kern_ptrace(td, PT_SETREGS, pid, &u.bsd_reg, 0);
|
||||
}
|
||||
break;
|
||||
case PTRACE_GETFPREGS:
|
||||
/* Linux is using data where FreeBSD is using addr */
|
||||
error = kern_ptrace(td, PT_GETFPREGS, pid, &u.bsd_fpreg, 0);
|
||||
if (error == 0) {
|
||||
map_fpregs_to_linux(&u.bsd_fpreg, &r.fpreg);
|
||||
error = copyout(&r.fpreg, (caddr_t)uap->data,
|
||||
sizeof(r.fpreg));
|
||||
}
|
||||
break;
|
||||
case PTRACE_SETFPREGS:
|
||||
/* Linux is using data where FreeBSD is using addr */
|
||||
error = copyin((caddr_t)uap->data, &r.fpreg, sizeof(r.fpreg));
|
||||
if (error == 0) {
|
||||
map_fpregs_from_linux(&u.bsd_fpreg, &r.fpreg);
|
||||
error = kern_ptrace(td, PT_SETFPREGS, pid,
|
||||
&u.bsd_fpreg, 0);
|
||||
}
|
||||
break;
|
||||
case PTRACE_SETFPXREGS:
|
||||
#ifdef CPU_ENABLE_SSE
|
||||
error = copyin((caddr_t)uap->data, &r.fpxreg,
|
||||
sizeof(r.fpxreg));
|
||||
if (error)
|
||||
break;
|
||||
#endif
|
||||
/* FALL THROUGH */
|
||||
case PTRACE_GETFPXREGS: {
|
||||
#ifdef CPU_ENABLE_SSE
|
||||
struct proc *p;
|
||||
struct thread *td2;
|
||||
|
||||
if (sizeof(struct linux_pt_fpxreg) != sizeof(struct savexmm)) {
|
||||
static int once = 0;
|
||||
if (!once) {
|
||||
printf("linux: savexmm != linux_pt_fpxreg\n");
|
||||
once = 1;
|
||||
}
|
||||
error = EIO;
|
||||
break;
|
||||
}
|
||||
|
||||
if ((p = pfind(uap->pid)) == NULL) {
|
||||
error = ESRCH;
|
||||
break;
|
||||
}
|
||||
|
||||
if ((error = p_candebug(td, p)) != 0)
|
||||
goto fail;
|
||||
|
||||
/* System processes can't be debugged. */
|
||||
if ((p->p_flag & P_SYSTEM) != 0) {
|
||||
error = EINVAL;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
/* not being traced... */
|
||||
if ((p->p_flag & P_TRACED) == 0) {
|
||||
error = EPERM;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
/* not being traced by YOU */
|
||||
if (p->p_pptr != td->td_proc) {
|
||||
error = EBUSY;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
/* not currently stopped */
|
||||
if ((p->p_flag & (P_TRACED|P_WAITED)) == 0) {
|
||||
error = EBUSY;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
td2 = FIRST_THREAD_IN_PROC(p);
|
||||
if (req == PTRACE_GETFPXREGS) {
|
||||
_PHOLD(p);
|
||||
error = linux_proc_read_fpxregs(td2, &r.fpxreg);
|
||||
_PRELE(p);
|
||||
PROC_UNLOCK(p);
|
||||
if (error == 0)
|
||||
error = copyout(&r.fpxreg, (caddr_t)uap->data,
|
||||
sizeof(r.fpxreg));
|
||||
} else {
|
||||
/* clear dangerous bits exactly as Linux does*/
|
||||
r.fpxreg.mxcsr &= 0xffbf;
|
||||
_PHOLD(p);
|
||||
error = linux_proc_write_fpxregs(td2, &r.fpxreg);
|
||||
_PRELE(p);
|
||||
PROC_UNLOCK(p);
|
||||
}
|
||||
break;
|
||||
|
||||
fail:
|
||||
PROC_UNLOCK(p);
|
||||
#else
|
||||
error = EIO;
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
case PTRACE_PEEKUSR:
|
||||
case PTRACE_POKEUSR: {
|
||||
error = EIO;
|
||||
|
||||
/* check addr for alignment */
|
||||
if (uap->addr < 0 || uap->addr & (sizeof(l_int) - 1))
|
||||
break;
|
||||
/*
|
||||
* Allow linux programs to access register values in
|
||||
* user struct. We simulate this through PT_GET/SETREGS
|
||||
* as necessary.
|
||||
*/
|
||||
if (uap->addr < sizeof(struct linux_pt_reg)) {
|
||||
error = kern_ptrace(td, PT_GETREGS, pid, &u.bsd_reg, 0);
|
||||
if (error != 0)
|
||||
break;
|
||||
|
||||
map_regs_to_linux(&u.bsd_reg, &r.reg);
|
||||
if (req == PTRACE_PEEKUSR) {
|
||||
error = copyout((char *)&r.reg + uap->addr,
|
||||
(caddr_t)uap->data, sizeof(l_int));
|
||||
break;
|
||||
}
|
||||
|
||||
*(l_int *)((char *)&r.reg + uap->addr) =
|
||||
(l_int)uap->data;
|
||||
|
||||
map_regs_from_linux(&u.bsd_reg, &r.reg);
|
||||
error = kern_ptrace(td, PT_SETREGS, pid, &u.bsd_reg, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Simulate debug registers access
|
||||
*/
|
||||
if (uap->addr >= LINUX_DBREG_OFFSET &&
|
||||
uap->addr <= LINUX_DBREG_OFFSET + LINUX_DBREG_SIZE) {
|
||||
error = kern_ptrace(td, PT_GETDBREGS, pid, &u.bsd_dbreg,
|
||||
0);
|
||||
if (error != 0)
|
||||
break;
|
||||
|
||||
uap->addr -= LINUX_DBREG_OFFSET;
|
||||
if (req == PTRACE_PEEKUSR) {
|
||||
error = copyout((char *)&u.bsd_dbreg +
|
||||
uap->addr, (caddr_t)uap->data,
|
||||
sizeof(l_int));
|
||||
break;
|
||||
}
|
||||
|
||||
*(l_int *)((char *)&u.bsd_dbreg + uap->addr) =
|
||||
uap->data;
|
||||
error = kern_ptrace(td, PT_SETDBREGS, pid,
|
||||
&u.bsd_dbreg, 0);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case PTRACE_SYSCALL:
|
||||
/* fall through */
|
||||
default:
|
||||
printf("linux: ptrace(%u, ...) not implemented\n",
|
||||
(unsigned int)uap->req);
|
||||
error = EINVAL;
|
||||
break;
|
||||
}
|
||||
|
||||
return (error);
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
# $FreeBSD$
|
||||
|
||||
.PATH: ${.CURDIR}/../../../dev/aac
|
||||
|
||||
KMOD= aac_linux
|
||||
SRCS= aac_linux.c
|
||||
|
||||
.include <bsd.kmod.mk>
|
||||
@@ -1,9 +0,0 @@
|
||||
# $FreeBSD$
|
||||
|
||||
.PATH: ${.CURDIR}/../../../dev/drm
|
||||
KMOD = tdfx
|
||||
NOMAN = YES
|
||||
SRCS = tdfx_drv.c
|
||||
SRCS +=device_if.h bus_if.h pci_if.h opt_drm.h
|
||||
|
||||
.include <bsd.kmod.mk>
|
||||
@@ -1,10 +0,0 @@
|
||||
# $FreeBSD$
|
||||
|
||||
S= ${.CURDIR}/../..
|
||||
.PATH: $S/dev/usb
|
||||
|
||||
KMOD= uftdi
|
||||
SRCS= uftdi.c uftdireg.h opt_usb.h device_if.h bus_if.h vnode_if.h
|
||||
NOMAN=
|
||||
|
||||
.include <bsd.kmod.mk>
|
||||
@@ -1,165 +0,0 @@
|
||||
/* $NetBSD: if_gre.h,v 1.10 2002/02/24 17:22:20 martin Exp $ */
|
||||
/* $FreeBSD$ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
* All rights reserved
|
||||
*
|
||||
* This code is derived from software contributed to The NetBSD Foundation
|
||||
* by Heiko W.Rupp <hwr@pilhuhn.de>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the NetBSD
|
||||
* Foundation, Inc. and its contributors.
|
||||
* 4. Neither the name of The NetBSD Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
||||
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef _NET_IF_GRE_H
|
||||
#define _NET_IF_GRE_H
|
||||
|
||||
#include <sys/ioccom.h>
|
||||
#ifdef _KERNEL
|
||||
#include <sys/queue.h>
|
||||
|
||||
struct gre_softc {
|
||||
struct ifnet sc_if;
|
||||
LIST_ENTRY(gre_softc) sc_list;
|
||||
int gre_unit;
|
||||
int gre_flags;
|
||||
struct in_addr g_src; /* source address of gre packets */
|
||||
struct in_addr g_dst; /* destination address of gre packets */
|
||||
struct route route; /* routing entry that determines, where a
|
||||
encapsulated packet should go */
|
||||
u_char g_proto; /* protocol of encapsulator */
|
||||
|
||||
const struct encaptab *encap; /* encapsulation cookie */
|
||||
|
||||
int called; /* infinite recursion preventer */
|
||||
};
|
||||
|
||||
|
||||
struct gre_h {
|
||||
u_int16_t flags; /* GRE flags */
|
||||
u_int16_t ptype; /* protocol type of payload typically
|
||||
Ether protocol type*/
|
||||
/*
|
||||
* from here on: fields are optional, presence indicated by flags
|
||||
*
|
||||
u_int_16 checksum checksum (one-complements of GRE header
|
||||
and payload
|
||||
Present if (ck_pres | rt_pres == 1).
|
||||
Valid if (ck_pres == 1).
|
||||
u_int_16 offset offset from start of routing filed to
|
||||
first octet of active SRE (see below).
|
||||
Present if (ck_pres | rt_pres == 1).
|
||||
Valid if (rt_pres == 1).
|
||||
u_int_32 key inserted by encapsulator e.g. for
|
||||
authentication
|
||||
Present if (key_pres ==1 ).
|
||||
u_int_32 seq_num Sequence number to allow for packet order
|
||||
Present if (seq_pres ==1 ).
|
||||
struct gre_sre[] routing Routing fileds (see below)
|
||||
Present if (rt_pres == 1)
|
||||
*/
|
||||
} __packed;
|
||||
|
||||
struct greip {
|
||||
struct ip gi_i;
|
||||
struct gre_h gi_g;
|
||||
} __packed;
|
||||
|
||||
#define gi_pr gi_i.ip_p
|
||||
#define gi_len gi_i.ip_len
|
||||
#define gi_src gi_i.ip_src
|
||||
#define gi_dst gi_i.ip_dst
|
||||
#define gi_ptype gi_g.ptype
|
||||
#define gi_flags gi_g.flags
|
||||
|
||||
#define GRE_CP 0x8000 /* Checksum Present */
|
||||
#define GRE_RP 0x4000 /* Routing Present */
|
||||
#define GRE_KP 0x2000 /* Key Present */
|
||||
#define GRE_SP 0x1000 /* Sequence Present */
|
||||
#define GRE_SS 0x0800 /* Strict Source Route */
|
||||
|
||||
/*
|
||||
* gre_sre defines a Source route Entry. These are needed if packets
|
||||
* should be routed over more than one tunnel hop by hop
|
||||
*/
|
||||
struct gre_sre {
|
||||
u_int16_t sre_family; /* adress family */
|
||||
u_char sre_offset; /* offset to first octet of active entry */
|
||||
u_char sre_length; /* number of octets in the SRE.
|
||||
sre_lengthl==0 -> last entry. */
|
||||
u_char *sre_rtinfo; /* the routing information */
|
||||
};
|
||||
|
||||
struct greioctl {
|
||||
int unit;
|
||||
struct in_addr addr;
|
||||
};
|
||||
|
||||
/* for mobile encaps */
|
||||
|
||||
struct mobile_h {
|
||||
u_int16_t proto; /* protocol and S-bit */
|
||||
u_int16_t hcrc; /* header checksum */
|
||||
u_int32_t odst; /* original destination address */
|
||||
u_int32_t osrc; /* original source addr, if S-bit set */
|
||||
} __packed;
|
||||
|
||||
struct mobip_h {
|
||||
struct ip mi;
|
||||
struct mobile_h mh;
|
||||
} __packed;
|
||||
|
||||
|
||||
#define MOB_H_SIZ_S (sizeof(struct mobile_h) - sizeof(u_int32_t))
|
||||
#define MOB_H_SIZ_L (sizeof(struct mobile_h))
|
||||
#define MOB_H_SBIT 0x0080
|
||||
|
||||
#define GRE_TTL 30
|
||||
|
||||
#endif /* _KERNEL */
|
||||
|
||||
/*
|
||||
* ioctls needed to manipulate the interface
|
||||
*/
|
||||
|
||||
#define GRESADDRS _IOW('i', 101, struct ifreq)
|
||||
#define GRESADDRD _IOW('i', 102, struct ifreq)
|
||||
#define GREGADDRS _IOWR('i', 103, struct ifreq)
|
||||
#define GREGADDRD _IOWR('i', 104, struct ifreq)
|
||||
#define GRESPROTO _IOW('i' , 105, struct ifreq)
|
||||
#define GREGPROTO _IOWR('i', 106, struct ifreq)
|
||||
|
||||
#ifdef _KERNEL
|
||||
LIST_HEAD(gre_softc_head, gre_softc);
|
||||
extern struct gre_softc_head gre_softc_list;
|
||||
|
||||
u_short gre_in_cksum(u_short *p, u_int len);
|
||||
#endif /* _KERNEL */
|
||||
|
||||
#endif
|
||||
+1
-1
@@ -54,7 +54,7 @@
|
||||
* doc/en_US.ISO8859-1/books/porters-handbook/book.sgml
|
||||
*/
|
||||
#undef __FreeBSD_version
|
||||
#define __FreeBSD_version 460102 /* Master, propagated to newvers */
|
||||
#define __FreeBSD_version 470000 /* Master, propagated to newvers */
|
||||
|
||||
#ifndef NULL
|
||||
#define NULL 0
|
||||
|
||||
@@ -1,65 +0,0 @@
|
||||
/*-
|
||||
* Copyright (c) 2001 Mitsuru IWASAKI
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
#ifndef _SYS_POWER_H_
|
||||
#define _SYS_POWER_H_
|
||||
|
||||
#include <sys/eventhandler.h>
|
||||
|
||||
/* Power management system type */
|
||||
#define POWER_PM_TYPE_APM 0x00
|
||||
#define POWER_PM_TYPE_ACPI 0x01
|
||||
#define POWER_PM_TYPE_NONE 0xff
|
||||
|
||||
/* Commands for Power management function */
|
||||
#define POWER_CMD_SUSPEND 0x00
|
||||
|
||||
/* Sleep state */
|
||||
#define POWER_SLEEP_STATE_STANDBY 0x00
|
||||
#define POWER_SLEEP_STATE_SUSPEND 0x01
|
||||
#define POWER_SLEEP_STATE_HIBERNATE 0x02
|
||||
|
||||
typedef int (*power_pm_fn_t)(u_long, void*, ...);
|
||||
extern int power_pm_register(u_int, power_pm_fn_t, void *);
|
||||
extern u_int power_pm_get_type(void);
|
||||
extern void power_pm_suspend(int);
|
||||
|
||||
/*
|
||||
* System power API.
|
||||
*/
|
||||
#define POWER_PROFILE_PERFORMANCE 0
|
||||
#define POWER_PROFILE_ECONOMY 1
|
||||
|
||||
extern int power_profile_get_state(void);
|
||||
extern void power_profile_set_state(int);
|
||||
|
||||
typedef void (*power_profile_change_hook)(void *, int);
|
||||
EVENTHANDLER_DECLARE(power_profile_change, power_profile_change_hook);
|
||||
|
||||
#endif /* !_SYS_POWER_H_ */
|
||||
|
||||
@@ -1,991 +0,0 @@
|
||||
%{
|
||||
/*
|
||||
** Originally written by Steven M. Bellovin <[email protected]> while
|
||||
** at the University of North Carolina at Chapel Hill. Later tweaked by
|
||||
** a couple of people on Usenet. Completely overhauled by Rich $alz
|
||||
** <[email protected]> and Jim Berets <[email protected]> in August, 1990;
|
||||
**
|
||||
** This grammar has 10 shift/reduce conflicts.
|
||||
**
|
||||
** This code is in the public domain and has no copyright.
|
||||
*/
|
||||
/* SUPPRESS 287 on yaccpar_sccsid *//* Unused static variable */
|
||||
/* SUPPRESS 288 on yyerrlab *//* Label unused */
|
||||
|
||||
/* $FreeBSD$ */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
|
||||
/* The code at the top of get_date which figures out the offset of the
|
||||
current time zone checks various CPP symbols to see if special
|
||||
tricks are need, but defaults to using the gettimeofday system call.
|
||||
Include <sys/time.h> if that will be used. */
|
||||
|
||||
#if defined(vms)
|
||||
# include <types.h>
|
||||
#else /* defined(vms) */
|
||||
# include <sys/types.h>
|
||||
# include <sys/time.h>
|
||||
# include <sys/timeb.h>
|
||||
#endif /* !defined(vms) */
|
||||
|
||||
#if defined (__STDC__) || defined (USG)
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
/* Some old versions of bison generate parsers that use bcopy.
|
||||
That loses on systems that don't provide the function, so we have
|
||||
to redefine it here. */
|
||||
#if !defined (HAVE_BCOPY) && defined (HAVE_MEMCPY) && !defined (bcopy)
|
||||
#define bcopy(from, to, len) memcpy ((to), (from), (len))
|
||||
#endif
|
||||
|
||||
#if defined (__STDC__)
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
/* NOTES on rebuilding getdate.c (particularly for inclusion in CVS
|
||||
releases):
|
||||
|
||||
We don't want to mess with all the portability hassles of alloca.
|
||||
In particular, most (all?) versions of bison will use alloca in
|
||||
their parser. If bison works on your system (e.g. it should work
|
||||
with gcc), then go ahead and use it, but the more general solution
|
||||
is to use byacc instead of bison, which should generate a portable
|
||||
parser. I played with adding "#define alloca dont_use_alloca", to
|
||||
give an error if the parser generator uses alloca (and thus detect
|
||||
unportable getdate.c's), but that seems to cause as many problems
|
||||
as it solves. */
|
||||
|
||||
extern struct tm *gmtime();
|
||||
extern struct tm *localtime();
|
||||
|
||||
#define yyparse getdate_yyparse
|
||||
#define yylex getdate_yylex
|
||||
#define yyerror getdate_yyerror
|
||||
|
||||
static int yyparse ();
|
||||
static int yylex ();
|
||||
static int yyerror ();
|
||||
|
||||
#define EPOCH 1970
|
||||
#define HOUR(x) ((time_t)(x) * 60)
|
||||
#define SECSPERDAY (24L * 60L * 60L)
|
||||
|
||||
|
||||
/*
|
||||
** An entry in the lexical lookup table.
|
||||
*/
|
||||
typedef struct _TABLE {
|
||||
char *name;
|
||||
int type;
|
||||
time_t value;
|
||||
} TABLE;
|
||||
|
||||
|
||||
/*
|
||||
** Daylight-savings mode: on, off, or not yet known.
|
||||
*/
|
||||
typedef enum _DSTMODE {
|
||||
DSTon, DSToff, DSTmaybe
|
||||
} DSTMODE;
|
||||
|
||||
/*
|
||||
** Meridian: am, pm, or 24-hour style.
|
||||
*/
|
||||
typedef enum _MERIDIAN {
|
||||
MERam, MERpm, MER24
|
||||
} MERIDIAN;
|
||||
|
||||
|
||||
/*
|
||||
** Global variables. We could get rid of most of these by using a good
|
||||
** union as the yacc stack. (This routine was originally written before
|
||||
** yacc had the %union construct.) Maybe someday; right now we only use
|
||||
** the %union very rarely.
|
||||
*/
|
||||
static char *yyInput;
|
||||
static DSTMODE yyDSTmode;
|
||||
static time_t yyDayOrdinal;
|
||||
static time_t yyDayNumber;
|
||||
static int yyHaveDate;
|
||||
static int yyHaveDay;
|
||||
static int yyHaveRel;
|
||||
static int yyHaveTime;
|
||||
static int yyHaveZone;
|
||||
static time_t yyTimezone;
|
||||
static time_t yyDay;
|
||||
static time_t yyHour;
|
||||
static time_t yyMinutes;
|
||||
static time_t yyMonth;
|
||||
static time_t yySeconds;
|
||||
static time_t yyYear;
|
||||
static MERIDIAN yyMeridian;
|
||||
static time_t yyRelMonth;
|
||||
static time_t yyRelSeconds;
|
||||
|
||||
%}
|
||||
|
||||
%union {
|
||||
time_t Number;
|
||||
enum _MERIDIAN Meridian;
|
||||
}
|
||||
|
||||
%token tAGO tDAY tDAYZONE tID tMERIDIAN tMINUTE_UNIT tMONTH tMONTH_UNIT
|
||||
%token tSEC_UNIT tSNUMBER tUNUMBER tZONE tDST
|
||||
|
||||
%type <Number> tDAY tDAYZONE tMINUTE_UNIT tMONTH tMONTH_UNIT
|
||||
%type <Number> tSEC_UNIT tSNUMBER tUNUMBER tZONE
|
||||
%type <Meridian> tMERIDIAN o_merid
|
||||
|
||||
%%
|
||||
|
||||
spec : /* NULL */
|
||||
| spec item
|
||||
;
|
||||
|
||||
item : time {
|
||||
yyHaveTime++;
|
||||
}
|
||||
| zone {
|
||||
yyHaveZone++;
|
||||
}
|
||||
| date {
|
||||
yyHaveDate++;
|
||||
}
|
||||
| day {
|
||||
yyHaveDay++;
|
||||
}
|
||||
| rel {
|
||||
yyHaveRel++;
|
||||
}
|
||||
| number
|
||||
;
|
||||
|
||||
time : tUNUMBER tMERIDIAN {
|
||||
yyHour = $1;
|
||||
yyMinutes = 0;
|
||||
yySeconds = 0;
|
||||
yyMeridian = $2;
|
||||
}
|
||||
| tUNUMBER ':' tUNUMBER o_merid {
|
||||
yyHour = $1;
|
||||
yyMinutes = $3;
|
||||
yySeconds = 0;
|
||||
yyMeridian = $4;
|
||||
}
|
||||
| tUNUMBER ':' tUNUMBER tSNUMBER {
|
||||
yyHour = $1;
|
||||
yyMinutes = $3;
|
||||
yyMeridian = MER24;
|
||||
yyDSTmode = DSToff;
|
||||
yyTimezone = - ($4 % 100 + ($4 / 100) * 60);
|
||||
}
|
||||
| tUNUMBER ':' tUNUMBER ':' tUNUMBER o_merid {
|
||||
yyHour = $1;
|
||||
yyMinutes = $3;
|
||||
yySeconds = $5;
|
||||
yyMeridian = $6;
|
||||
}
|
||||
| tUNUMBER ':' tUNUMBER ':' tUNUMBER tSNUMBER {
|
||||
yyHour = $1;
|
||||
yyMinutes = $3;
|
||||
yySeconds = $5;
|
||||
yyMeridian = MER24;
|
||||
yyDSTmode = DSToff;
|
||||
yyTimezone = - ($6 % 100 + ($6 / 100) * 60);
|
||||
}
|
||||
;
|
||||
|
||||
zone : tZONE {
|
||||
yyTimezone = $1;
|
||||
yyDSTmode = DSToff;
|
||||
}
|
||||
| tDAYZONE {
|
||||
yyTimezone = $1;
|
||||
yyDSTmode = DSTon;
|
||||
}
|
||||
|
|
||||
tZONE tDST {
|
||||
yyTimezone = $1;
|
||||
yyDSTmode = DSTon;
|
||||
}
|
||||
;
|
||||
|
||||
day : tDAY {
|
||||
yyDayOrdinal = 1;
|
||||
yyDayNumber = $1;
|
||||
}
|
||||
| tDAY ',' {
|
||||
yyDayOrdinal = 1;
|
||||
yyDayNumber = $1;
|
||||
}
|
||||
| tUNUMBER tDAY {
|
||||
yyDayOrdinal = $1;
|
||||
yyDayNumber = $2;
|
||||
}
|
||||
;
|
||||
|
||||
date : tUNUMBER '/' tUNUMBER {
|
||||
yyMonth = $1;
|
||||
yyDay = $3;
|
||||
}
|
||||
| tUNUMBER '/' tUNUMBER '/' tUNUMBER {
|
||||
if ($1 >= 100) {
|
||||
yyYear = $1;
|
||||
yyMonth = $3;
|
||||
yyDay = $5;
|
||||
} else {
|
||||
yyMonth = $1;
|
||||
yyDay = $3;
|
||||
yyYear = $5;
|
||||
}
|
||||
}
|
||||
| tUNUMBER tSNUMBER tSNUMBER {
|
||||
/* ISO 8601 format. yyyy-mm-dd. */
|
||||
yyYear = $1;
|
||||
yyMonth = -$2;
|
||||
yyDay = -$3;
|
||||
}
|
||||
| tUNUMBER tMONTH tSNUMBER {
|
||||
/* e.g. 17-JUN-1992. */
|
||||
yyDay = $1;
|
||||
yyMonth = $2;
|
||||
yyYear = -$3;
|
||||
}
|
||||
| tMONTH tUNUMBER {
|
||||
yyMonth = $1;
|
||||
yyDay = $2;
|
||||
}
|
||||
| tMONTH tUNUMBER ',' tUNUMBER {
|
||||
yyMonth = $1;
|
||||
yyDay = $2;
|
||||
yyYear = $4;
|
||||
}
|
||||
| tUNUMBER tMONTH {
|
||||
yyMonth = $2;
|
||||
yyDay = $1;
|
||||
}
|
||||
| tUNUMBER tMONTH tUNUMBER {
|
||||
yyMonth = $2;
|
||||
yyDay = $1;
|
||||
yyYear = $3;
|
||||
}
|
||||
;
|
||||
|
||||
rel : relunit tAGO {
|
||||
yyRelSeconds = -yyRelSeconds;
|
||||
yyRelMonth = -yyRelMonth;
|
||||
}
|
||||
| relunit
|
||||
;
|
||||
|
||||
relunit : tUNUMBER tMINUTE_UNIT {
|
||||
yyRelSeconds += $1 * $2 * 60L;
|
||||
}
|
||||
| tSNUMBER tMINUTE_UNIT {
|
||||
yyRelSeconds += $1 * $2 * 60L;
|
||||
}
|
||||
| tMINUTE_UNIT {
|
||||
yyRelSeconds += $1 * 60L;
|
||||
}
|
||||
| tSNUMBER tSEC_UNIT {
|
||||
yyRelSeconds += $1;
|
||||
}
|
||||
| tUNUMBER tSEC_UNIT {
|
||||
yyRelSeconds += $1;
|
||||
}
|
||||
| tSEC_UNIT {
|
||||
yyRelSeconds++;
|
||||
}
|
||||
| tSNUMBER tMONTH_UNIT {
|
||||
yyRelMonth += $1 * $2;
|
||||
}
|
||||
| tUNUMBER tMONTH_UNIT {
|
||||
yyRelMonth += $1 * $2;
|
||||
}
|
||||
| tMONTH_UNIT {
|
||||
yyRelMonth += $1;
|
||||
}
|
||||
;
|
||||
|
||||
number : tUNUMBER {
|
||||
if (yyHaveTime && yyHaveDate && !yyHaveRel)
|
||||
yyYear = $1;
|
||||
else {
|
||||
if($1>10000) {
|
||||
yyHaveDate++;
|
||||
yyDay= ($1)%100;
|
||||
yyMonth= ($1/100)%100;
|
||||
yyYear = $1/10000;
|
||||
}
|
||||
else {
|
||||
yyHaveTime++;
|
||||
if ($1 < 100) {
|
||||
yyHour = $1;
|
||||
yyMinutes = 0;
|
||||
}
|
||||
else {
|
||||
yyHour = $1 / 100;
|
||||
yyMinutes = $1 % 100;
|
||||
}
|
||||
yySeconds = 0;
|
||||
yyMeridian = MER24;
|
||||
}
|
||||
}
|
||||
}
|
||||
;
|
||||
|
||||
o_merid : /* NULL */ {
|
||||
$$ = MER24;
|
||||
}
|
||||
| tMERIDIAN {
|
||||
$$ = $1;
|
||||
}
|
||||
;
|
||||
|
||||
%%
|
||||
|
||||
/* Month and day table. */
|
||||
static TABLE const MonthDayTable[] = {
|
||||
{ "january", tMONTH, 1 },
|
||||
{ "february", tMONTH, 2 },
|
||||
{ "march", tMONTH, 3 },
|
||||
{ "april", tMONTH, 4 },
|
||||
{ "may", tMONTH, 5 },
|
||||
{ "june", tMONTH, 6 },
|
||||
{ "july", tMONTH, 7 },
|
||||
{ "august", tMONTH, 8 },
|
||||
{ "september", tMONTH, 9 },
|
||||
{ "sept", tMONTH, 9 },
|
||||
{ "october", tMONTH, 10 },
|
||||
{ "november", tMONTH, 11 },
|
||||
{ "december", tMONTH, 12 },
|
||||
{ "sunday", tDAY, 0 },
|
||||
{ "monday", tDAY, 1 },
|
||||
{ "tuesday", tDAY, 2 },
|
||||
{ "tues", tDAY, 2 },
|
||||
{ "wednesday", tDAY, 3 },
|
||||
{ "wednes", tDAY, 3 },
|
||||
{ "thursday", tDAY, 4 },
|
||||
{ "thur", tDAY, 4 },
|
||||
{ "thurs", tDAY, 4 },
|
||||
{ "friday", tDAY, 5 },
|
||||
{ "saturday", tDAY, 6 },
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
/* Time units table. */
|
||||
static TABLE const UnitsTable[] = {
|
||||
{ "year", tMONTH_UNIT, 12 },
|
||||
{ "month", tMONTH_UNIT, 1 },
|
||||
{ "fortnight", tMINUTE_UNIT, 14 * 24 * 60 },
|
||||
{ "week", tMINUTE_UNIT, 7 * 24 * 60 },
|
||||
{ "day", tMINUTE_UNIT, 1 * 24 * 60 },
|
||||
{ "hour", tMINUTE_UNIT, 60 },
|
||||
{ "minute", tMINUTE_UNIT, 1 },
|
||||
{ "min", tMINUTE_UNIT, 1 },
|
||||
{ "second", tSEC_UNIT, 1 },
|
||||
{ "sec", tSEC_UNIT, 1 },
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
/* Assorted relative-time words. */
|
||||
static TABLE const OtherTable[] = {
|
||||
{ "tomorrow", tMINUTE_UNIT, 1 * 24 * 60 },
|
||||
{ "yesterday", tMINUTE_UNIT, -1 * 24 * 60 },
|
||||
{ "today", tMINUTE_UNIT, 0 },
|
||||
{ "now", tMINUTE_UNIT, 0 },
|
||||
{ "last", tUNUMBER, -1 },
|
||||
{ "this", tMINUTE_UNIT, 0 },
|
||||
{ "next", tUNUMBER, 2 },
|
||||
{ "first", tUNUMBER, 1 },
|
||||
/* { "second", tUNUMBER, 2 }, */
|
||||
{ "third", tUNUMBER, 3 },
|
||||
{ "fourth", tUNUMBER, 4 },
|
||||
{ "fifth", tUNUMBER, 5 },
|
||||
{ "sixth", tUNUMBER, 6 },
|
||||
{ "seventh", tUNUMBER, 7 },
|
||||
{ "eighth", tUNUMBER, 8 },
|
||||
{ "ninth", tUNUMBER, 9 },
|
||||
{ "tenth", tUNUMBER, 10 },
|
||||
{ "eleventh", tUNUMBER, 11 },
|
||||
{ "twelfth", tUNUMBER, 12 },
|
||||
{ "ago", tAGO, 1 },
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
/* The timezone table. */
|
||||
/* Some of these are commented out because a time_t can't store a float. */
|
||||
static TABLE const TimezoneTable[] = {
|
||||
{ "gmt", tZONE, HOUR( 0) }, /* Greenwich Mean */
|
||||
{ "ut", tZONE, HOUR( 0) }, /* Universal (Coordinated) */
|
||||
{ "utc", tZONE, HOUR( 0) },
|
||||
{ "wet", tZONE, HOUR( 0) }, /* Western European */
|
||||
{ "bst", tDAYZONE, HOUR( 0) }, /* British Summer */
|
||||
{ "wat", tZONE, HOUR( 1) }, /* West Africa */
|
||||
{ "at", tZONE, HOUR( 2) }, /* Azores */
|
||||
#if 0
|
||||
/* For completeness. BST is also British Summer, and GST is
|
||||
* also Guam Standard. */
|
||||
{ "bst", tZONE, HOUR( 3) }, /* Brazil Standard */
|
||||
{ "gst", tZONE, HOUR( 3) }, /* Greenland Standard */
|
||||
#endif
|
||||
#if 0
|
||||
{ "nft", tZONE, HOUR(3.5) }, /* Newfoundland */
|
||||
{ "nst", tZONE, HOUR(3.5) }, /* Newfoundland Standard */
|
||||
{ "ndt", tDAYZONE, HOUR(3.5) }, /* Newfoundland Daylight */
|
||||
#endif
|
||||
{ "ast", tZONE, HOUR( 4) }, /* Atlantic Standard */
|
||||
{ "adt", tDAYZONE, HOUR( 4) }, /* Atlantic Daylight */
|
||||
{ "est", tZONE, HOUR( 5) }, /* Eastern Standard */
|
||||
{ "edt", tDAYZONE, HOUR( 5) }, /* Eastern Daylight */
|
||||
{ "cst", tZONE, HOUR( 6) }, /* Central Standard */
|
||||
{ "cdt", tDAYZONE, HOUR( 6) }, /* Central Daylight */
|
||||
{ "mst", tZONE, HOUR( 7) }, /* Mountain Standard */
|
||||
{ "mdt", tDAYZONE, HOUR( 7) }, /* Mountain Daylight */
|
||||
{ "pst", tZONE, HOUR( 8) }, /* Pacific Standard */
|
||||
{ "pdt", tDAYZONE, HOUR( 8) }, /* Pacific Daylight */
|
||||
{ "yst", tZONE, HOUR( 9) }, /* Yukon Standard */
|
||||
{ "ydt", tDAYZONE, HOUR( 9) }, /* Yukon Daylight */
|
||||
{ "hst", tZONE, HOUR(10) }, /* Hawaii Standard */
|
||||
{ "hdt", tDAYZONE, HOUR(10) }, /* Hawaii Daylight */
|
||||
{ "cat", tZONE, HOUR(10) }, /* Central Alaska */
|
||||
{ "ahst", tZONE, HOUR(10) }, /* Alaska-Hawaii Standard */
|
||||
{ "nt", tZONE, HOUR(11) }, /* Nome */
|
||||
{ "idlw", tZONE, HOUR(12) }, /* International Date Line West */
|
||||
{ "cet", tZONE, -HOUR(1) }, /* Central European */
|
||||
{ "met", tZONE, -HOUR(1) }, /* Middle European */
|
||||
{ "mewt", tZONE, -HOUR(1) }, /* Middle European Winter */
|
||||
{ "mest", tDAYZONE, -HOUR(1) }, /* Middle European Summer */
|
||||
{ "swt", tZONE, -HOUR(1) }, /* Swedish Winter */
|
||||
{ "sst", tDAYZONE, -HOUR(1) }, /* Swedish Summer */
|
||||
{ "fwt", tZONE, -HOUR(1) }, /* French Winter */
|
||||
{ "fst", tDAYZONE, -HOUR(1) }, /* French Summer */
|
||||
{ "eet", tZONE, -HOUR(2) }, /* Eastern Europe, USSR Zone 1 */
|
||||
{ "bt", tZONE, -HOUR(3) }, /* Baghdad, USSR Zone 2 */
|
||||
#if 0
|
||||
{ "it", tZONE, -HOUR(3.5) },/* Iran */
|
||||
#endif
|
||||
{ "zp4", tZONE, -HOUR(4) }, /* USSR Zone 3 */
|
||||
{ "zp5", tZONE, -HOUR(5) }, /* USSR Zone 4 */
|
||||
#if 0
|
||||
{ "ist", tZONE, -HOUR(5.5) },/* Indian Standard */
|
||||
#endif
|
||||
{ "zp6", tZONE, -HOUR(6) }, /* USSR Zone 5 */
|
||||
#if 0
|
||||
/* For completeness. NST is also Newfoundland Stanard, and SST is
|
||||
* also Swedish Summer. */
|
||||
{ "nst", tZONE, -HOUR(6.5) },/* North Sumatra */
|
||||
{ "sst", tZONE, -HOUR(7) }, /* South Sumatra, USSR Zone 6 */
|
||||
#endif /* 0 */
|
||||
{ "wast", tZONE, -HOUR(7) }, /* West Australian Standard */
|
||||
{ "wadt", tDAYZONE, -HOUR(7) }, /* West Australian Daylight */
|
||||
#if 0
|
||||
{ "jt", tZONE, -HOUR(7.5) },/* Java (3pm in Cronusland!) */
|
||||
#endif
|
||||
{ "cct", tZONE, -HOUR(8) }, /* China Coast, USSR Zone 7 */
|
||||
{ "jst", tZONE, -HOUR(9) }, /* Japan Standard, USSR Zone 8 */
|
||||
#if 0
|
||||
{ "cast", tZONE, -HOUR(9.5) },/* Central Australian Standard */
|
||||
{ "cadt", tDAYZONE, -HOUR(9.5) },/* Central Australian Daylight */
|
||||
#endif
|
||||
{ "east", tZONE, -HOUR(10) }, /* Eastern Australian Standard */
|
||||
{ "eadt", tDAYZONE, -HOUR(10) }, /* Eastern Australian Daylight */
|
||||
{ "gst", tZONE, -HOUR(10) }, /* Guam Standard, USSR Zone 9 */
|
||||
{ "nzt", tZONE, -HOUR(12) }, /* New Zealand */
|
||||
{ "nzst", tZONE, -HOUR(12) }, /* New Zealand Standard */
|
||||
{ "nzdt", tDAYZONE, -HOUR(12) }, /* New Zealand Daylight */
|
||||
{ "idle", tZONE, -HOUR(12) }, /* International Date Line East */
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
/* Military timezone table. */
|
||||
static TABLE const MilitaryTable[] = {
|
||||
{ "a", tZONE, HOUR( 1) },
|
||||
{ "b", tZONE, HOUR( 2) },
|
||||
{ "c", tZONE, HOUR( 3) },
|
||||
{ "d", tZONE, HOUR( 4) },
|
||||
{ "e", tZONE, HOUR( 5) },
|
||||
{ "f", tZONE, HOUR( 6) },
|
||||
{ "g", tZONE, HOUR( 7) },
|
||||
{ "h", tZONE, HOUR( 8) },
|
||||
{ "i", tZONE, HOUR( 9) },
|
||||
{ "k", tZONE, HOUR( 10) },
|
||||
{ "l", tZONE, HOUR( 11) },
|
||||
{ "m", tZONE, HOUR( 12) },
|
||||
{ "n", tZONE, HOUR(- 1) },
|
||||
{ "o", tZONE, HOUR(- 2) },
|
||||
{ "p", tZONE, HOUR(- 3) },
|
||||
{ "q", tZONE, HOUR(- 4) },
|
||||
{ "r", tZONE, HOUR(- 5) },
|
||||
{ "s", tZONE, HOUR(- 6) },
|
||||
{ "t", tZONE, HOUR(- 7) },
|
||||
{ "u", tZONE, HOUR(- 8) },
|
||||
{ "v", tZONE, HOUR(- 9) },
|
||||
{ "w", tZONE, HOUR(-10) },
|
||||
{ "x", tZONE, HOUR(-11) },
|
||||
{ "y", tZONE, HOUR(-12) },
|
||||
{ "z", tZONE, HOUR( 0) },
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
/* ARGSUSED */
|
||||
static int
|
||||
yyerror(s)
|
||||
char *s __unused;
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static time_t
|
||||
ToSeconds(Hours, Minutes, Seconds, Meridian)
|
||||
time_t Hours;
|
||||
time_t Minutes;
|
||||
time_t Seconds;
|
||||
MERIDIAN Meridian;
|
||||
{
|
||||
if (Minutes < 0 || Minutes > 59 || Seconds < 0 || Seconds > 59)
|
||||
return -1;
|
||||
switch (Meridian) {
|
||||
case MER24:
|
||||
if (Hours < 0 || Hours > 23)
|
||||
return -1;
|
||||
return (Hours * 60L + Minutes) * 60L + Seconds;
|
||||
case MERam:
|
||||
if (Hours < 1 || Hours > 12)
|
||||
return -1;
|
||||
if (Hours == 12)
|
||||
Hours = 0;
|
||||
return (Hours * 60L + Minutes) * 60L + Seconds;
|
||||
case MERpm:
|
||||
if (Hours < 1 || Hours > 12)
|
||||
return -1;
|
||||
if (Hours == 12)
|
||||
Hours = 0;
|
||||
return ((Hours + 12) * 60L + Minutes) * 60L + Seconds;
|
||||
default:
|
||||
abort ();
|
||||
}
|
||||
/* NOTREACHED */
|
||||
}
|
||||
|
||||
|
||||
/* Year is either
|
||||
* A negative number, which means to use its absolute value (why?)
|
||||
* A number from 0 to 99, which means a year from 1900 to 1999, or
|
||||
* The actual year (>=100). */
|
||||
static time_t
|
||||
Convert(Month, Day, Year, Hours, Minutes, Seconds, Meridian, DSTmode)
|
||||
time_t Month;
|
||||
time_t Day;
|
||||
time_t Year;
|
||||
time_t Hours;
|
||||
time_t Minutes;
|
||||
time_t Seconds;
|
||||
MERIDIAN Meridian;
|
||||
DSTMODE DSTmode;
|
||||
{
|
||||
static int DaysInMonth[12] = {
|
||||
31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
|
||||
};
|
||||
time_t tod;
|
||||
time_t Julian;
|
||||
int i;
|
||||
|
||||
if (Year < 0)
|
||||
Year = -Year;
|
||||
if (Year < 69)
|
||||
Year += 2000;
|
||||
else if (Year < 100)
|
||||
Year += 1900;
|
||||
DaysInMonth[1] = Year % 4 == 0 && (Year % 100 != 0 || Year % 400 == 0)
|
||||
? 29 : 28;
|
||||
/* Checking for 2038 bogusly assumes that time_t is 32 bits. But
|
||||
I'm too lazy to try to check for time_t overflow in another way. */
|
||||
if (Year < EPOCH || Year > 2038
|
||||
|| Month < 1 || Month > 12
|
||||
/* Lint fluff: "conversion from long may lose accuracy" */
|
||||
|| Day < 1 || Day > DaysInMonth[(int)--Month])
|
||||
return -1;
|
||||
|
||||
for (Julian = Day - 1, i = 0; i < Month; i++)
|
||||
Julian += DaysInMonth[i];
|
||||
for (i = EPOCH; i < Year; i++)
|
||||
Julian += 365 + (i % 4 == 0);
|
||||
Julian *= SECSPERDAY;
|
||||
Julian += yyTimezone * 60L;
|
||||
if ((tod = ToSeconds(Hours, Minutes, Seconds, Meridian)) < 0)
|
||||
return -1;
|
||||
Julian += tod;
|
||||
if (DSTmode == DSTon
|
||||
|| (DSTmode == DSTmaybe && localtime(&Julian)->tm_isdst))
|
||||
Julian -= 60 * 60;
|
||||
return Julian;
|
||||
}
|
||||
|
||||
|
||||
static time_t
|
||||
DSTcorrect(Start, Future)
|
||||
time_t Start;
|
||||
time_t Future;
|
||||
{
|
||||
time_t StartDay;
|
||||
time_t FutureDay;
|
||||
|
||||
StartDay = (localtime(&Start)->tm_hour + 1) % 24;
|
||||
FutureDay = (localtime(&Future)->tm_hour + 1) % 24;
|
||||
return (Future - Start) + (StartDay - FutureDay) * 60L * 60L;
|
||||
}
|
||||
|
||||
|
||||
static time_t
|
||||
RelativeDate(Start, DayOrdinal, DayNumber)
|
||||
time_t Start;
|
||||
time_t DayOrdinal;
|
||||
time_t DayNumber;
|
||||
{
|
||||
struct tm *tm;
|
||||
time_t now;
|
||||
|
||||
now = Start;
|
||||
tm = localtime(&now);
|
||||
now += SECSPERDAY * ((DayNumber - tm->tm_wday + 7) % 7);
|
||||
now += 7 * SECSPERDAY * (DayOrdinal <= 0 ? DayOrdinal : DayOrdinal - 1);
|
||||
return DSTcorrect(Start, now);
|
||||
}
|
||||
|
||||
|
||||
static time_t
|
||||
RelativeMonth(Start, RelMonth)
|
||||
time_t Start;
|
||||
time_t RelMonth;
|
||||
{
|
||||
struct tm *tm;
|
||||
time_t Month;
|
||||
time_t Year;
|
||||
|
||||
if (RelMonth == 0)
|
||||
return 0;
|
||||
tm = localtime(&Start);
|
||||
Month = 12 * (tm->tm_year + 1900) + tm->tm_mon + RelMonth;
|
||||
Year = Month / 12;
|
||||
Month = Month % 12 + 1;
|
||||
return DSTcorrect(Start,
|
||||
Convert(Month, (time_t)tm->tm_mday, Year,
|
||||
(time_t)tm->tm_hour, (time_t)tm->tm_min, (time_t)tm->tm_sec,
|
||||
MER24, DSTmaybe));
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
LookupWord(buff)
|
||||
char *buff;
|
||||
{
|
||||
register char *p;
|
||||
register char *q;
|
||||
register const TABLE *tp;
|
||||
int i;
|
||||
int abbrev;
|
||||
|
||||
/* Make it lowercase. */
|
||||
for (p = buff; *p; p++)
|
||||
if (isupper(*p))
|
||||
*p = tolower(*p);
|
||||
|
||||
if (strcmp(buff, "am") == 0 || strcmp(buff, "a.m.") == 0) {
|
||||
yylval.Meridian = MERam;
|
||||
return tMERIDIAN;
|
||||
}
|
||||
if (strcmp(buff, "pm") == 0 || strcmp(buff, "p.m.") == 0) {
|
||||
yylval.Meridian = MERpm;
|
||||
return tMERIDIAN;
|
||||
}
|
||||
|
||||
/* See if we have an abbreviation for a month. */
|
||||
if (strlen(buff) == 3)
|
||||
abbrev = 1;
|
||||
else if (strlen(buff) == 4 && buff[3] == '.') {
|
||||
abbrev = 1;
|
||||
buff[3] = '\0';
|
||||
}
|
||||
else
|
||||
abbrev = 0;
|
||||
|
||||
for (tp = MonthDayTable; tp->name; tp++) {
|
||||
if (abbrev) {
|
||||
if (strncmp(buff, tp->name, 3) == 0) {
|
||||
yylval.Number = tp->value;
|
||||
return tp->type;
|
||||
}
|
||||
}
|
||||
else if (strcmp(buff, tp->name) == 0) {
|
||||
yylval.Number = tp->value;
|
||||
return tp->type;
|
||||
}
|
||||
}
|
||||
|
||||
for (tp = TimezoneTable; tp->name; tp++)
|
||||
if (strcmp(buff, tp->name) == 0) {
|
||||
yylval.Number = tp->value;
|
||||
return tp->type;
|
||||
}
|
||||
|
||||
if (strcmp(buff, "dst") == 0)
|
||||
return tDST;
|
||||
|
||||
for (tp = UnitsTable; tp->name; tp++)
|
||||
if (strcmp(buff, tp->name) == 0) {
|
||||
yylval.Number = tp->value;
|
||||
return tp->type;
|
||||
}
|
||||
|
||||
/* Strip off any plural and try the units table again. */
|
||||
i = strlen(buff) - 1;
|
||||
if (buff[i] == 's') {
|
||||
buff[i] = '\0';
|
||||
for (tp = UnitsTable; tp->name; tp++)
|
||||
if (strcmp(buff, tp->name) == 0) {
|
||||
yylval.Number = tp->value;
|
||||
return tp->type;
|
||||
}
|
||||
buff[i] = 's'; /* Put back for "this" in OtherTable. */
|
||||
}
|
||||
|
||||
for (tp = OtherTable; tp->name; tp++)
|
||||
if (strcmp(buff, tp->name) == 0) {
|
||||
yylval.Number = tp->value;
|
||||
return tp->type;
|
||||
}
|
||||
|
||||
/* Military timezones. */
|
||||
if (buff[1] == '\0' && isalpha(*buff)) {
|
||||
for (tp = MilitaryTable; tp->name; tp++)
|
||||
if (strcmp(buff, tp->name) == 0) {
|
||||
yylval.Number = tp->value;
|
||||
return tp->type;
|
||||
}
|
||||
}
|
||||
|
||||
/* Drop out any periods and try the timezone table again. */
|
||||
for (i = 0, p = q = buff; *q; q++)
|
||||
if (*q != '.')
|
||||
*p++ = *q;
|
||||
else
|
||||
i++;
|
||||
*p = '\0';
|
||||
if (i)
|
||||
for (tp = TimezoneTable; tp->name; tp++)
|
||||
if (strcmp(buff, tp->name) == 0) {
|
||||
yylval.Number = tp->value;
|
||||
return tp->type;
|
||||
}
|
||||
|
||||
return tID;
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
yylex()
|
||||
{
|
||||
register char c;
|
||||
register char *p;
|
||||
char buff[20];
|
||||
int Count;
|
||||
int sign;
|
||||
|
||||
for ( ; ; ) {
|
||||
while (isspace(*yyInput))
|
||||
yyInput++;
|
||||
|
||||
if (isdigit(c = *yyInput) || c == '-' || c == '+') {
|
||||
if (c == '-' || c == '+') {
|
||||
sign = c == '-' ? -1 : 1;
|
||||
if (!isdigit(*++yyInput))
|
||||
/* skip the '-' sign */
|
||||
continue;
|
||||
}
|
||||
else
|
||||
sign = 0;
|
||||
for (yylval.Number = 0; isdigit(c = *yyInput++); )
|
||||
yylval.Number = 10 * yylval.Number + c - '0';
|
||||
yyInput--;
|
||||
if (sign < 0)
|
||||
yylval.Number = -yylval.Number;
|
||||
return sign ? tSNUMBER : tUNUMBER;
|
||||
}
|
||||
if (isalpha(c)) {
|
||||
for (p = buff; isalpha(c = *yyInput++) || c == '.'; )
|
||||
if (p < &buff[sizeof buff - 1])
|
||||
*p++ = c;
|
||||
*p = '\0';
|
||||
yyInput--;
|
||||
return LookupWord(buff);
|
||||
}
|
||||
if (c != '(')
|
||||
return *yyInput++;
|
||||
Count = 0;
|
||||
do {
|
||||
c = *yyInput++;
|
||||
if (c == '\0')
|
||||
return c;
|
||||
if (c == '(')
|
||||
Count++;
|
||||
else if (c == ')')
|
||||
Count--;
|
||||
} while (Count > 0);
|
||||
}
|
||||
}
|
||||
|
||||
#define TM_YEAR_ORIGIN 1900
|
||||
|
||||
/* Yield A - B, measured in seconds. */
|
||||
static long
|
||||
difftm (a, b)
|
||||
struct tm *a, *b;
|
||||
{
|
||||
int ay = a->tm_year + (TM_YEAR_ORIGIN - 1);
|
||||
int by = b->tm_year + (TM_YEAR_ORIGIN - 1);
|
||||
int days = (
|
||||
/* difference in day of year */
|
||||
a->tm_yday - b->tm_yday
|
||||
/* + intervening leap days */
|
||||
+ ((ay >> 2) - (by >> 2))
|
||||
- (ay/100 - by/100)
|
||||
+ ((ay/100 >> 2) - (by/100 >> 2))
|
||||
/* + difference in years * 365 */
|
||||
+ (long)(ay-by) * 365
|
||||
);
|
||||
return (60*(60*(24*days + (a->tm_hour - b->tm_hour))
|
||||
+ (a->tm_min - b->tm_min))
|
||||
+ (a->tm_sec - b->tm_sec));
|
||||
}
|
||||
|
||||
time_t
|
||||
get_date(p, now)
|
||||
char *p;
|
||||
struct timeb *now;
|
||||
{
|
||||
struct tm *tm, gmt;
|
||||
struct timeb ftz;
|
||||
time_t Start;
|
||||
time_t tod;
|
||||
time_t nowtime;
|
||||
|
||||
yyInput = p;
|
||||
if (now == NULL) {
|
||||
struct tm *gmt_ptr;
|
||||
|
||||
now = &ftz;
|
||||
(void)time (&nowtime);
|
||||
|
||||
gmt_ptr = gmtime (&nowtime);
|
||||
if (gmt_ptr != NULL)
|
||||
{
|
||||
/* Make a copy, in case localtime modifies *tm (I think
|
||||
that comment now applies to *gmt_ptr, but I am too
|
||||
lazy to dig into how gmtime and locatime allocate the
|
||||
structures they return pointers to). */
|
||||
gmt = *gmt_ptr;
|
||||
}
|
||||
|
||||
if (! (tm = localtime (&nowtime)))
|
||||
return -1;
|
||||
|
||||
if (gmt_ptr != NULL)
|
||||
ftz.timezone = difftm (&gmt, tm) / 60;
|
||||
else
|
||||
/* We are on a system like VMS, where the system clock is
|
||||
in local time and the system has no concept of timezones.
|
||||
Hopefully we can fake this out (for the case in which the
|
||||
user specifies no timezone) by just saying the timezone
|
||||
is zero. */
|
||||
ftz.timezone = 0;
|
||||
|
||||
if(tm->tm_isdst)
|
||||
ftz.timezone += 60;
|
||||
}
|
||||
else
|
||||
{
|
||||
nowtime = now->time;
|
||||
}
|
||||
|
||||
tm = localtime(&nowtime);
|
||||
yyYear = tm->tm_year + 1900;
|
||||
yyMonth = tm->tm_mon + 1;
|
||||
yyDay = tm->tm_mday;
|
||||
yyTimezone = now->timezone;
|
||||
yyDSTmode = DSTmaybe;
|
||||
yyHour = 0;
|
||||
yyMinutes = 0;
|
||||
yySeconds = 0;
|
||||
yyMeridian = MER24;
|
||||
yyRelSeconds = 0;
|
||||
yyRelMonth = 0;
|
||||
yyHaveDate = 0;
|
||||
yyHaveDay = 0;
|
||||
yyHaveRel = 0;
|
||||
yyHaveTime = 0;
|
||||
yyHaveZone = 0;
|
||||
|
||||
if (yyparse()
|
||||
|| yyHaveTime > 1 || yyHaveZone > 1 || yyHaveDate > 1 || yyHaveDay > 1)
|
||||
return -1;
|
||||
|
||||
if (yyHaveDate || yyHaveTime || yyHaveDay) {
|
||||
Start = Convert(yyMonth, yyDay, yyYear, yyHour, yyMinutes, yySeconds,
|
||||
yyMeridian, yyDSTmode);
|
||||
if (Start < 0)
|
||||
return -1;
|
||||
}
|
||||
else {
|
||||
Start = nowtime;
|
||||
if (!yyHaveRel)
|
||||
Start -= ((tm->tm_hour * 60L + tm->tm_min) * 60L) + tm->tm_sec;
|
||||
}
|
||||
|
||||
Start += yyRelSeconds;
|
||||
Start += RelativeMonth(Start, yyRelMonth);
|
||||
|
||||
if (yyHaveDay && !yyHaveDate) {
|
||||
tod = RelativeDate(Start, yyDayOrdinal, yyDayNumber);
|
||||
Start += tod;
|
||||
}
|
||||
|
||||
/* Have to do *something* with a legitimate -1 so it's distinguishable
|
||||
* from the error return value. (Alternately could set errno on error.) */
|
||||
return Start == -1 ? 0 : Start;
|
||||
}
|
||||
|
||||
|
||||
#if defined(TEST)
|
||||
|
||||
/* ARGSUSED */
|
||||
int
|
||||
main(ac, av)
|
||||
int ac;
|
||||
char *av[];
|
||||
{
|
||||
char buff[128];
|
||||
time_t d;
|
||||
|
||||
(void)printf("Enter date, or blank line to exit.\n\t> ");
|
||||
(void)fflush(stdout);
|
||||
while (gets(buff) && buff[0]) {
|
||||
d = get_date(buff, (struct timeb *)NULL);
|
||||
if (d == -1)
|
||||
(void)printf("Bad format - couldn't convert.\n");
|
||||
else
|
||||
(void)printf("%s", ctime(&d));
|
||||
(void)printf("\t> ");
|
||||
(void)fflush(stdout);
|
||||
}
|
||||
exit(0);
|
||||
/* NOTREACHED */
|
||||
}
|
||||
#endif /* defined(TEST) */
|
||||
@@ -1,36 +0,0 @@
|
||||
# $FreeBSD$
|
||||
|
||||
PROG= getconf
|
||||
|
||||
SRCS= confstr.c getconf.c limits.c pathconf.c progenv.c sysconf.c
|
||||
CFLAGS+= -I${.CURDIR}
|
||||
CLEANFILES+= confstr.c limits.c pathconf.c progenv.c sysconf.c \
|
||||
confstr.names limits.names pathconf.names sysconf.names \
|
||||
conflicting.names unique.names
|
||||
|
||||
.SUFFIXES: .gperf .names
|
||||
.PHONY: conflicts
|
||||
|
||||
all: conflicts
|
||||
|
||||
.gperf.c:
|
||||
awk -f ${.CURDIR}/fake-gperf.awk ${.IMPSRC} >${.TARGET}
|
||||
|
||||
.gperf.names:
|
||||
awk '/^[_A-Z]/ { print; }' ${.IMPSRC} | sed -e 's/,$$//' >${.TARGET}
|
||||
|
||||
conflicts: conflicting.names unique.names
|
||||
@if test `wc -l <conflicting.names` != `wc -l <unique.names`; then \
|
||||
echo "Name conflicts found!" >&2; \
|
||||
exit 1; \
|
||||
fi
|
||||
|
||||
# pathconf.names is not included here because pathconf names are
|
||||
# syntactically distinct from the other kinds.
|
||||
conflicting.names: confstr.names limits.names sysconf.names
|
||||
cat ${.ALLSRC} >${.TARGET}
|
||||
|
||||
unique.names: conflicting.names
|
||||
sort -u ${.ALLSRC} >${.TARGET}
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
@@ -1,70 +0,0 @@
|
||||
%{
|
||||
/*
|
||||
* Copyright is disclaimed as to the contents of this file.
|
||||
*
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "getconf.h"
|
||||
|
||||
/*
|
||||
* Override gperf's built-in external scope.
|
||||
*/
|
||||
static const struct map *in_word_set(const char *str, unsigned int len);
|
||||
|
||||
/*
|
||||
* The Standard seems a bit ambiguous over whether the POSIX_V6_*
|
||||
* are specified with or without a leading underscore, so we just
|
||||
* use both.
|
||||
*/
|
||||
%}
|
||||
struct map { const char *name; int key; int valid; };
|
||||
%%
|
||||
PATH, _CS_PATH
|
||||
POSIX_V6_ILP32_OFF32_CFLAGS, _CS_POSIX_V6_ILP32_OFF32_CFLAGS
|
||||
POSIX_V6_ILP32_OFF32_LDFLAGS, _CS_POSIX_V6_ILP32_OFF32_LDFLAGS
|
||||
POSIX_V6_ILP32_OFF32_LIBS, _CS_POSIX_V6_ILP32_OFF32_LIBS
|
||||
POSIX_V6_ILP32_OFFBIG_CFLAGS, _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS
|
||||
POSIX_V6_ILP32_OFFBIG_LDFLAGS, _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS
|
||||
POSIX_V6_ILP32_OFFBIG_LIBS, _CS_POSIX_V6_ILP32_OFFBIG_LIBS
|
||||
POSIX_V6_LP64_OFF64_CFLAGS, _CS_POSIX_V6_LP64_OFF64_CFLAGS
|
||||
POSIX_V6_LP64_OFF64_LDFLAGS, _CS_POSIX_V6_LP64_OFF64_LDFLAGS
|
||||
POSIX_V6_LP64_OFF64_LIBS, _CS_POSIX_V6_LP64_OFF64_LIBS
|
||||
POSIX_V6_LPBIG_OFFBIG_CFLAGS, _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS
|
||||
POSIX_V6_LPBIG_OFFBIG_LDFLAGS, _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS
|
||||
POSIX_V6_LPBIG_OFFBIG_LIBS, _CS_POSIX_V6_LPBIG_OFFBIG_LIBS
|
||||
POSIX_V6_WIDTH_RESTRICTED_ENVS, _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS
|
||||
_POSIX_V6_ILP32_OFF32_CFLAGS, _CS_POSIX_V6_ILP32_OFF32_CFLAGS
|
||||
_POSIX_V6_ILP32_OFF32_LDFLAGS, _CS_POSIX_V6_ILP32_OFF32_LDFLAGS
|
||||
_POSIX_V6_ILP32_OFF32_LIBS, _CS_POSIX_V6_ILP32_OFF32_LIBS
|
||||
_POSIX_V6_ILP32_OFFBIG_CFLAGS, _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS
|
||||
_POSIX_V6_ILP32_OFFBIG_LDFLAGS, _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS
|
||||
_POSIX_V6_ILP32_OFFBIG_LIBS, _CS_POSIX_V6_ILP32_OFFBIG_LIBS
|
||||
_POSIX_V6_LP64_OFF64_CFLAGS, _CS_POSIX_V6_LP64_OFF64_CFLAGS
|
||||
_POSIX_V6_LP64_OFF64_LDFLAGS, _CS_POSIX_V6_LP64_OFF64_LDFLAGS
|
||||
_POSIX_V6_LP64_OFF64_LIBS, _CS_POSIX_V6_LP64_OFF64_LIBS
|
||||
_POSIX_V6_LPBIG_OFFBIG_CFLAGS, _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS
|
||||
_POSIX_V6_LPBIG_OFFBIG_LDFLAGS, _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS
|
||||
_POSIX_V6_LPBIG_OFFBIG_LIBS, _CS_POSIX_V6_LPBIG_OFFBIG_LIBS
|
||||
_POSIX_V6_WIDTH_RESTRICTED_ENVS, _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS
|
||||
%%
|
||||
int
|
||||
find_confstr(const char *name, int *key)
|
||||
{
|
||||
const struct map *rv;
|
||||
|
||||
rv = in_word_set(name, strlen(name));
|
||||
if (rv != NULL) {
|
||||
if (rv->valid) {
|
||||
*key = rv->key;
|
||||
return 1;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -1,68 +0,0 @@
|
||||
#!/usr/bin/awk -f
|
||||
# $FreeBSD$
|
||||
BEGIN {
|
||||
state = 0;
|
||||
struct_seen = "";
|
||||
}
|
||||
/^%{$/ && state == 0 {
|
||||
state = 1;
|
||||
next;
|
||||
}
|
||||
/^%}$/ && state == 1 {
|
||||
state = 0;
|
||||
next;
|
||||
}
|
||||
state == 1 { print; next; }
|
||||
/^struct/ && state == 0 {
|
||||
print;
|
||||
struct_seen = $2;
|
||||
next;
|
||||
}
|
||||
/^%%$/ && state == 0 {
|
||||
state = 2;
|
||||
print "#include <stddef.h>";
|
||||
print "#include <string.h>";
|
||||
if (struct_seen !~ /^$/) {
|
||||
print "static const struct", struct_seen, "wordlist[] = {";
|
||||
} else {
|
||||
print "static const struct map {";
|
||||
print "\tconst char *name;";
|
||||
print "\tint key;";
|
||||
print "\tint valid;";
|
||||
print "} wordlist[] = {";
|
||||
struct_seen = "map";
|
||||
}
|
||||
next;
|
||||
}
|
||||
/^%%$/ && state == 2 {
|
||||
state = 3;
|
||||
print "\t{ NULL }";
|
||||
print "};";
|
||||
print "#define\tNWORDS\t(sizeof(wordlist)/sizeof(wordlist[0]) - 1)";
|
||||
print "static const struct map *";
|
||||
print "in_word_set(const char *word, unsigned int len)";
|
||||
print "{";
|
||||
print "\tconst struct", struct_seen, "*mp;";
|
||||
print "";
|
||||
print "\tfor (mp = wordlist; mp < &wordlist[NWORDS]; mp++) {";
|
||||
print "\t\tif (strcmp(word, mp->name) == 0)";
|
||||
print "\t\t\treturn (mp);";
|
||||
print "\t}";
|
||||
print "\treturn (NULL);";
|
||||
print "}";
|
||||
print "";
|
||||
next;
|
||||
}
|
||||
state == 2 && NF == 2 {
|
||||
name = substr($1, 1, length($1) - 1);
|
||||
printf "#ifdef %s\n", $2;
|
||||
printf "\t{ \"%s\", %s, 1 },\n", name, $2;
|
||||
print "#else";
|
||||
printf "\t{ \"%s\", 0, 0 },\n", name, $2;
|
||||
print "#endif"
|
||||
next;
|
||||
}
|
||||
state == 3 { print; next; }
|
||||
{
|
||||
# eat anything not matched.
|
||||
}
|
||||
Loaded 100 of 115 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user