Subversion Repositories Kolibri OS

Rev

Rev 1029 | Rev 1695 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1029 Rev 1692
Line 1... Line 1...
1
#define FORCED_PIO
1
#define FORCED_PIO
Line 2... Line 2...
2
 
2
 
3
#include "types.h"
-
 
4
 
3
#include 
5
#include "pci.h"
4
#include "pci.h"
Line 6... Line 5...
6
#include "syscall.h"
5
#include 
Line 7... Line -...
7
 
-
 
8
#include "geode.h"
-
 
9
 
-
 
10
#define DEBUG
6
 
11
 
-
 
12
#ifdef DEBUG
-
 
13
  #define DBG(format,...) dbgprintf(format,##__VA_ARGS__)
-
 
Line 14... Line 7...
14
#else
7
#include "geode.h"
15
  #define DBG(format,...)
8
 
16
#endif
9
#define DBG(format,...) dbgprintf(format,##__VA_ARGS__)
Line 468... Line 461...
468
};
461
};
469
 
462
 
470
 
463
 
Line 471... Line 464...
471
u32_t __stdcall drvEntry(int action)
464
u32_t drvEntry(int action, char *cmdline)
472
{
465
{
473
    u32_t retval;
466
    u32_t retval;
Line 474... Line 467...
474
 
467
 
Line 475... Line 468...
475
    int i;
468
    int i;
476
 
469
 
Line 477... Line -...
477
    if(action != 1)
-
 
478
        return 0;
470
    if(action != 1)
479
 
471
        return 0;
480
#ifdef DEBUG
472
 
481
    if(!dbg_open("/rd/1/drivers/geode.log"))
473
    if(!dbg_open("/rd/1/drivers/geode.log"))
482
    {
474
    {
483
        printf("Can't open /rd/1/drivers/geode.log\nExit\n");
-
 
Line 484... Line 475...
484
        return 0;
475
        printf("Can't open /rd/1/drivers/geode.log\nExit\n");
485
    }
476
        return 0;
486
#endif
477
    }
487
 
478
 
488
    if( FindPciDevice() == FALSE)
479
    if( FindPciDevice() == FALSE)
Line 489... Line 480...
489
    {
480
    {
Line 514... Line 505...
514
#define DEV_SET_MASTERVOL      6
505
#define DEV_SET_MASTERVOL      6
515
#define DEV_GET_MASTERVOL      7
506
#define DEV_GET_MASTERVOL      7
516
#define DEV_GET_INFO           8
507
#define DEV_GET_INFO           8
517
 
508
#define DEV_GET_POS            9
518
 
509
 
519
int __stdcall srv_sound(ioctl_t *io)
-
 
-
 
510
int __stdcall srv_sound(ioctl_t *io)
Line 520... Line 511...
520
{
511
{
521
    u32_t *inp;
512
    u32_t *inp;
522
    u32_t *outp;
513
    u32_t *outp;
523
 
514
 
Line 549... Line 540...
549
            }
540
            }
550
            break;
541
            break;
551
 
542
 
552
    default:
543
        case DEV_GET_POS:
Line -... Line 544...
-
 
544
            if(io->out_size==4)
-
 
545
            {
-
 
546
                *outp = ctrl_read_32(0x60)>>2;
-
 
547
                return 0;
-
 
548
            }
-
 
549
            break;
-
 
550
 
-
 
551
    default:
553
      return ERR_PARAM;
552
      return ERR_PARAM;
554
  };
553
  };
555
  return ERR_PARAM;
554
  return ERR_PARAM;
556
}
555
}
557
>
556
>