- /* Hack-o-matic: if we are using the flat24 model,
- * adjust pointer sizes.
- */
- if (options.model == MODEL_FLAT24)
- {
- port->s.fptr_size = 3;
- port->s.gptr_size = 4;
- port->stack.isr_overhead++; /* Will save dpx on ISR entry. */
- #if 1
- port->stack.call_overhead++; /* This acounts for the extra byte
- * of return addres on the stack.
- * but is ugly. There must be a
- * better way.
- */
- #endif
- fReturn = fReturn390;
- fReturnSize = 5;
- }
+ /* the first eight bytes will be passed in
+ registers r16-r23. but we won't split variables
+ i.e. if not enough registers left to hold
+ the parameter then the whole parameter along
+ with rest of the parameters go onto the stack */
+ if (regParmFlg < 8) {
+ int size;
+ if ((size = getSize (l)) > (8 - regParmFlg)) {
+ /* all remaining go on stack */
+ regParmFlg = 8;
+ return 0;
+ }
+ regParmFlg += size;
+ return 1;
+ }
+
+ return 0;
+}
+
+void avr_assignRegisters (eBBlock ** ebbs, int count);
+
+static bool
+_avr_parseOptions (int *pargc, char **argv, int *i)
+{
+ /* TODO: allow port-specific command line options to specify
+ * segment names here.
+ */
+ return FALSE;
+}
+
+static void
+_avr_finaliseOptions (void)
+{
+ port->mem.default_local_map = port->mem.default_globl_map = xdata;
+ /* change stack to be in far space */
+ /* internal stack segment ;
+ SFRSPACE - NO
+ FAR-SPACE - YES
+ PAGED - NO
+ DIRECT-ACCESS - NO
+ BIT-ACCESS - NO
+ CODE-ACESS - NO
+ DEBUG-NAME - 'B'
+ POINTER-TYPE - FPOINTER
+ */
+ istack =
+ allocMap (0, 1, 0, 0, 0, 0, options.stack_loc, ISTACK_NAME,
+ 'B', FPOINTER);
+
+ /* also change xdata to be direct space since we can use lds/sts */
+ xdata->direct = 1;
+