Ignore:
Timestamp:
Dec 2, 2002, 7:13:26 PM (18 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
36ea4c2a
Parents:
25f37e8
Message:

2002-12-02 Joel Sherrill <joel@…>

  • include/rtems/libio.h: Internally use a union of an unsigned64 and major/minor device so we don't get into trouble shifting. The h8300 seemed to be impossible to remove warnings otherwise. Eventually the structure definition of a dev_t might be better anyway.
  • include/sys/ioccom.h: Added casts to remove warnings on 16 bit targets.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libcsupport/include/rtems/libio.h

    r25f37e8 r7e476f0  
    456456 */
    457457
     458#if 0
    458459#define rtems_filesystem_make_dev_t( _major, _minor ) \
    459460  ((((dev_t)(_major)) << 32) | (dev_t)(_minor))
     
    464465#define rtems_filesystem_dev_minor_t( _dev ) \
    465466  (rtems_device_minor_number) ((_dev) & 0xFFFFFFFF)
     467#else
     468
     469#include <unistd.h>
     470
     471union __dev_t {
     472  dev_t device;
     473  struct {
     474     rtems_device_major_number major;
     475     rtems_device_minor_number minor;
     476  } __overlay;
     477};
     478
     479static inline dev_t rtems_filesystem_make_dev_t(
     480  rtems_device_major_number _major,
     481  rtems_device_minor_number _minor
     482)
     483{
     484  union __dev_t temp;
     485
     486  temp.__overlay.major = _major;
     487  temp.__overlay.minor = _minor;
     488  return temp.device;
     489}
     490
     491static inline rtems_device_major_number rtems_filesystem_dev_major_t(
     492  dev_t device
     493)
     494{
     495  union __dev_t temp;
     496
     497  temp.device = device;
     498  return temp.__overlay.major;
     499}
     500
     501
     502static inline rtems_device_minor_number rtems_filesystem_dev_minor_t(
     503  dev_t device
     504)
     505{
     506  union __dev_t temp;
     507
     508  temp.device = device;
     509  return temp.__overlay.minor;
     510}
     511
     512#endif
    466513
    467514#define rtems_filesystem_split_dev_t( _dev, _major, _minor ) \
Note: See TracChangeset for help on using the changeset viewer.