Changeset e2d79559 in rtems
- Timestamp:
- 04/09/97 14:05:50 (27 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- 48d6de3
- Parents:
- bed475e
- Files:
-
- 3 added
- 39 edited
Legend:
- Unmodified
- Added
- Removed
-
Makefile.in
rbed475e re2d79559 42 42 PROJECT_ROOT = @PROJECT_ROOT@ 43 43 RTEMS_HAS_POSIX_API = @RTEMS_HAS_POSIX_API@ 44 RTEMS_HAS_KA9Q = @RTEMS_HAS_KA9Q@ 44 45 RTEMS_USE_MACROS = @RTEMS_USE_MACROS@ 45 46 … … 84 85 \"PROJECT_ROOT=$(PROJECT_ROOT)\" \ 85 86 \"RTEMS_HAS_POSIX_API=$(RTEMS_HAS_POSIX_API)\" \ 87 \"RTEMS_HAS_KA9Q=$(RTEMS_HAS_KA9Q)\" \ 86 88 \"RTEMS_USE_MACROS=$(RTEMS_USE_MACROS)\" \ 87 89 \"AWK=$(AWK)\" $@" ; \ -
c/ACKNOWLEDGEMENTS
rbed475e re2d79559 93 93 autoconf. This effort is greatly appreciated. 94 94 95 + Eric Norum (eric@skatter.usask.ca) of the Saskatchewan Accelerator 96 Laboratory submitted the port of the ka9q tcp/ip stack to rtems 97 and a network driver for the `gen68360' BSP. 98 95 99 Finally, the RTEMS project would like to thank those who have contributed 96 100 to the other free software efforts which RTEMS utilizes. The primary RTEMS -
c/Makefile.in
rbed475e re2d79559 28 28 SUB_DIRS=build-tools src 29 29 30 # We only make the ka9q install point if it is enabled. 31 LIBKA9Q_yes_V = include/ka9q 32 LIBKA9Q = $(LIBKA9Q_$(HAS_KA9Q)_V) 33 30 34 # directories to be created in install point 31 35 CREATE_DIRS = include include/sys \ 32 36 include/rtems include/rtems/score include/rtems/rtems include/rtems/posix \ 33 include/libc include/libc/sys \ 37 include/netinet include/libc include/libc/sys \ 38 $(LIBKA9Q) \ 34 39 lib \ 35 40 bin \ -
c/src/exec/libcsupport/include/rtems/libio.h
rbed475e re2d79559 100 100 int __rtems_isatty(int _fd); 101 101 102 /* 103 * External I/O handlers 104 */ 105 typedef struct { 106 int (*open)(const char *pathname, unsigned32 flag, unsigned32 mode); 107 int (*close)(int fd); 108 int (*read)(int fd, void *buffer, unsigned32 count); 109 int (*write)(int fd, const void *buffer, unsigned32 count); 110 int (*ioctl)(int fd, unsigned32 command, void *buffer); 111 int (*lseek)(int fd, rtems_libio_offset_t offset, int whence); 112 } rtems_libio_handler_t; 113 114 void rtems_register_libio_handler(int handler_flag, 115 const rtems_libio_handler_t *handler); 116 117 #define RTEMS_FILE_DESCRIPTOR_TYPE_FILE 0x0000 118 #define RTEMS_FILE_DESCRIPTOR_TYPE_SOCKET 0x1000 119 #define rtems_make_file_descriptor(fd,flags) ((fd)|(flags)) 120 #define rtems_file_descriptor_base(fd) ((fd) & 0x0FFF) 121 #define rtems_file_descriptor_type(fd) ((fd) & 0xF000) 122 #define rtems_file_descriptor_type_index(fd) ((((fd) & 0xF000) >> 12) - 1) 123 102 124 #endif /* _RTEMS_LIBIO_H */ -
c/src/exec/libcsupport/src/libio.c
rbed475e re2d79559 80 80 } while (0) 81 81 82 /* 83 * External I/O handlers 84 * 85 * Space for all possible handlers is preallocated 86 * to speed up dispatch to external handlers. 87 */ 88 89 static rtems_libio_handler_t handlers[15]; 90 91 void 92 rtems_register_libio_handler( 93 int handler_flag, 94 const rtems_libio_handler_t *handler 95 ) 96 { 97 int handler_index = rtems_file_descriptor_type_index(handler_flag); 98 99 if ((handler_index < 0) || (handler_index >= 15)) 100 rtems_fatal_error_occurred( RTEMS_INVALID_NUMBER ); 101 handlers[handler_index] = *handler; 102 } 103 82 104 83 105 void … … 85 107 rtems_configuration_table *config, 86 108 unsigned32 max_fds 87 109 ) 88 110 { 89 111 rtems_libio_number_iops = max_fds; … … 254 276 rtems_libio_open_close_args_t args; 255 277 256 if ((rc = rtems_io_lookup_name(pathname, &np)) != RTEMS_SUCCESSFUL) { 257 /* 258 if ( rc == RTEMS_UNSATISFIED ) { 259 puts( "open -- ENOSYS case" ); 260 assert( 0 ); 261 } 262 */ 278 /* 279 * Additional external I/O handlers would be supported by 280 * adding code to pick apart the pathname appropriately. 281 * The networking code does not require changes here since 282 * network file descriptors are obtained using socket(), not 283 * open(). 284 */ 285 286 if ((rc = rtems_io_lookup_name(pathname, &np)) != RTEMS_SUCCESSFUL) 263 287 goto done; 264 }265 288 266 289 iop = rtems_libio_allocate(); … … 300 323 rtems_status_code rc; 301 324 rtems_driver_name_t *np; 302 rtems_libio_t *iop = rtems_libio_iop(fd);325 rtems_libio_t *iop; 303 326 rtems_libio_open_close_args_t args; 304 327 328 if (rtems_file_descriptor_type(fd)) { 329 int (*fp)(int fd); 330 331 fp = handlers[rtems_file_descriptor_type_index(fd)].close; 332 if (fp == NULL) { 333 errno = EBADF; 334 return -1; 335 } 336 return (*fp)(fd); 337 } 338 iop = rtems_libio_iop(fd); 305 339 rtems_libio_check_fd(fd); 306 340 … … 327 361 rtems_status_code rc; 328 362 rtems_driver_name_t *np; 329 rtems_libio_t *iop = rtems_libio_iop(fd);363 rtems_libio_t *iop; 330 364 rtems_libio_rw_args_t args; 331 365 366 if (rtems_file_descriptor_type(fd)) { 367 int (*fp)(int fd, void *buffer, unsigned32 count); 368 369 fp = handlers[rtems_file_descriptor_type_index(fd)].read; 370 if (fp == NULL) { 371 errno = EBADF; 372 return -1; 373 } 374 return (*fp)(fd, buffer, count); 375 } 376 iop = rtems_libio_iop(fd); 332 377 rtems_libio_check_fd(fd); 333 378 rtems_libio_check_buffer(buffer); … … 363 408 rtems_status_code rc; 364 409 rtems_driver_name_t *np; 365 rtems_libio_t *iop = rtems_libio_iop(fd);410 rtems_libio_t *iop; 366 411 rtems_libio_rw_args_t args; 367 412 413 if (rtems_file_descriptor_type(fd)) { 414 int (*fp)(int fd, const void *buffer, unsigned32 count); 415 416 fp = handlers[rtems_file_descriptor_type_index(fd)].write; 417 if (fp == NULL) { 418 errno = EBADF; 419 return -1; 420 } 421 return (*fp)(fd, buffer, count); 422 } 423 iop = rtems_libio_iop(fd); 368 424 rtems_libio_check_fd(fd); 369 425 rtems_libio_check_buffer(buffer); … … 398 454 rtems_status_code rc; 399 455 rtems_driver_name_t *np; 400 rtems_libio_t *iop = rtems_libio_iop(fd);456 rtems_libio_t *iop; 401 457 rtems_libio_ioctl_args_t args; 402 458 459 if (rtems_file_descriptor_type(fd)) { 460 int (*fp)(int fd, unsigned32 command, void *buffer); 461 462 fp = handlers[rtems_file_descriptor_type_index(fd)].ioctl; 463 if (fp == NULL) { 464 errno = EBADF; 465 return -1; 466 } 467 return (*fp)(fd, command, buffer); 468 } 469 iop = rtems_libio_iop(fd); 403 470 rtems_libio_check_fd(fd); 404 471 … … 429 496 ) 430 497 { 431 rtems_libio_t *iop = rtems_libio_iop(fd); 432 498 rtems_libio_t *iop; 499 500 if (rtems_file_descriptor_type(fd)) { 501 int (*fp)(int fd, rtems_libio_offset_t offset, int whence); 502 503 fp = handlers[rtems_file_descriptor_type_index(fd)].lseek; 504 if (fp == NULL) { 505 errno = EBADF; 506 return -1; 507 } 508 return (*fp)(fd, offset, whence); 509 } 510 iop = rtems_libio_iop(fd); 433 511 rtems_libio_check_fd(fd); 434 512 -
c/src/exec/score/cpu/a29k/cpu.h
rbed475e re2d79559 296 296 297 297 #define CPU_STRUCTURE_ALIGNMENT 298 299 /* 300 * Define what is required to specify how the network to host conversion 301 * routines are handled. 302 * 303 */ 304 305 #error "Check these definitions!!!" 306 307 #define CPU_CPU_HAS_OWN_HOST_TO_NETWORK_ROUTINES FALSE 308 #define CPU_BIG_ENDIAN TRUE 309 #define CPU_LITTLE_ENDIAN FALSE 298 310 299 311 /* -
c/src/exec/score/cpu/hppa1.1/cpu.h
rbed475e re2d79559 64 64 #define CPU_STACK_GROWS_UP TRUE 65 65 #define CPU_STRUCTURE_ALIGNMENT __attribute__ ((__aligned__ (32))) 66 67 /* 68 * Define what is required to specify how the network to host conversion 69 * routines are handled. 70 */ 71 72 #define CPU_CPU_HAS_OWN_HOST_TO_NETWORK_ROUTINES FALSE 73 #define CPU_BIG_ENDIAN TRUE 74 #define CPU_LITTLE_ENDIAN FALSE 66 75 67 76 /* constants */ -
c/src/exec/score/cpu/i386/cpu.h
rbed475e re2d79559 58 58 #define CPU_STACK_GROWS_UP FALSE 59 59 #define CPU_STRUCTURE_ALIGNMENT 60 61 /* 62 * Define what is required to specify how the network to host conversion 63 * routines are handled. 64 */ 65 66 #define CPU_CPU_HAS_OWN_HOST_TO_NETWORK_ROUTINES FALSE 67 #define CPU_BIG_ENDIAN FALSE 68 #define CPU_LITTLE_ENDIAN TRUE 60 69 61 70 /* structures */ -
c/src/exec/score/cpu/i960/cpu.h
rbed475e re2d79559 61 61 #define CPU_STACK_GROWS_UP TRUE 62 62 #define CPU_STRUCTURE_ALIGNMENT __attribute__ ((aligned (16))) 63 64 /* 65 * Define what is required to specify how the network to host conversion 66 * routines are handled. 67 */ 68 69 #define CPU_CPU_HAS_OWN_HOST_TO_NETWORK_ROUTINES FALSE 70 #define CPU_BIG_ENDIAN TRUE 71 #define CPU_LITTLE_ENDIAN FALSE 72 63 73 64 74 /* structures */ -
c/src/exec/score/cpu/m68k/cpu.h
rbed475e re2d79559 75 75 #define CPU_STACK_GROWS_UP FALSE 76 76 #define CPU_STRUCTURE_ALIGNMENT 77 78 /* 79 * Define what is required to specify how the network to host conversion 80 * routines are handled. 81 */ 82 83 #define CPU_CPU_HAS_OWN_HOST_TO_NETWORK_ROUTINES FALSE 84 #define CPU_BIG_ENDIAN TRUE 85 #define CPU_LITTLE_ENDIAN FALSE 77 86 78 87 #ifndef ASM -
c/src/exec/score/cpu/mips64orion/cpu.h
rbed475e re2d79559 290 290 #define CPU_STRUCTURE_ALIGNMENT 291 291 #endif 292 293 /* 294 * Define what is required to specify how the network to host conversion 295 * routines are handled. 296 */ 297 298 #define CPU_CPU_HAS_OWN_HOST_TO_NETWORK_ROUTINES FALSE 299 #define CPU_BIG_ENDIAN TRUE 300 #define CPU_LITTLE_ENDIAN FALSE 292 301 293 302 /* -
c/src/exec/score/cpu/no_cpu/cpu.h
rbed475e re2d79559 259 259 260 260 #define CPU_STRUCTURE_ALIGNMENT 261 262 /* 263 * Define what is required to specify how the network to host conversion 264 * routines are handled. 265 */ 266 267 #define CPU_CPU_HAS_OWN_HOST_TO_NETWORK_ROUTINES FALSE 268 #define CPU_BIG_ENDIAN TRUE 269 #define CPU_LITTLE_ENDIAN FALSE 261 270 262 271 /* -
c/src/exec/score/cpu/powerpc/cpu.h
rbed475e re2d79559 285 285 */ 286 286 287 #define CPU_STRUCTURE_ALIGNMENT __attribute__ ((aligned (PPC_CACHE_ALIGNMENT))) 287 #define CPU_STRUCTURE_ALIGNMENT \ 288 __attribute__ ((aligned (PPC_CACHE_ALIGNMENT))) 289 290 /* 291 * Define what is required to specify how the network to host conversion 292 * routines are handled. 293 */ 294 295 #define CPU_CPU_HAS_OWN_HOST_TO_NETWORK_ROUTINES FALSE 296 #define CPU_BIG_ENDIAN TRUE 297 #define CPU_LITTLE_ENDIAN FALSE 288 298 289 299 /* -
c/src/exec/score/cpu/sparc/cpu.h
rbed475e re2d79559 184 184 185 185 #define CPU_STRUCTURE_ALIGNMENT __attribute__ ((aligned (16))) 186 187 /* 188 * Define what is required to specify how the network to host conversion 189 * routines are handled. 190 */ 191 192 #define CPU_CPU_HAS_OWN_HOST_TO_NETWORK_ROUTINES FALSE 193 #define CPU_BIG_ENDIAN TRUE 194 #define CPU_LITTLE_ENDIAN FALSE 186 195 187 196 /* -
c/src/exec/score/cpu/unix/cpu.h
rbed475e re2d79559 283 283 #else 284 284 #define CPU_STRUCTURE_ALIGNMENT 285 #endif 286 287 /* 288 * Define what is required to specify how the network to host conversion 289 * routines are handled. 290 */ 291 292 #if defined(hppa1_1) || defined(sparc) 293 #define CPU_CPU_HAS_OWN_HOST_TO_NETWORK_ROUTINES FALSE 294 #define CPU_BIG_ENDIAN TRUE 295 #define CPU_LITTLE_ENDIAN FALSE 296 #elif defined(i386) || defined(__i386__) 297 #define CPU_CPU_HAS_OWN_HOST_TO_NETWORK_ROUTINES FALSE 298 #define CPU_BIG_ENDIAN FALSE 299 #define CPU_LITTLE_ENDIAN TRUE 300 #else 301 #error "Unknown CPU!!!" 285 302 #endif 286 303 -
c/src/exec/score/headers/Makefile.in
rbed475e re2d79559 11 11 H_PIECES= address apiext bitfield chain context copyrt coremsg coremutex \ 12 12 coresem heap interr isr mpci mppkt object objectmp \ 13 priority stack states sysstate systemthread threadmp threadq \13 priority stack states sysstate thread threadmp threadq \ 14 14 tod tqdata userext watchdog wkspace 15 15 H_FILES=$(H_PIECES:%=$(srcdir)/%.h) … … 20 20 21 21 # H_FILES that get installed at the top level 22 # system.h is handled specially23 22 EXTERNAL_H_PIECES = 24 23 EXTERNAL_H_FILES=$(EXTERNAL_H_PIECES:%=$(srcdir)/%.h) 24 25 NET_H_PIECES = in 26 NET_H_FILES=$(NET_H_PIECES:%=$(srcdir)/%.h) 25 27 26 28 SRCS=$(H_FILES) $(SAPI_H_FILES) $(EXTERNAL_H_FILES) … … 42 44 $(INSTALL) -m 444 ${H_FILES} ${PROJECT_RELEASE}/include/rtems/score 43 45 $(INSTALL) -m 444 ${SAPI_H_FILES} ${PROJECT_RELEASE}/include/rtems/ 46 $(INSTALL) -m 444 ${NET_H_FILES} ${PROJECT_RELEASE}/include/netinet 44 47 # $(INSTALL) -m 444 ${EXTERNAL_H_FILES} ${PROJECT_RELEASE}/include -
c/src/exec/score/include/rtems/score/Makefile.in
rbed475e re2d79559 11 11 H_PIECES= address apiext bitfield chain context copyrt coremsg coremutex \ 12 12 coresem heap interr isr mpci mppkt object objectmp \ 13 priority stack states sysstate systemthread threadmp threadq \13 priority stack states sysstate thread threadmp threadq \ 14 14 tod tqdata userext watchdog wkspace 15 15 H_FILES=$(H_PIECES:%=$(srcdir)/%.h) … … 20 20 21 21 # H_FILES that get installed at the top level 22 # system.h is handled specially23 22 EXTERNAL_H_PIECES = 24 23 EXTERNAL_H_FILES=$(EXTERNAL_H_PIECES:%=$(srcdir)/%.h) 24 25 NET_H_PIECES = in 26 NET_H_FILES=$(NET_H_PIECES:%=$(srcdir)/%.h) 25 27 26 28 SRCS=$(H_FILES) $(SAPI_H_FILES) $(EXTERNAL_H_FILES) … … 42 44 $(INSTALL) -m 444 ${H_FILES} ${PROJECT_RELEASE}/include/rtems/score 43 45 $(INSTALL) -m 444 ${SAPI_H_FILES} ${PROJECT_RELEASE}/include/rtems/ 46 $(INSTALL) -m 444 ${NET_H_FILES} ${PROJECT_RELEASE}/include/netinet 44 47 # $(INSTALL) -m 444 ${EXTERNAL_H_FILES} ${PROJECT_RELEASE}/include -
c/src/lib/Makefile.in
rbed475e re2d79559 11 11 include $(PROJECT_ROOT)/make/directory.cfg 12 12 13 SUB_DIRS=start include libmisc libc libcpu libbsp wrapup 13 # We only build the ka9q library if HAS_KA9Q was defined 14 LIBKA9Q_yes_V = libka9q 15 LIBKA9Q = $(LIBKA9Q_$(HAS_KA9Q)_V) 16 17 SUB_DIRS=start include libmisc libc libcpu libbsp $(LIBKA9Q) wrapup -
c/src/lib/include/Makefile.in
rbed475e re2d79559 8 8 VPATH=@srcdir@ 9 9 10 H_FILES=console.h clockdrv.h iosupp.h ringbuf.h \ 11 spurious.h timerdrv.h vmeintr.h z8036.h z8530.h z8536.h 10 H_PIECES=console clockdrv iosupp ringbuf \ 11 spurious timerdrv vmeintr z8036 z8530 z8536 12 H_FILES=$(H_PIECES:%=$(srcdir)/%.h) 12 13 13 HH_FILES=$(H_FILES:%=$(srcdir)/%) 14 KA9Q_H_PIECES= arp asy ax25 ax25mail bootp cmdparse commands config \ 15 daemon dialer domain enet ftp ftpcli global hardware icmp iface \ 16 internet ip kiss lapb lzw mailbox mbuf netuser nospc nr4 nr4mail \ 17 nrs ping pktdrvr ppp proc rip rtems_ka9q sb session slhc slip smtp \ 18 sockaddr socket tcp telnet tftp timer tipmail trace udp usock 19 KA9Q_H_FILES=$(KA9Q_H_PIECES:%=$(srcdir)/ka9q/%.h) 14 20 15 21 SYS_H_FILES= 16 22 17 SRCS=$(H H_FILES) $(SYS_H_FILES)23 SRCS=$(H_FILES) $(SYS_H_FILES) 18 24 19 25 include $(RTEMS_CUSTOM) … … 24 30 25 31 all: $(SRCS) 26 $(INSTALL) -m 444 $(H H_FILES) ${PROJECT_RELEASE}/include32 $(INSTALL) -m 444 $(H_FILES) ${PROJECT_RELEASE}/include 27 33 $(INSTALL) -m 444 $(SYS_H_FILES) ${PROJECT_RELEASE}/include/sys 28 34 ifeq ($(HAS_KA9Q),yes) 35 $(INSTALL) -m 444 $(KA9Q_H_FILES) ${PROJECT_RELEASE}/include/ka9q 36 endif -
c/src/lib/include/rtems/libio.h
rbed475e re2d79559 100 100 int __rtems_isatty(int _fd); 101 101 102 /* 103 * External I/O handlers 104 */ 105 typedef struct { 106 int (*open)(const char *pathname, unsigned32 flag, unsigned32 mode); 107 int (*close)(int fd); 108 int (*read)(int fd, void *buffer, unsigned32 count); 109 int (*write)(int fd, const void *buffer, unsigned32 count); 110 int (*ioctl)(int fd, unsigned32 command, void *buffer); 111 int (*lseek)(int fd, rtems_libio_offset_t offset, int whence); 112 } rtems_libio_handler_t; 113 114 void rtems_register_libio_handler(int handler_flag, 115 const rtems_libio_handler_t *handler); 116 117 #define RTEMS_FILE_DESCRIPTOR_TYPE_FILE 0x0000 118 #define RTEMS_FILE_DESCRIPTOR_TYPE_SOCKET 0x1000 119 #define rtems_make_file_descriptor(fd,flags) ((fd)|(flags)) 120 #define rtems_file_descriptor_base(fd) ((fd) & 0x0FFF) 121 #define rtems_file_descriptor_type(fd) ((fd) & 0xF000) 122 #define rtems_file_descriptor_type_index(fd) ((((fd) & 0xF000) >> 12) - 1) 123 102 124 #endif /* _RTEMS_LIBIO_H */ -
c/src/lib/libbsp/m68k/gen68360/Makefile.in
rbed475e re2d79559 13 13 SRCS=README 14 14 15 # We only build the ka9q device driver if HAS_KA9Q was defined 16 LIBKA9Q_yes_V = network 17 LIBKA9Q = $(LIBKA9Q_$(HAS_KA9Q)_V) 18 15 19 all: $(SRCS) 16 20 17 21 # wrapup is the one that actually builds and installs the library 18 22 # from the individual .rel files built in other directories 19 SUB_DIRS=include start360 startup clock console timer wrapup23 SUB_DIRS=include start360 startup clock console timer $(LIBKA9Q) wrapup -
c/src/lib/libbsp/m68k/gen68360/README
rbed475e re2d79559 4 4 5 5 # 6 # This package requiresa version of GCC that has been modified6 # This package works best with a version of GCC that has been modified 7 7 # to support the `-mcpu32' argument. I have submitted the required 8 8 # changes to the GCC maintainers. … … 20 20 # 21 21 22 # 23 # This board support package works with several different versions of 24 # MC68360 systems. The choice of hardware is made at the final link-edit 25 # phase by setting the Makefile LDFLAGS definition appropriately. 26 # 27 # Decisions to be made a link-edit time include: 28 # - The version of hardware on which the application is to run. 29 # This is selected by defining the MC68360HardwareType variable. 30 # Supported values are: 31 # MC68360HardwareTypeMotorolaGeneric (default) 32 # MC68360HardwareTypeAtlasHSB 33 # To select the Atlas Computer Equipment HSB, 34 # --defsym MC68360HardwareType=MC68360HardwareTypeAtlasHSB 35 # 36 # - The amount of dynamic RAM in the system. This value applies 37 # only to hardware versions which support different sizes of RAM. 38 # The default value is 4 Mbytes. To specify 16 Mbytes of memory, 39 # --defsym RamSize=0x1000000 40 # 41 # - The size of the memory allocator heap. The default value is 42 # 64 kbytes. If the KA9Q network package is used the heap 43 # should be at least 256 kbytes. If your network is large, or 44 # busy, the heap should be even larger. 45 # To choose a heap size of 256 kbytes, 46 # --defsym HeapSize=0x40000 47 # 48 22 49 BSP NAME: gen68360 23 BOARD: home-built 50 BOARD: Generic 68360 as described in Motorola MC68360 User's Manual 51 BOARD: Atlas Computer Equipment Inc. High Speed Bridge (HSB) 52 BOARD: Atlas Computer Equipment Inc. Advanced Communication Engine (ACE) 24 53 BUS: none 25 54 CPU FAMILY: Motorola CPU32+ … … 64 93 bus width: 8-bit PROM, 32-bit DRAM 65 94 ROM: To 1 MByte, 180 nsec (3 wait states), chip select 0 66 RAM: 4 MByte DRAM SIMM, 60 nsec (0 wait states),parity95 RAM: 1 to 64 MByte DRAM SIMM, 60 nsec (0 wait states), parity or nonparity 67 96 68 97 Host System … … 253 282 This board support package is written for a 68360 system similar to that 254 283 described in chapter 9 of the Motorola MC68360 Quad Integrated Communication 255 Processor Users' Manual. The salient details of this hardware are:284 Processor Users' Manual. The salient features of this hardware are: 256 285 257 286 25 MHz external clock … … 260 289 4 MBytes of 60 nsec parity DRAM (1Mx36) to RAS1*/CAS1* 261 290 Console serial port on SMC1 291 Ethernet interface on SCC1 262 292 263 293 The board support package has been tested with a home-built board and with an -
c/src/lib/libbsp/m68k/gen68360/console/console.c
rbed475e re2d79559 43 43 44 44 /* 45 * Place buffer descriptors at end of User Data/BD space in dual-port RAM46 */47 #define consoleRxBd ((volatile m360BufferDescriptor_t *)((char *)m360.dpram1 + \48 (sizeof(m360.dpram2) - 2*sizeof(m360BufferDescriptor_t))))49 #define consoleTxBd ((volatile m360BufferDescriptor_t *)((char *)m360.dpram1 + \50 (sizeof(m360.dpram2) - sizeof(m360BufferDescriptor_t))))51 52 /*53 45 * I/O buffers can be in ordindary RAM 54 46 */ 55 47 static volatile char rxBuf, txBuf; 48 static volatile m360BufferDescriptor_t *consoleRxBd, *consoleTxBd; 56 49 57 50 rtems_device_driver console_initialize( … … 62 55 { 63 56 rtems_status_code status; 57 58 /* 59 * Allocate buffer descriptors 60 */ 61 consoleRxBd = M360AllocateBufferDescriptors (1); 62 consoleTxBd = M360AllocateBufferDescriptors (1); 64 63 65 64 /* … … 122 121 * Send "Init parameters" command 123 122 */ 124 m360.cr = M360_CR_OP_INIT_RX_TX | M360_CR_CHAN_SMC1 | M360_CR_FLG; 125 while (m360.cr & M360_CR_FLG) 126 continue; 123 M360ExecuteRISC (M360_CR_OP_INIT_RX_TX | M360_CR_CHAN_SMC1); 127 124 128 125 /* -
c/src/lib/libbsp/m68k/gen68360/include/bsp.h
rbed475e re2d79559 120 120 121 121 void M360ExecuteRISC( rtems_unsigned16 command ); 122 void *M360AllocateBufferDescriptors( int count ); 123 void *M360AllocateRiscTimers( int count ); 122 124 123 125 m68k_isr_entry set_vector( … … 127 129 ); 128 130 131 /* 132 * Values assigned by link editor 133 */ 134 extern void *_RomBase, *_RamBase, *_RamSize; 135 extern void *_MC68360HardwareType; 136 extern void *_MC68360HardwareTypeMotorolaGeneric; 137 extern void *_MC68360HardwareTypeAtlasHSB; 138 139 /* 140 * Definitions for Atlas Computer Equipment Inc. High Speed Bridge (HSB) 141 */ 142 #define ATLASHSB_ESR 0x20010000L 143 #define ATLASHSB_USICR 0x20010001L 144 #define ATLASHSB_DSRR 0x20010002L 145 #define ATLASHSB_LED4 0x20010004L 146 #define ATLASHSB_ROM_U6 0xFF080000L /* U6 flash ROM socket */ 147 129 148 #ifdef __cplusplus 130 149 } -
c/src/lib/libbsp/m68k/gen68360/start/start360.s
rbed475e re2d79559 57 57 .long uhoh | 22: 58 58 .long uhoh | 23: 59 .long uhoh| 24: Spurious interrupt59 .long spurious_interrupt | 24: Spurious interrupt 60 60 .long uhoh | 25: Level 1 interrupt autovector 61 61 .long uhoh | 26: Level 2 interrupt autovector … … 299 299 300 300 /* 301 * Log, but otherwise ignore, spurious interrupts 302 */ 303 spurious_interrupt: 304 addql #1,SYM(_M68kSpuriousInterruptCount) 305 rte 306 307 /* 301 308 * Place the low-order 3 octets of the board's ethernet address at 302 309 * a `well-known' fixed location relative to the beginning of ROM. … … 308 315 * Initial PC 309 316 */ 310 .global start317 .global start 311 318 start: 312 319 /* … … 387 394 | Should this just force a reset? 388 395 mainDone: nop | Leave spot for breakpoint 396 movew #1,a7 | Force a double bus error 397 movel d0,a7@- | This should cause a RESET 389 398 stop #0x2700 | Stop with interrupts disabled 390 399 bra.s mainDone | Stuck forever … … 399 408 END_CODE 400 409 401 BEGIN_ BSS410 BEGIN_DATA_DCL 402 411 .align 2 403 412 PUBLIC (environ) 404 413 SYM (environ): 405 414 .long 0 415 PUBLIC (_M68kSpuriousInterruptCount) 416 SYM (_M68kSpuriousInterruptCount): 417 .long 0 418 END_DATA_DCL 419 406 420 END -
c/src/lib/libbsp/m68k/gen68360/start360/start360.s
rbed475e re2d79559 57 57 .long uhoh | 22: 58 58 .long uhoh | 23: 59 .long uhoh| 24: Spurious interrupt59 .long spurious_interrupt | 24: Spurious interrupt 60 60 .long uhoh | 25: Level 1 interrupt autovector 61 61 .long uhoh | 26: Level 2 interrupt autovector … … 299 299 300 300 /* 301 * Log, but otherwise ignore, spurious interrupts 302 */ 303 spurious_interrupt: 304 addql #1,SYM(_M68kSpuriousInterruptCount) 305 rte 306 307 /* 301 308 * Place the low-order 3 octets of the board's ethernet address at 302 309 * a `well-known' fixed location relative to the beginning of ROM. … … 308 315 * Initial PC 309 316 */ 310 .global start317 .global start 311 318 start: 312 319 /* … … 387 394 | Should this just force a reset? 388 395 mainDone: nop | Leave spot for breakpoint 396 movew #1,a7 | Force a double bus error 397 movel d0,a7@- | This should cause a RESET 389 398 stop #0x2700 | Stop with interrupts disabled 390 399 bra.s mainDone | Stuck forever … … 399 408 END_CODE 400 409 401 BEGIN_ BSS410 BEGIN_DATA_DCL 402 411 .align 2 403 412 PUBLIC (environ) 404 413 SYM (environ): 405 414 .long 0 415 PUBLIC (_M68kSpuriousInterruptCount) 416 SYM (_M68kSpuriousInterruptCount): 417 .long 0 418 END_DATA_DCL 419 406 420 END -
c/src/lib/libbsp/m68k/gen68360/startup/Makefile.in
rbed475e re2d79559 11 11 12 12 # C source names, if any, go here -- minus the .c 13 C_PIECES= bspstart bspclean init68360 sbrk setvec13 C_PIECES=alloc360 bspstart bspclean init68360 sbrk setvec 14 14 C_FILES=$(C_PIECES:%=%.c) 15 15 C_O_FILES=$(C_PIECES:%=${ARCH}/%.o) … … 17 17 H_FILES= 18 18 19 SRCS=$(srcdir)/linkcmds $(srcdir)/linkcmds.prom $(C_FILES) $(H_FILES) 19 SRCS=$(srcdir)/linkcmds $(srcdir)/linkcmds.prom $(srcdir)/linkcmds.bootp \ 20 $(C_FILES) $(H_FILES) 20 21 OBJS=$(C_O_FILES) $(CC_O_FILES) 21 22 -
c/src/lib/libbsp/m68k/gen68360/startup/init68360.c
rbed475e re2d79559 37 37 { 38 38 int i; 39 extern void *_RomBase, *_RamBase;39 unsigned long l; 40 40 m68k_isr_entry *vbr; 41 41 extern void _CopyDataClearBSSAndStart (void); … … 59 59 */ 60 60 m360.clkocr = 0x8F; /* No more writes, no clock outputs */ 61 m360.pllcr = 0xD000; /* PLL, no writes, no prescale, */62 /*no LPSTOP slowdown, PLL X1 */61 m360.pllcr = 0xD000; /* PLL, no writes, no prescale, 62 no LPSTOP slowdown, PLL X1 */ 63 63 m360.cdvcr = 0x8000; /* No more writes, no clock division */ 64 64 … … 67 67 * Disable watchdog FIXME: Should use watchdog!!!! 68 68 * Watchdog causes system reset 69 * Fastest watchdog timeout69 * Slowest watchdog timeout 70 70 * Enable double bus fault monitor 71 71 * Enable bus monitor external 72 72 * 128 clocks for external timeout 73 73 */ 74 m360.sypcr = 0x 4F;74 m360.sypcr = 0x7F; 75 75 76 76 /* … … 90 90 * CF1MODE=00 (CONFIG1 input) 91 91 * RAS1* double drive 92 * A31-A2892 * WE0* - WE3* 93 93 * OE* output 94 * CAS2* /CAS3*95 * CAS0* /CAS1*94 * CAS2* - CAS3* 95 * CAS0* - CAS1* 96 96 * CS7* 97 97 * AVEC* … … 100 100 * (static RAM, external address multiplexing, etc). 101 101 */ 102 m360.pepar = 0x01 00;102 m360.pepar = 0x0180; 103 103 104 104 /* 105 105 * Step 11: Remap Chip Select 0 (CS0*), set up GMR 106 * 1024 addresses per DRAM page (1M DRAM chips) 107 * 60 nsec DRAM 108 * 180 nsec ROM (3 wait states) 109 * HARDWARE: 110 * Change if you are using a different memory configuration 111 */ 112 m360.gmr = M360_GMR_RCNT(24) | M360_GMR_RFEN | M360_GMR_RCYC(0) | 113 M360_GMR_PGS(3) | M360_GMR_DPS_32BIT | M360_GMR_NCS | 114 M360_GMR_GAMX; 115 m360.memc[0].br = (unsigned long)&_RomBase | M360_MEMC_BR_WP | 116 M360_MEMC_BR_V; 117 m360.memc[0].or = M360_MEMC_OR_WAITS(3) | M360_MEMC_OR_512KB | 106 */ 107 if (&_MC68360HardwareType == &_MC68360HardwareTypeAtlasHSB) { 108 m360.gmr = M360_GMR_RCNT(12) | M360_GMR_RFEN | 109 M360_GMR_RCYC(0) | M360_GMR_PGS(1) | 110 M360_GMR_DPS_32BIT | M360_GMR_DWQ | 111 M360_GMR_GAMX; 112 m360.memc[0].br = (unsigned long)&_RomBase | M360_MEMC_BR_WP | 113 M360_MEMC_BR_V; 114 m360.memc[0].or = M360_MEMC_OR_WAITS(3) | M360_MEMC_OR_1MB | 118 115 M360_MEMC_OR_8BIT; 116 } 117 else { 118 /* 119 * 1024/2048/4096 addresses per DRAM page (1M/4M/16M DRAM chips) 120 * 60 nsec DRAM 121 * 180 nsec ROM (3 wait states) 122 */ 123 switch ((unsigned long)&_RamSize) { 124 default: 125 case 4*1024*1024: 126 m360.gmr = M360_GMR_RCNT(24) | M360_GMR_RFEN | 127 M360_GMR_RCYC(0) | M360_GMR_PGS(3) | 128 M360_GMR_DPS_32BIT | M360_GMR_NCS | 129 M360_GMR_GAMX; 130 break; 131 132 case 16*1024*1024: 133 m360.gmr = M360_GMR_RCNT(24) | M360_GMR_RFEN | 134 M360_GMR_RCYC(0) | M360_GMR_PGS(5) | 135 M360_GMR_DPS_32BIT | M360_GMR_NCS | 136 M360_GMR_GAMX; 137 break; 138 139 case 64*1024*1024: 140 m360.gmr = M360_GMR_RCNT(24) | M360_GMR_RFEN | 141 M360_GMR_RCYC(0) | M360_GMR_PGS(7) | 142 M360_GMR_DPS_32BIT | M360_GMR_NCS | 143 M360_GMR_GAMX; 144 break; 145 } 146 m360.memc[0].br = (unsigned long)&_RomBase | M360_MEMC_BR_WP | 147 M360_MEMC_BR_V; 148 m360.memc[0].or = M360_MEMC_OR_WAITS(3) | M360_MEMC_OR_1MB | 149 M360_MEMC_OR_8BIT; 150 } 119 151 120 152 /* 121 153 * Step 12: Initialize the system RAM 122 * Set up option/base registers 123 * 4 MB DRAM 124 * 60 nsec DRAM 125 * Wait for chips to power up 126 * Perform 8 read cycles 127 * Set all parity bits to correct state 128 * Enable parity checking 129 * HARDWARE: 130 * Change if you are using a different memory configuration 131 */ 132 m360.memc[1].or = M360_MEMC_OR_TCYC(0) | M360_MEMC_OR_4MB | 133 M360_MEMC_OR_DRAM; 134 m360.memc[1].br = (unsigned long)&_RamBase | M360_MEMC_BR_V; 135 for (i = 0; i < 50000; i++) 136 continue; 137 for (i = 0; i < 8; ++i) 138 *((volatile unsigned long *)(unsigned long)&_RamBase); 139 for (i = 0 ; i < 4*1024*1024 ; i += sizeof (unsigned long)) { 140 volatile unsigned long *lp; 141 lp = (unsigned long *)((unsigned char *)&_RamBase + i); 142 *lp = *lp; 143 } 144 m360.memc[1].br = (unsigned long)&_RamBase | M360_MEMC_BR_PAREN | 154 */ 155 if (&_MC68360HardwareType == &_MC68360HardwareTypeAtlasHSB) { 156 /* first bank 1MByte DRAM */ 157 m360.memc[1].or = M360_MEMC_OR_TCYC(2) | M360_MEMC_OR_1MB | 158 M360_MEMC_OR_PGME | M360_MEMC_OR_DRAM; 159 m360.memc[1].br = (unsigned long)&_RamBase | M360_MEMC_BR_V; 160 161 /* second bank 1MByte DRAM */ 162 m360.memc[2].or = M360_MEMC_OR_TCYC(2) | M360_MEMC_OR_1MB | 163 M360_MEMC_OR_PGME | M360_MEMC_OR_DRAM; 164 m360.memc[2].br = ((unsigned long)&_RamBase + 0x100000) | 165 M360_MEMC_BR_V; 166 167 /* flash rom socket U6 on CS5 */ 168 m360.memc[5].br = (unsigned long)ATLASHSB_ROM_U6 | M360_MEMC_BR_WP | 145 169 M360_MEMC_BR_V; 170 m360.memc[5].or = M360_MEMC_OR_WAITS(2) | M360_MEMC_OR_512KB | 171 M360_MEMC_OR_8BIT; 172 173 /* CSRs on CS7 */ 174 m360.memc[7].or = M360_MEMC_OR_TCYC(4) | M360_MEMC_OR_64KB | 175 M360_MEMC_OR_8BIT; 176 m360.memc[7].br = ATLASHSB_ESR | 0x01; 177 for (i = 0; i < 50000; i++) 178 continue; 179 for (i = 0; i < 8; ++i) 180 *((volatile unsigned long *)(unsigned long)&_RamBase); 181 } 182 else { 183 /* 184 * Set up option/base registers 185 * 4M/16M/64M DRAM 186 * 60 nsec DRAM 187 * Wait for chips to power up 188 * Perform 8 read cycles 189 * Set all parity bits to correct state 190 * Enable parity checking 191 */ 192 switch ((unsigned long)&_RamSize) { 193 default: 194 case 4*1024*1024: 195 m360.memc[1].or = M360_MEMC_OR_TCYC(0) | 196 M360_MEMC_OR_4MB | 197 M360_MEMC_OR_DRAM; 198 break; 199 200 case 16*1024*1024: 201 m360.memc[1].or = M360_MEMC_OR_TCYC(0) | 202 M360_MEMC_OR_16MB | 203 M360_MEMC_OR_DRAM; 204 break; 205 206 case 64*1024*1024: 207 m360.memc[1].or = M360_MEMC_OR_TCYC(0) | 208 M360_MEMC_OR_64MB | 209 M360_MEMC_OR_DRAM; 210 break; 211 } 212 m360.memc[1].br = (unsigned long)&_RamBase | M360_MEMC_BR_V; 213 for (i = 0; i < 50000; i++) 214 continue; 215 for (i = 0; i < 8; ++i) 216 *((volatile unsigned long *)(unsigned long)&_RamBase); 217 for (l = 0 ; l < (unsigned long)&_RamSize ; l += sizeof (unsigned long)) { 218 volatile unsigned long *lp; 219 lp = (unsigned long *)((unsigned char *)&_RamBase + i); 220 *lp = *lp; 221 } 222 m360.memc[1].br = (unsigned long)&_RamBase | 223 M360_MEMC_BR_PAREN | M360_MEMC_BR_V; 224 } 146 225 147 226 /* … … 156 235 * Step 14: More system initialization 157 236 * SDCR (Serial DMA configuration register) 237 * Disable SDMA during FREEZE 158 238 * Give SDMA priority over all interrupt handlers 159 239 * Set DMA arbiration level to 4 … … 168 248 * SCCs priority grouped at top of table 169 249 */ 170 m360.sdcr = M360_SDMA_ SISM_7 | M360_SDMA_SAID_4;250 m360.sdcr = M360_SDMA_FREEZE | M360_SDMA_SISM_7 | M360_SDMA_SAID_4; 171 251 m360.cicr = (3 << 22) | (2 << 20) | (1 << 18) | (0 << 16) | 172 252 (4 << 13) | (0x1F << 8) | (128); … … 179 259 * No show cycles 180 260 * User/supervisor access 181 * Bus clear inter upt service level 7261 * Bus clear interrupt service level 7 182 262 * SIM60 interrupt sources higher priority than CPM 183 263 */ -
c/src/lib/libbsp/m68k/gen68360/startup/linkcmds
rbed475e re2d79559 1 1 /* 2 * This file contains GNU linker directives for a generic MC68360 board. 2 * This file contains GNU linker directives for a generic MC68360 board. 3 * Variations in hardware type and dynamic memory size can be made 4 * by overriding some values with linker command-line arguments. 3 5 * 4 6 * Saskatchewan Accelerator Laboratory … … 11 13 12 14 /* 13 * Declare on-board memory 15 * Declare some sizes. 16 * XXX: The assignment of ". += XyzSize;" fails in older gld's if the 17 * number used there is not constant. If this happens to you, edit 18 * the lines marked XXX below to use a constant value. 19 */ 20 RamSize = DEFINED(RamSize) ? RamSize : 4M; 21 HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000; 22 StackSize = DEFINED(StackSize) ? StackSize : 0x1000; 23 24 /* 25 * Declare hardware type 26 */ 27 MC68360HardwareTypeMotorolaGeneric = 0; 28 MC68360HardwareTypeAtlasHSB = 1; 29 MC68360HardwareType = DEFINED(MC68360HardwareType) ? MC68360HardwareType : 0; 30 31 /* 32 * Declare on-board memory. 33 * It would be nice if the ram length could be given as 34 * LENGTH=RamSize, but gld doesn't allow non-constant 35 * values in the LENGTH expression. 14 36 */ 15 37 MEMORY { 16 ram : ORIGIN = 0x00000000, LENGTH = 4M38 ram : ORIGIN = 0x00000000, LENGTH = 64M 17 39 rom : ORIGIN = 0xFF000000, LENGTH = 1M 18 40 dpram : ORIGIN = 0xFE000000, LENGTH = 8k … … 20 42 21 43 /* 22 * Declare some sizes 23 * XXX: The assignment of ". += XyzSize;" fails in older gld's if the 24 * number used there is not constant. If this happens to you, edit 25 * the lines marked below to use a constant value. 44 * Declare low-order three octets of Ethernet address. 26 45 */ 27 HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000; 28 StackSize = DEFINED(StackSize) ? StackSize : 0x1000; 46 ETHERNET_ADDRESS = DEFINED(ETHERNET_ADDRESS) ? ETHERNET_ADDRESS : 0xDEAD12; 29 47 30 48 /* 31 * Declare low-order three octets of Ethernet address 49 * Declare hardware type. 50 * Acceptable values are: 51 * 0 - Generic system as described in the MC68360 User's Manual 52 * (MC68360UM/AD Rev. 1). 53 * 1 - ATLAS Computer Equipment Incorporated ACE360/HSB. 32 54 */ 33 ETHERNET_ADDRESS = DEFINED(ETHERNET_ADDRESS) ? ETHERNET_ADDRESS : 0xDEAD12;55 MC68360HardwareType = DEFINED(MC68360HardwareType) ? MC68360HardwareType : 0; 34 56 35 57 /* … … 37 59 */ 38 60 SECTIONS { 61 /* 62 * Hardware variations 63 */ 64 _RamSize = RamSize; 65 __RamSize = RamSize; 66 _MC68360HardwareType = MC68360HardwareType; 67 __MC68360HardwareType = MC68360HardwareType; 68 _MC68360HardwareTypeMotorolaGeneric = MC68360HardwareTypeMotorolaGeneric; 69 __MC68360HardwareTypeMotorolaGeneric = MC68360HardwareTypeMotorolaGeneric; 70 _MC68360HardwareTypeAtlasHSB = MC68360HardwareTypeAtlasHSB; 71 __MC68360HardwareTypeAtlasHSB = MC68360HardwareTypeAtlasHSB; 72 39 73 /* 40 74 * Boot PROM -
c/src/lib/libbsp/m68k/gen68360/startup/linkcmds.prom
rbed475e re2d79559 1 1 /* 2 2 * This file contains GNU linker directives for a generic MC68360 board. 3 * These linker directives are for producing a PROM version.. 4 * To create the PROM image from the linkter output you must use objcopy 3 * Variations in hardware type and dynamic memory size can be made 4 * by overriding some values with linker command-line arguments. 5 * 6 * These linker directives are for producing a BOOTP PROM. 7 * To create the PROM image from the linker output you must use objcopy 5 8 * (--adjust-section-vma) to place the data segment at the end of the text 6 9 * segment in the PROM. The start-up code takes care of copying this region … … 21 24 22 25 /* 23 * Declare on-board memory 26 * Declare some sizes. 27 * XXX: The assignment of ". += XyzSize;" fails in older gld's if the 28 * number used there is not constant. If this happens to you, edit 29 * the lines marked XXX below to use a constant value. 30 */ 31 RamSize = DEFINED(RamSize) ? RamSize : 4M; 32 HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000; 33 StackSize = DEFINED(StackSize) ? StackSize : 0x1000; 34 35 /* 36 * Declare hardware type 37 */ 38 MC68360HardwareTypeMotorolaGeneric = 0; 39 MC68360HardwareTypeAtlasHSB = 1; 40 MC68360HardwareType = DEFINED(MC68360HardwareType) ? MC68360HardwareType : 0; 41 42 /* 43 * Declare on-board memory. 44 * It would be nice if the ram length could be given as 45 * LENGTH=RamSize, but gld doesn't allow non-constant 46 * values in the LENGTH expression. 24 47 */ 25 48 MEMORY { 26 ram : ORIGIN = 0x00000000, LENGTH = 4M49 ram : ORIGIN = 0x00000000, LENGTH = 64M 27 50 rom : ORIGIN = 0xFF000000, LENGTH = 1M 28 51 dpram : ORIGIN = 0xFE000000, LENGTH = 8k … … 30 53 31 54 /* 32 * Declare some sizes55 * Declare low-order three octets of Ethernet address. 33 56 */ 34 HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000; 35 StackSize = DEFINED(StackSize) ? StackSize : 0x1000; 57 ETHERNET_ADDRESS = DEFINED(ETHERNET_ADDRESS) ? ETHERNET_ADDRESS : 0xDEAD12; 36 58 37 59 /* 38 * Declare low-order three octets of Ethernet address 60 * Declare hardware type. 61 * Acceptable values are: 62 * 0 - Generic system as described in the MC68360 User's Manual 63 * (MC68360UM/AD Rev. 1). 64 * 1 - ATLAS Computer Equipment Incorporated ACE360/HSB. 39 65 */ 40 ETHERNET_ADDRESS = DEFINED(ETHERNET_ADDRESS) ? ETHERNET_ADDRESS : 0xDEAD12;66 MC68360HardwareType = DEFINED(MC68360HardwareType) ? MC68360HardwareType : 0; 41 67 42 68 /* … … 44 70 */ 45 71 SECTIONS { 72 /* 73 * Hardware variations 74 */ 75 _RamSize = RamSize; 76 __RamSize = RamSize; 77 _MC68360HardwareType = MC68360HardwareType; 78 __MC68360HardwareType = MC68360HardwareType; 79 _MC68360HardwareTypeMotorolaGeneric = MC68360HardwareTypeMotorolaGeneric; 80 __MC68360HardwareTypeMotorolaGeneric = MC68360HardwareTypeMotorolaGeneric; 81 _MC68360HardwareTypeAtlasHSB = MC68360HardwareTypeAtlasHSB; 82 __MC68360HardwareTypeAtlasHSB = MC68360HardwareTypeAtlasHSB; 83 46 84 /* 47 85 * Boot PROM … … 89 127 _HeapStart = .; 90 128 __HeapStart = .; 91 . += HeapSize; 92 . += StackSize; 129 . += HeapSize; /* XXX -- Old gld can't handle this */ 130 . += StackSize; /* XXX -- Old gld can't handle this */ 131 /* . += 0x10000; */ /* HeapSize for old gld */ 132 /* . += 0x1000; */ /* StackSize for old gld */ 93 133 . = ALIGN (16); 94 134 stack_init = .; … … 108 148 109 149 } >dpram 110 111 150 } -
c/src/lib/libbsp/m68k/gen68360/wrapup/Makefile.in
rbed475e re2d79559 8 8 VPATH=@srcdir@ 9 9 10 BSP_PIECES=startup clock console timer 10 # We only build the ka9q device driver if HAS_KA9Q was defined 11 LIBKA9Q_yes_V = network 12 LIBKA9Q = $(LIBKA9Q_$(HAS_KA9Q)_V) 13 14 BSP_PIECES=startup clock console $(LIBKA9Q) timer 15 CPU_PIECES= 11 16 GENERIC_PIECES= 12 17 13 18 # bummer; have to use $foreach since % pattern subst rules only replace 1x 14 19 OBJS=$(foreach piece, $(BSP_PIECES), ../$(piece)/$(ARCH)/$(piece).rel) \ 20 $(foreach piece, $(CPU_PIECES), \ 21 ../../../../libcpu/$(RTEMS_CPU)/$(piece)/$(ARCH)/$(piece).rel) \ 15 22 $(foreach piece, $(GENERIC_PIECES), ../../../$(piece)/$(ARCH)/$(piece).rel) 16 23 LIB=$(ARCH)/libbsp.a -
c/src/lib/libc/libio.c
rbed475e re2d79559 80 80 } while (0) 81 81 82 /* 83 * External I/O handlers 84 * 85 * Space for all possible handlers is preallocated 86 * to speed up dispatch to external handlers. 87 */ 88 89 static rtems_libio_handler_t handlers[15]; 90 91 void 92 rtems_register_libio_handler( 93 int handler_flag, 94 const rtems_libio_handler_t *handler 95 ) 96 { 97 int handler_index = rtems_file_descriptor_type_index(handler_flag); 98 99 if ((handler_index < 0) || (handler_index >= 15)) 100 rtems_fatal_error_occurred( RTEMS_INVALID_NUMBER ); 101 handlers[handler_index] = *handler; 102 } 103 82 104 83 105 void … … 85 107 rtems_configuration_table *config, 86 108 unsigned32 max_fds 87 109 ) 88 110 { 89 111 rtems_libio_number_iops = max_fds; … … 254 276 rtems_libio_open_close_args_t args; 255 277 256 if ((rc = rtems_io_lookup_name(pathname, &np)) != RTEMS_SUCCESSFUL) { 257 /* 258 if ( rc == RTEMS_UNSATISFIED ) { 259 puts( "open -- ENOSYS case" ); 260 assert( 0 ); 261 } 262 */ 278 /* 279 * Additional external I/O handlers would be supported by 280 * adding code to pick apart the pathname appropriately. 281 * The networking code does not require changes here since 282 * network file descriptors are obtained using socket(), not 283 * open(). 284 */ 285 286 if ((rc = rtems_io_lookup_name(pathname, &np)) != RTEMS_SUCCESSFUL) 263 287 goto done; 264 }265 288 266 289 iop = rtems_libio_allocate(); … … 300 323 rtems_status_code rc; 301 324 rtems_driver_name_t *np; 302 rtems_libio_t *iop = rtems_libio_iop(fd);325 rtems_libio_t *iop; 303 326 rtems_libio_open_close_args_t args; 304 327 328 if (rtems_file_descriptor_type(fd)) { 329 int (*fp)(int fd); 330 331 fp = handlers[rtems_file_descriptor_type_index(fd)].close; 332 if (fp == NULL) { 333 errno = EBADF; 334 return -1; 335 } 336 return (*fp)(fd); 337 } 338 iop = rtems_libio_iop(fd); 305 339 rtems_libio_check_fd(fd); 306 340 … … 327 361 rtems_status_code rc; 328 362 rtems_driver_name_t *np; 329 rtems_libio_t *iop = rtems_libio_iop(fd);363 rtems_libio_t *iop; 330 364 rtems_libio_rw_args_t args; 331 365 366 if (rtems_file_descriptor_type(fd)) { 367 int (*fp)(int fd, void *buffer, unsigned32 count); 368 369 fp = handlers[rtems_file_descriptor_type_index(fd)].read; 370 if (fp == NULL) { 371 errno = EBADF; 372 return -1; 373 } 374 return (*fp)(fd, buffer, count); 375 } 376 iop = rtems_libio_iop(fd); 332 377 rtems_libio_check_fd(fd); 333 378 rtems_libio_check_buffer(buffer); … … 363 408 rtems_status_code rc; 364 409 rtems_driver_name_t *np; 365 rtems_libio_t *iop = rtems_libio_iop(fd);410 rtems_libio_t *iop; 366 411 rtems_libio_rw_args_t args; 367 412 413 if (rtems_file_descriptor_type(fd)) { 414 int (*fp)(int fd, const void *buffer, unsigned32 count); 415 416 fp = handlers[rtems_file_descriptor_type_index(fd)].write; 417 if (fp == NULL) { 418 errno = EBADF; 419 return -1; 420 } 421 return (*fp)(fd, buffer, count); 422 } 423 iop = rtems_libio_iop(fd); 368 424 rtems_libio_check_fd(fd); 369 425 rtems_libio_check_buffer(buffer); … … 398 454 rtems_status_code rc; 399 455 rtems_driver_name_t *np; 400 rtems_libio_t *iop = rtems_libio_iop(fd);456 rtems_libio_t *iop; 401 457 rtems_libio_ioctl_args_t args; 402 458 459 if (rtems_file_descriptor_type(fd)) { 460 int (*fp)(int fd, unsigned32 command, void *buffer); 461 462 fp = handlers[rtems_file_descriptor_type_index(fd)].ioctl; 463 if (fp == NULL) { 464 errno = EBADF; 465 return -1; 466 } 467 return (*fp)(fd, command, buffer); 468 } 469 iop = rtems_libio_iop(fd); 403 470 rtems_libio_check_fd(fd); 404 471 … … 429 496 ) 430 497 { 431 rtems_libio_t *iop = rtems_libio_iop(fd); 432 498 rtems_libio_t *iop; 499 500 if (rtems_file_descriptor_type(fd)) { 501 int (*fp)(int fd, rtems_libio_offset_t offset, int whence); 502 503 fp = handlers[rtems_file_descriptor_type_index(fd)].lseek; 504 if (fp == NULL) { 505 errno = EBADF; 506 return -1; 507 } 508 return (*fp)(fd, offset, whence); 509 } 510 iop = rtems_libio_iop(fd); 433 511 rtems_libio_check_fd(fd); 434 512 -
c/src/lib/libc/libio.h
rbed475e re2d79559 100 100 int __rtems_isatty(int _fd); 101 101 102 /* 103 * External I/O handlers 104 */ 105 typedef struct { 106 int (*open)(const char *pathname, unsigned32 flag, unsigned32 mode); 107 int (*close)(int fd); 108 int (*read)(int fd, void *buffer, unsigned32 count); 109 int (*write)(int fd, const void *buffer, unsigned32 count); 110 int (*ioctl)(int fd, unsigned32 command, void *buffer); 111 int (*lseek)(int fd, rtems_libio_offset_t offset, int whence); 112 } rtems_libio_handler_t; 113 114 void rtems_register_libio_handler(int handler_flag, 115 const rtems_libio_handler_t *handler); 116 117 #define RTEMS_FILE_DESCRIPTOR_TYPE_FILE 0x0000 118 #define RTEMS_FILE_DESCRIPTOR_TYPE_SOCKET 0x1000 119 #define rtems_make_file_descriptor(fd,flags) ((fd)|(flags)) 120 #define rtems_file_descriptor_base(fd) ((fd) & 0x0FFF) 121 #define rtems_file_descriptor_type(fd) ((fd) & 0xF000) 122 #define rtems_file_descriptor_type_index(fd) ((((fd) & 0xF000) >> 12) - 1) 123 102 124 #endif /* _RTEMS_LIBIO_H */ -
c/src/lib/wrapup/Makefile.in
rbed475e re2d79559 18 18 $(PROJECT_HOME)/lib/librtems$(LIB_VARIANT).a \ 19 19 $(wildcard $(PROJECT_HOME)/lib/libposix$(LIB_VARIANT).a) \ 20 $(wildcard $(PROJECT_HOME)/lib/libka9q$(LIB_VARIANT).a) \ 20 21 $(PROJECT_HOME)/lib/libcsupport$(LIB_VARIANT).a \ 21 22 $(wildcard $(PROJECT_HOME)/lib/rtems-ctor$(LIB_VARIANT).o) \ -
c/src/wrapup/Makefile.in
rbed475e re2d79559 18 18 $(PROJECT_HOME)/lib/librtems$(LIB_VARIANT).a \ 19 19 $(wildcard $(PROJECT_HOME)/lib/libposix$(LIB_VARIANT).a) \ 20 $(wildcard $(PROJECT_HOME)/lib/libka9q$(LIB_VARIANT).a) \ 20 21 $(PROJECT_HOME)/lib/libcsupport$(LIB_VARIANT).a \ 21 22 $(wildcard $(PROJECT_HOME)/lib/rtems-ctor$(LIB_VARIANT).o) \ -
configure
rbed475e re2d79559 17 17 \ 18 18 --disable-posix disable posix interface" 19 ac_help="$ac_help 20 \ 21 --disable-tcpip disable KA9Q TCP/IP stack" 19 22 ac_help="$ac_help 20 23 \ … … 616 619 c/src/lib/libbsp/m68k/gen68360/startup/Makefile \ 617 620 c/src/lib/libbsp/m68k/gen68360/timer/Makefile \ 621 c/src/lib/libbsp/m68k/gen68360/network/Makefile \ 618 622 c/src/lib/libbsp/m68k/gen68360/wrapup/Makefile \ 619 623 c/src/lib/libbsp/m68k/idp/Makefile \ … … 754 758 c/src/lib/libbsp/unix/posix/timer/Makefile \ 755 759 c/src/lib/libbsp/unix/posix/wrapup/Makefile" 760 761 tcpip_mk="c/src/lib/libka9q/Makefile" 756 762 757 763 tests_mk="c/src/tests/Makefile \ … … 900 906 901 907 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 902 echo "configure:90 3: checking whether ${MAKE-make} sets \${MAKE}" >&5908 echo "configure:909: checking whether ${MAKE-make} sets \${MAKE}" >&5 903 909 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` 904 910 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then … … 973 979 974 980 echo $ac_n "checking host system type""... $ac_c" 1>&6 975 echo "configure:9 76: checking host system type" >&5981 echo "configure:982: checking host system type" >&5 976 982 977 983 host_alias=$host … … 994 1000 995 1001 echo $ac_n "checking target system type""... $ac_c" 1>&6 996 echo "configure: 997: checking target system type" >&51002 echo "configure:1003: checking target system type" >&5 997 1003 998 1004 target_alias=$target … … 1012 1018 1013 1019 echo $ac_n "checking build system type""... $ac_c" 1>&6 1014 echo "configure:10 15: checking build system type" >&51020 echo "configure:1021: checking build system type" >&5 1015 1021 1016 1022 build_alias=$build … … 1049 1055 else 1050 1056 RTEMS_HAS_POSIX_API=yes 1057 fi 1058 1059 1060 # Check whether --enable-tcpip or --disable-tcpip was given. 1061 if test "${enable_tcpip+set}" = set; then 1062 enableval="$enable_tcpip" 1063 \ 1064 RTEMS_HAS_KA9Q=no 1065 else 1066 RTEMS_HAS_KA9Q=yes 1051 1067 fi 1052 1068 … … 1132 1148 esac 1133 1149 1150 # until the tcpip is made optional to build, just do this 1151 makefiles="$makefiles $tcpip_mk" 1152 1134 1153 case "${host}" in 1135 1154 *-pc-linux*) host_os=Linux ;; … … 1158 1177 set dummy $ac_prog; ac_word=$2 1159 1178 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 1160 echo "configure:11 61: checking for $ac_word" >&51179 echo "configure:1180: checking for $ac_word" >&5 1161 1180 if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then 1162 1181 echo $ac_n "(cached) $ac_c" 1>&6 … … 1187 1206 1188 1207 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 1189 echo "configure:1 190: checking whether ln -s works" >&51208 echo "configure:1209: checking whether ln -s works" >&5 1190 1209 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then 1191 1210 echo $ac_n "(cached) $ac_c" 1>&6 … … 1229 1248 RTEMS_BSP=$enableval 1230 1249 fi 1250 1231 1251 1232 1252 … … 1462 1482 s%@RTEMS_ROOT@%$RTEMS_ROOT%g 1463 1483 s%@RTEMS_HAS_POSIX_API@%$RTEMS_HAS_POSIX_API%g 1484 s%@RTEMS_HAS_KA9Q@%$RTEMS_HAS_KA9Q%g 1464 1485 s%@RTEMS_USE_MACROS@%$RTEMS_USE_MACROS%g 1465 1486 s%@PROJECT_ROOT@%$PROJECT_ROOT%g -
configure.in
rbed475e re2d79559 85 85 c/src/lib/libbsp/m68k/gen68360/startup/Makefile \ 86 86 c/src/lib/libbsp/m68k/gen68360/timer/Makefile \ 87 c/src/lib/libbsp/m68k/gen68360/network/Makefile \ 87 88 c/src/lib/libbsp/m68k/gen68360/wrapup/Makefile \ 88 89 c/src/lib/libbsp/m68k/idp/Makefile \ … … 223 224 c/src/lib/libbsp/unix/posix/timer/Makefile \ 224 225 c/src/lib/libbsp/unix/posix/wrapup/Makefile" 226 227 tcpip_mk="c/src/lib/libka9q/Makefile" 225 228 226 229 tests_mk="c/src/tests/Makefile \ … … 378 381 RTEMS_HAS_POSIX_API=no,RTEMS_HAS_POSIX_API=yes) 379 382 383 AC_ARG_ENABLE(tcpip, \ 384 [ --disable-tcpip disable KA9Q TCP/IP stack], \ 385 RTEMS_HAS_KA9Q=no,RTEMS_HAS_KA9Q=yes) 386 380 387 AC_ARG_ENABLE(rtems-inlines, \ 381 388 [ --disable-rtems-inlines disable RTEMS inline functions (use macros)], \ … … 451 458 ;; 452 459 esac 460 461 # until the tcpip is made optional to build, just do this 462 makefiles="$makefiles $tcpip_mk" 453 463 454 464 case "${host}" in … … 496 506 AC_SUBST(RTEMS_ROOT) 497 507 AC_SUBST(RTEMS_HAS_POSIX_API) 508 AC_SUBST(RTEMS_HAS_KA9Q) 498 509 AC_SUBST(RTEMS_USE_MACROS) 499 510 AC_SUBST(PROJECT_ROOT) -
cpukit/libcsupport/include/rtems/libio.h
rbed475e re2d79559 100 100 int __rtems_isatty(int _fd); 101 101 102 /* 103 * External I/O handlers 104 */ 105 typedef struct { 106 int (*open)(const char *pathname, unsigned32 flag, unsigned32 mode); 107 int (*close)(int fd); 108 int (*read)(int fd, void *buffer, unsigned32 count); 109 int (*write)(int fd, const void *buffer, unsigned32 count); 110 int (*ioctl)(int fd, unsigned32 command, void *buffer); 111 int (*lseek)(int fd, rtems_libio_offset_t offset, int whence); 112 } rtems_libio_handler_t; 113 114 void rtems_register_libio_handler(int handler_flag, 115 const rtems_libio_handler_t *handler); 116 117 #define RTEMS_FILE_DESCRIPTOR_TYPE_FILE 0x0000 118 #define RTEMS_FILE_DESCRIPTOR_TYPE_SOCKET 0x1000 119 #define rtems_make_file_descriptor(fd,flags) ((fd)|(flags)) 120 #define rtems_file_descriptor_base(fd) ((fd) & 0x0FFF) 121 #define rtems_file_descriptor_type(fd) ((fd) & 0xF000) 122 #define rtems_file_descriptor_type_index(fd) ((((fd) & 0xF000) >> 12) - 1) 123 102 124 #endif /* _RTEMS_LIBIO_H */ -
cpukit/libcsupport/src/libio.c
rbed475e re2d79559 80 80 } while (0) 81 81 82 /* 83 * External I/O handlers 84 * 85 * Space for all possible handlers is preallocated 86 * to speed up dispatch to external handlers. 87 */ 88 89 static rtems_libio_handler_t handlers[15]; 90 91 void 92 rtems_register_libio_handler( 93 int handler_flag, 94 const rtems_libio_handler_t *handler 95 ) 96 { 97 int handler_index = rtems_file_descriptor_type_index(handler_flag); 98 99 if ((handler_index < 0) || (handler_index >= 15)) 100 rtems_fatal_error_occurred( RTEMS_INVALID_NUMBER ); 101 handlers[handler_index] = *handler; 102 } 103 82 104 83 105 void … … 85 107 rtems_configuration_table *config, 86 108 unsigned32 max_fds 87 109 ) 88 110 { 89 111 rtems_libio_number_iops = max_fds; … … 254 276 rtems_libio_open_close_args_t args; 255 277 256 if ((rc = rtems_io_lookup_name(pathname, &np)) != RTEMS_SUCCESSFUL) { 257 /* 258 if ( rc == RTEMS_UNSATISFIED ) { 259 puts( "open -- ENOSYS case" ); 260 assert( 0 ); 261 } 262 */ 278 /* 279 * Additional external I/O handlers would be supported by 280 * adding code to pick apart the pathname appropriately. 281 * The networking code does not require changes here since 282 * network file descriptors are obtained using socket(), not 283 * open(). 284 */ 285 286 if ((rc = rtems_io_lookup_name(pathname, &np)) != RTEMS_SUCCESSFUL) 263 287 goto done; 264 }265 288 266 289 iop = rtems_libio_allocate(); … … 300 323 rtems_status_code rc; 301 324 rtems_driver_name_t *np; 302 rtems_libio_t *iop = rtems_libio_iop(fd);325 rtems_libio_t *iop; 303 326 rtems_libio_open_close_args_t args; 304 327 328 if (rtems_file_descriptor_type(fd)) { 329 int (*fp)(int fd); 330 331 fp = handlers[rtems_file_descriptor_type_index(fd)].close; 332 if (fp == NULL) { 333 errno = EBADF; 334 return -1; 335 } 336 return (*fp)(fd); 337 } 338 iop = rtems_libio_iop(fd); 305 339 rtems_libio_check_fd(fd); 306 340 … … 327 361 rtems_status_code rc; 328 362 rtems_driver_name_t *np; 329 rtems_libio_t *iop = rtems_libio_iop(fd);363 rtems_libio_t *iop; 330 364 rtems_libio_rw_args_t args; 331 365 366 if (rtems_file_descriptor_type(fd)) { 367 int (*fp)(int fd, void *buffer, unsigned32 count); 368 369 fp = handlers[rtems_file_descriptor_type_index(fd)].read; 370 if (fp == NULL) { 371 errno = EBADF; 372 return -1; 373 } 374 return (*fp)(fd, buffer, count); 375 } 376 iop = rtems_libio_iop(fd); 332 377 rtems_libio_check_fd(fd); 333 378 rtems_libio_check_buffer(buffer); … … 363 408 rtems_status_code rc; 364 409 rtems_driver_name_t *np; 365 rtems_libio_t *iop = rtems_libio_iop(fd);410 rtems_libio_t *iop; 366 411 rtems_libio_rw_args_t args; 367 412 413 if (rtems_file_descriptor_type(fd)) { 414 int (*fp)(int fd, const void *buffer, unsigned32 count); 415 416 fp = handlers[rtems_file_descriptor_type_index(fd)].write; 417 if (fp == NULL) { 418 errno = EBADF; 419 return -1; 420 } 421 return (*fp)(fd, buffer, count); 422 } 423 iop = rtems_libio_iop(fd); 368 424 rtems_libio_check_fd(fd); 369 425 rtems_libio_check_buffer(buffer); … … 398 454 rtems_status_code rc; 399 455 rtems_driver_name_t *np; 400 rtems_libio_t *iop = rtems_libio_iop(fd);456 rtems_libio_t *iop; 401 457 rtems_libio_ioctl_args_t args; 402 458 459 if (rtems_file_descriptor_type(fd)) { 460 int (*fp)(int fd, unsigned32 command, void *buffer); 461 462 fp = handlers[rtems_file_descriptor_type_index(fd)].ioctl; 463 if (fp == NULL) { 464 errno = EBADF; 465 return -1; 466 } 467 return (*fp)(fd, command, buffer); 468 } 469 iop = rtems_libio_iop(fd); 403 470 rtems_libio_check_fd(fd); 404 471 … … 429 496 ) 430 497 { 431 rtems_libio_t *iop = rtems_libio_iop(fd); 432 498 rtems_libio_t *iop; 499 500 if (rtems_file_descriptor_type(fd)) { 501 int (*fp)(int fd, rtems_libio_offset_t offset, int whence); 502 503 fp = handlers[rtems_file_descriptor_type_index(fd)].lseek; 504 if (fp == NULL) { 505 errno = EBADF; 506 return -1; 507 } 508 return (*fp)(fd, offset, whence); 509 } 510 iop = rtems_libio_iop(fd); 433 511 rtems_libio_check_fd(fd); 434 512
Note: See TracChangeset
for help on using the changeset viewer.