Changeset 7eab0f78 in rtems for c/src/lib/libbsp/m68k/uC5282


Ignore:
Timestamp:
Feb 1, 2005, 5:16:41 PM (16 years ago)
Author:
Eric Norum <WENorum@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
c60eccb
Parents:
891aa12e
Message:

Add some bootrom system calls.

Location:
c/src/lib/libbsp/m68k/uC5282
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/m68k/uC5282/ChangeLog

    r891aa12e r7eab0f78  
     12005-02-01  Eric Norum <norume@aps.anl.gov>
     2
     3        * include/bsp.h, network/network.c, startup/bspstart.c: Add some
     4          bootprom system calls.
     5
    162005-02-01  Eric Norum <norume@aps.anl.gov>
    27
  • c/src/lib/libbsp/m68k/uC5282/include/bsp.h

    r891aa12e r7eab0f78  
    6969
    7070unsigned32 get_CPU_clock_speed(void);
     71unsigned const char *uC5282_gethwaddr(int a);
     72char *uC5282_getbenv(const char *a);
     73
    7174void bsp_cleanup(void);
    7275
  • c/src/lib/libbsp/m68k/uC5282/network/network.c

    r891aa12e r7eab0f78  
    138138        bdp = (mcf5282BufferDescriptor_t *)((char *)bdp + (16 - ((int)bdp & 0xF)));
    139139    return p;
    140 }
    141 
    142 /*
    143  * Retrieve MAC address from bootloader environment variable area.
    144  * Parameter is interface number (0 or 1).
    145  */
    146 static unsigned char *
    147 gethwaddr(int a)
    148 {
    149    register long __res __asm__ ("%d2") = 12;
    150    register long __a __asm__ ("%d1") = (long)a;
    151    __asm__ __volatile__ ("trap #2" \
    152                          : "=g" (__res) \
    153                          : "0" (__res), "d" (__a) \
    154                          : "%d0");
    155    return (unsigned char *)(__res);
    156140}
    157141
     
    795779        hwaddr = config->hardware_address;
    796780    else
    797         hwaddr = gethwaddr(unitNumber - 1);
     781        hwaddr = uC5282_gethwaddr(unitNumber - 1);
    798782    printf("%s%d: Ethernet address: %02x:%02x:%02x:%02x:%02x:%02x\n",
    799783                                            unitName, unitNumber,
  • c/src/lib/libbsp/m68k/uC5282/startup/bspstart.c

    r891aa12e r7eab0f78  
    2727#include <rtems/libcsupport.h>
    2828#include <string.h>
     29#include <errno.h>
    2930 
    3031/*
     
    251252    return( (unsigned32)_CPUClockSpeed);
    252253}
     254
     255/*
     256 * Arcturus routines for getting value from bootloader
     257 */
     258#define __bsc_return(type, res) \
     259do { \
     260   if ((unsigned long)(res) >= (unsigned long)(-64)) { \
     261      errno = -(res); \
     262      res = -1; \
     263   } \
     264   return (type)(res); \
     265} while (0)
     266#define _bsc1(type,name,atype,a) \
     267type uC5282_##name(atype a) \
     268{ \
     269   long __res; \
     270   register long __a __asm__ ("%d1") = (long)a; \
     271   __asm__ __volatile__ ("move.l %0,%%d0\n\t"   \
     272                         "trap #2\n\t"          \
     273                         "move.l %%d0,%0"       \
     274                         : "=d" (__res)         \
     275                         : "0" (__BN_##name), "d" (__a) \
     276                         : "d0" ); \
     277   __bsc_return(type,__res); \
     278}
     279#define __BN_gethwaddr    12 /* get the hardware address of my interfaces */
     280#define __BN_getbenv      14 /* get a bootloader envvar */
     281#define __BN_setbenv      15 /* get a bootloader envvar */
     282_bsc1(unsigned const char *, gethwaddr, int, a)
     283_bsc1(char *, getbenv, const char *, a)
Note: See TracChangeset for help on using the changeset viewer.