/* ** TODAYBAK.C - Back up today's work to a specified floppy ** ** public domain demo by Bob Stout */ #include #include #include #include #if defined(__ZTC__) && (__ZTC__ < 0x600) #define _dos_getdate dos_getdate #define _dos_setdate dos_setdate #define _dosdate_t dos_date_t #endif #ifdef __TURBOC__ #define _dosdate_t dosdate_t #endif #ifndef SUCCESS #define SUCCESS 0 #endif #ifndef CAST #define CAST(new_type,old_object) (*((new_type *)&(old_object))) #endif #define LAST_CHAR(s) (((char *)s)[strlen(s) - 1]) struct DOS_DATE { unsigned int da : 5; unsigned int mo : 4; unsigned int yr : 7; } ; struct _dosdate_t today; struct DOS_DATE ftoday; char drive; void do_dir(char *); void usage(void); int main(int argc, char *argv[]) { int i; _dos_getdate(&today); ftoday.da = today.day; ftoday.mo = today.month; ftoday.yr = today.year - 1980; if (2 > argc) usage(); drive = *argv[1]; if (!strchr("AaBb", drive)) usage(); if (3 > argc) do_dir("."); else for (i = 2; i < argc; ++i) do_dir(argv[i]); return EXIT_SUCCESS; } void usage(void) { puts("usage: TODAYBAK floppy [dir1] [...dirN]"); puts(" Copies today's files to the specified floppy."); puts(" floppy = 'A' | 'B'"); puts(" with no directories specified, " "uses current directory"); exit(EXIT_FAILURE); } void do_dir(char *path) { char search[67]; struct find_t ff; strcat(strcpy(search, path), "\\*.*"); if (SUCCESS == _dos_findfirst(search, 0xff, &ff)) do { if (!(ff.attrib & _A_SUBDIR) && '.' != *ff.name) { if (ff.wr_date == CAST(unsigned short, ftoday)) { char cmd[128]; sprintf(cmd, "COPY %s\\%s %c: > NUL", path, ff.name, drive); system(cmd); } } } while (SUCCESS == _dos_findnext(&ff)); } d>
diff options
context:
space:
mode:
authorJon Derrick <jonathan.derrick@intel.com>2016-02-24 10:06:37 -0700
committerBjorn Helgaas <bhelgaas@google.com>2016-03-10 14:57:38 -0600
commit2c2c5c5cd213aea38c850bb6edc9b7f77f29802f (patch)
tree18565e7cb92ad8f54796e21b7b8b86581ff0f3dd /Documentation/devicetree/bindings/pci
parentd068c350c0486ba9011abb6f91cdc0c12b522155 (diff)
x86/PCI: VMD: Attach VMD resources to parent domain's resource tree
Attach the new VMD domain's resources to the VMD device's resources. This allows /proc/iomem to display a more complete picture. Before: c0000000-c1ffffff : 0000:5d:05.5 c2000000-c3ffffff : 0000:5d:05.5 c2010000-c2013fff : nvme c4000000-c40fffff : 0000:5d:05.5 After: c0000000-c1ffffff : 0000:5d:05.5 c2000000-c3ffffff : 0000:5d:05.5 c2000000-c3ffffff : VMD MEMBAR1 c2000000-c22fffff : PCI Bus 10000:01 c2000000-c200ffff : 10000:01:00.0 c2010000-c2013fff : 10000:01:00.0 c2010000-c2013fff : nvme c2300000-c24fffff : PCI Bus 10000:01 c4000000-c40fffff : 0000:5d:05.5 c4002000-c40fffff : VMD MEMBAR2 Signed-off-by: Jon Derrick <jonathan.derrick@intel.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Keith Busch <keith.busch@intel.com>
Diffstat (limited to 'Documentation/devicetree/bindings/pci')