summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/dev/aic7xxx/aicasm/Makefile2
-rw-r--r--sys/dev/aic7xxx/aicasm/aicasm_gram.y22
-rw-r--r--sys/dev/aic7xxx/aicasm/aicasm_macro_scan.l3
-rw-r--r--sys/dev/aic7xxx/aicasm/aicasm_scan.l3
-rw-r--r--sys/dev/aic7xxx/aicasm/aicasm_symbol.c3
5 files changed, 26 insertions, 7 deletions
diff --git a/sys/dev/aic7xxx/aicasm/Makefile b/sys/dev/aic7xxx/aicasm/Makefile
index 8d9a9af2e929..fe222fed485e 100644
--- a/sys/dev/aic7xxx/aicasm/Makefile
+++ b/sys/dev/aic7xxx/aicasm/Makefile
@@ -1,4 +1,4 @@
-# $Id: //depot/aic7xxx/freebsd/dev/aic7xxx/aicasm/Makefile#1 $
+# $Id: //depot/aic7xxx/freebsd/dev/aic7xxx/aicasm/Makefile#2 $
#
# $FreeBSD$
diff --git a/sys/dev/aic7xxx/aicasm/aicasm_gram.y b/sys/dev/aic7xxx/aicasm/aicasm_gram.y
index d6ba9931315f..0d2ff3ee7213 100644
--- a/sys/dev/aic7xxx/aicasm/aicasm_gram.y
+++ b/sys/dev/aic7xxx/aicasm/aicasm_gram.y
@@ -38,11 +38,12 @@
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*
- * $Id: //depot/aic7xxx/aic7xxx/aicasm/aicasm_gram.y#21 $
+ * $Id: //depot/aic7xxx/aic7xxx/aicasm/aicasm_gram.y#24 $
*
* $FreeBSD$
*/
+#include <inttypes.h>
#include <sys/types.h>
#include <inttypes.h>
@@ -937,6 +938,8 @@ immediate_or_a:
| T_A
{
SLIST_INIT(&$$.referenced_syms);
+ symlist_add(&$$.referenced_syms, accumulator.symbol,
+ SYMLIST_INSERT_HEAD);
$$.value = 0;
}
;
@@ -1236,9 +1239,22 @@ code:
;
code:
- T_MVI destination ',' immediate_or_a ret ';'
+ T_MVI destination ',' immediate ret ';'
{
- format_1_instr(AIC_OP_OR, &$2, &$4, &allzeros, $5);
+ if ($4.value == 0
+ && is_download_const(&$4) == 0) {
+ expression_t immed;
+
+ /*
+ * Allow move immediates of 0 so that macros,
+ * that can't know the immediate's value and
+ * otherwise compensate, still work.
+ */
+ make_expression(&immed, 0xff);
+ format_1_instr(AIC_OP_AND, &$2, &immed, &allzeros, $5);
+ } else {
+ format_1_instr(AIC_OP_OR, &$2, &$4, &allzeros, $5);
+ }
}
;
diff --git a/sys/dev/aic7xxx/aicasm/aicasm_macro_scan.l b/sys/dev/aic7xxx/aicasm/aicasm_macro_scan.l
index 112febf8c5fa..a5bd7f09bad6 100644
--- a/sys/dev/aic7xxx/aicasm/aicasm_macro_scan.l
+++ b/sys/dev/aic7xxx/aicasm/aicasm_macro_scan.l
@@ -38,11 +38,12 @@
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*
- * $Id: //depot/aic7xxx/aic7xxx/aicasm/aicasm_macro_scan.l#4 $
+ * $Id: //depot/aic7xxx/aic7xxx/aicasm/aicasm_macro_scan.l#6 $
*
* $FreeBSD$
*/
+#include <inttypes.h>
#include <sys/types.h>
#include <limits.h>
diff --git a/sys/dev/aic7xxx/aicasm/aicasm_scan.l b/sys/dev/aic7xxx/aicasm/aicasm_scan.l
index 14a7458117cf..11828f2bce8a 100644
--- a/sys/dev/aic7xxx/aicasm/aicasm_scan.l
+++ b/sys/dev/aic7xxx/aicasm/aicasm_scan.l
@@ -38,11 +38,12 @@
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*
- * $Id: //depot/aic7xxx/aic7xxx/aicasm/aicasm_scan.l#16 $
+ * $Id: //depot/aic7xxx/aic7xxx/aicasm/aicasm_scan.l#17 $
*
* $FreeBSD$
*/
+#include <inttypes.h>
#include <sys/types.h>
#include <limits.h>
diff --git a/sys/dev/aic7xxx/aicasm/aicasm_symbol.c b/sys/dev/aic7xxx/aicasm/aicasm_symbol.c
index db8469690b04..19155372d058 100644
--- a/sys/dev/aic7xxx/aicasm/aicasm_symbol.c
+++ b/sys/dev/aic7xxx/aicasm/aicasm_symbol.c
@@ -37,11 +37,12 @@
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*
- * $Id: //depot/aic7xxx/aic7xxx/aicasm/aicasm_symbol.c#21 $
+ * $Id: //depot/aic7xxx/aic7xxx/aicasm/aicasm_symbol.c#22 $
*
* $FreeBSD$
*/
+#include <inttypes.h>
#include <sys/types.h>
#ifdef __linux__