; Copyright 2012 Castle Technology Ltd ; ; Licensed under the Apache License, Version 2.0 (the "License"); ; you may not use this file except in compliance with the License. ; You may obtain a copy of the License at ; ; http://www.apache.org/licenses/LICENSE-2.0 ; ; Unless required by applicable law or agreed to in writing, software ; distributed under the License is distributed on an "AS IS" BASIS, ; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ; See the License for the specific language governing permissions and ; limitations under the License. ; MACRO HALEntry $name ASSERT (. - $table) / 4 = EntryNo_$name DCD $name - $table MEND MACRO VarEntry $name ASSERT (. - $table) / 4 = EntryNo_$name [ $table_idx == 0 DCD ARM11_$name - $table ELIF $table_idx == 1 DCD QA7_$name - $table | DCD VC6_$name - $table ] MEND MACRO NullEntry DCD HAL_Null - $table MEND MACRO CallOSM $entry, $reg LDR ip, [v8, #$entry*4] MOV lr, pc ADD pc, v8, ip MEND MACRO CallOS $entry, $tailcall ASSERT $entry <= HighestOSEntry [ "$tailcall"="" MOV lr, pc | [ "$tailcall"<>"tailcall" ! 0, "Unrecognised parameter to CallOS" ] ] LDR pc, OSentries + 4*$entry MEND END