aboutsummaryrefslogtreecommitdiff
path: root/board-js2x/slof/io.fs
blob: 3d55493b7af5fb7138fbd9aeb4efea6cfb747a85 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
\ =============================================================================
\  * Copyright (c) 2004, 2005 IBM Corporation
\  * All rights reserved. 
\  * This program and the accompanying materials 
\  * are made available under the terms of the BSD License 
\  * which accompanies this distribution, and is available at
\  * http://www.opensource.org/licenses/bsd-license.php
\  * 
\  * Contributors:
\  *     IBM Corporation - initial implementation
\ =============================================================================


\ I/O accesses.

\ Little-endian accesses.  Also known as `wrong-endian'.
: l!-le  >r lbflip r> l! ;
: l@-le  l@ lbflip ;

: w!-le  >r wbflip r> w! ;
: w@-le  w@ wbflip ;

: rl!-le  >r lbflip r> rl! ;
: rl@-le  rl@ lbflip ;

: rw!-le  >r wbflip r> rw! ;
: rw@-le  rw@ wbflip ;

\ Legacy I/O accesses.
: >io  f4000000 + ;

: io-c!  >io rb! ;
: io-c@  >io rb@ ;

: io-w!  >io rw! ;
: io-w@  >io rw@ ;

\ Accessing the SIO config registers.
: siocfg!  2e io-c! 2f io-c! ;
: siocfg@  2e io-c! 2f io-c@ ;

\ Configuration space accesses.
: >config  dup ffff > IF 1000000 + THEN f2000000 + ;
: config-l!  >config rl!-le ;
: config-l@  >config rl@-le ;
: config-w!  >config rw!-le ;
: config-w@  >config rw@-le ;
: config-b!  >config rb! ;
: config-b@  >config rb@ ;